Sound Sensor to ZX-XX

Here you can share completed projects or parts of projects that may be useful to others. You may post files relevant to ZBasic - source code, schematics, etc.
zbasicandy
Posts: 193
Joined: 25 January 2006, 19:56 PM

Sound Sensor to ZX-XX

Post by zbasicandy »

Ever needed a sound sensor attached to a ZX-xx Microcontroller?
Here it is.

We use this sound sensor it to pick-up alarms from the following devices which generate a high decibel sound output:
(The sound sensor (Electret Mike) is place near the device.)

Carbon Dioxide CO2 Detectors/Alarms.
Carbon Monoxide Detectors/Alarms.
Smoke & Fire Alarms.
LPG Sensors Detectors/Alarms.
Natural Gas Detectors/Alarms.
Water Warning Leak Detection Alarm (www.smarthome.com)
Burglar Alarms.
Emergency Weather Alarms.

See http://www.futurlec.com/Gas_Sensors.shtml
for special gas sensors.

Programmable Weather Station Alarms.
(La Crosse models # 23xx)
http://www.lacrossetechnology.com/
1. Time alarm
2. Indoor temperature high alarm and low alarm
3. Outdoor temperature high alarm and low alarm
4. Indoor humidity high alarm and low alarm
5. Outdoor humidity high alarm and low alarm
6. Wind chill high alarm and low alarm 24
7. Dew point alarm high alarm and low alarm
8. Rainfall 24h alarm
9. Rainfall 1h alarm
10. Pressure high alarm and low alarm
11. Wind speed high alarm and low alarm
12. Wind direction alarm
13. Storm warning alarm

The operation of the sound sensor is very simple. The Electret Mic just outputs a few millivolts. The LM741 has a gain factor of ~1000 to feed into the ZX-xx analog input. By using the Zbasic command GetADC(pinx,single) the value will range from 0.0 to 1.0 volts. Loud sounds will have a larger "voltage output/input" That's it ... have fun.
:) :) :)
Attachments
Sound_R1.zip
Schematic of Sound Sensor R1
(4.2 KiB) Downloaded 3884 times
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Sound Sensor to ZX-XX

Post by GTBecker »

Schematic of Sound Sensor R1
The LM741 does not operate well as a 5-volt single supply amplifier;
it's specification is 10v minimum. The 741 design (a god-send in it's
day) is 37 years old, I understand. A contemporary device will likely
work much better.


Tom
Tom
zbasicandy
Posts: 193
Joined: 25 January 2006, 19:56 PM

Sound Sensor

Post by zbasicandy »

For some unknown reason it works just fine in this application.
Total parts cost ~$2.00 plus Electret Mic.
:D :D :D
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Re: Sound Sensor

Post by GTBecker »

zbasicandy wrote:... some unknown reason ...
:D :D :D
Exactly. That is not good engineering. You've specified a part in an inappropriate - and probably inoperable - environment. If it works for you, that's not good enough.
Tom
zbasicandy
Posts: 193
Joined: 25 January 2006, 19:56 PM

Sound Sensor

Post by zbasicandy »

Again, we will stand on the merits of this design.
If you have a better low cost circuit please feel
free to post it on another link.
------------------------------------------
ZBasicAndy's neighbor
zbasicandy
Posts: 193
Joined: 25 January 2006, 19:56 PM

Sound Sensor

Post by zbasicandy »

If it works for you, that's not good enough.
To make Tom feel happy ... replace the LM741 with a CA3140E.

:D :D :D





----------------------------------

ZBasicAndy
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Re: Sound Sensor

Post by GTBecker »

If you want a challenge to your design, I invite you simply remove the amplifier, altogether. Connect the microphone directly to the rectifying/peak detecting diode. The opamp, even if powered properly, isn't configured for gain, anyway; it's just an inverting unity-gain stage, biased at 0.9v. Pull the IC and jumper pins 2 and 6, input to output. I'll bet that works just as poorly.

Assuming somehow the amplifier is working, still what you've done is biased the amplifier output to 0.9v above ground, then lost 0.7v of that to the series diode. Your smoothed peaks should be about 0.2v!

You built this circuit, you say, and it yielded peaks of a volt out? I doubt it. Am I wrong or just annoying?
Tom
zbasicandy
Posts: 193
Joined: 25 January 2006, 19:56 PM

Sound Sensor

Post by zbasicandy »

The LM741 with a CA3140E will both work.
:D :D :D
zbasicandy
Posts: 193
Joined: 25 January 2006, 19:56 PM

Sound Sensor

Post by zbasicandy »

Here is a view of the thoroughly tested sound sensor.
Talk is cheap. We test before we post!

:D :D :D


What Tom does not realize is all we are looking for is a sizable increased in amplitude of the pre-amp. The range varies between .35 to 1.0 using the GetADC(pinx,single) command. It will not pickup noises e.g. TV/Radio/HiFi unless it is close to the sound sensor. The filtering and opamp design is critical to prevent this from occurring.

Tom ... breadboard yours and make it work glitch free.





-------------------------------------------
ZBasicAndy & Neighbor Design Team
:D :D :D
Attachments
Completed Test Circuit.zip
(148.36 KiB) Downloaded 3776 times
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Sound Sensor to ZX-XX

Post by GTBecker »

> ... please breadboard and test it thoroughly...

Wise.

Could you please describe how your circuit works? It appears to defy
rational design and requires some explanation, don't you agree?
Tom
zbasicandy
Posts: 193
Joined: 25 January 2006, 19:56 PM

Sound Sensor

Post by zbasicandy »

Connect the microphone directly to the rectifying/peak detecting diode
Tom's Design flaws
#1 The output of any Electret Mike is just a few millivolts! Good luck in trying to increase this signal to the ADC input without an opamp amplifier!!!! Elementary Electronics 101

#2. Impedance mismatch will occur if you don't interface the Electret mike properly. You will lose your signal. Elementary Electronics 101

:D :D :D
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Re: Sound Sensor

Post by GTBecker »

> ... GetADC(pinx,single) the value will range from 0.0 to 1.0 volts...
> ... The range varies between .35 to 1.0 using the GetADC(pinx,single)...

Which is correct? If the latter is correct, you've got a serious problem, Andy. It is not possible to produce a five-volt output from your circuit. I don't believe it will even yield a legitimate volt, so I doubt the former, too. Do you have a scope?

> ... without an opamp amplifier...

Your schematic shows R13 and R17 are both 1k. If that is correct your amplifier has no gain, Andy.
Tom
zbasicandy
Posts: 193
Joined: 25 January 2006, 19:56 PM

Sound Sensor

Post by zbasicandy »

From the original post.
The operation of the sound sensor is very simple. The Electret Mic just outputs a few millivolts. The LM741 has a gain factor of ~1000 to feed into the ZX-xx analog input
I did not review the schematic ... R17 should be 1 Meg.
I just fired my neighbor.

Connect the microphone directly to the rectifying/peak detecting diode
Tom's Design flaws
#1 The output of any Electret Mike is just a few millivolts! Good luck in trying to increase this signal to the ADC input without an opamp amplifier!!!! Elementary Electronics 101

#2. Impedance mismatch will occur if you don't interface the Electret mike properly. You will lose your signal. Elementary Electronics 101

Post your circuit when you ever get it to work.

:) :) :)
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Re: Sound Sensor

Post by GTBecker »

> ... R17 should be 1 Meg.

OK, that makes some sense (if the amplifier works at all). What about the output voltage? How do you get five volts - or even one volt - out of that circuit?
Tom
zbasicandy
Posts: 193
Joined: 25 January 2006, 19:56 PM

Sound Sensor

Post by zbasicandy »

The output is @ 3.06 VDC. When there is a loud noise the amplifer
amplifies the input signal 1000 times to several hundred millivolts RMS A.C.
Thats why we get a "signal range" from (single-float) .35 to ~1.0 on the
analog input. That's our circuit which works! If you don't believe us please
build this circuit yourself!

Now what about "your no gain" circuit that you designed that is
better with impedance mismatches, more expensive and works?

:D :D :D
Locked