Introduction: Celtic Dragon Mosaic With Sound Activated LED-eye
This is a another cool mosaic work made by my wife Mieke inspired by drawings of celtic dragons.
I designed the electronics for the sound activated "breathing" red LED, that forms the ominous eye of the dragon.
So this project is not for the faint-hearted. ;-)
The "breathing" LED is sound activated using a miniature electret microphone and will "breathe" as long as sound is detected.
Once it is quiet, the dragon goes to sleep and the eye extinguishes.
But when sound is detected again, the dragon wakes up again and the red eye will start "breathing" again.
Step 1: Circuit Explaination
The circuit consists of a high gain audio preamplifier for the microphone. I decided to build the preamplifier with transistors, but an OPAMP can of course also do the job.
The preamplifier consists of Q5 and Q2. The gain of the preamplifier is determined by the trim potmeter R12, resistor R2 and the negative feedback resistor R6.
With the trim potmeter, the gain can be adjusted from 100x to 1200x. Q5 amplifies the microphone signal.
At the collector of Q5, we find the inverted amplified microphone signal. This signal is further amplified by Q2. The signal at the emitter of Q2 has the same phase as the signal at the collector of Q5, So at the emitter of Q2, the amplified inverted microphone signal is present. This signal is fed back to the base of Q5 via R6, thus providing negative feedback. The lower R6, the more negative feedback and the lower the gain will be. The lower the resistance of R12, the higher the gain of Q2, because the gain of Q2 is defined by the ratio of its collector resistor R2 and its emitter resistor R12. R4 does not play a role for the AC gain, because for AC, R4 is short circuited by C4. So R4 is only there to set the DC bias needed for the base of Q5. When the trim potmeter is set to it's lowest value, the gain will be about 1200x. When the trim potmeter is set to it's highest value, the gain of the amplifier will be about 100x.
The amplifier is followed by a squarer circuit that converts the amplified microphone signal to a square wave.
The squarer circuit consists of R3, R8, Q1 and R9. The base of Q1 is set to 2,47V (= 470K * (3V / 570K)), which is 0.52V below the power supply rail. So the base of Q1 is 0.5V below the voltage at the emitter of Q1. This means that Q1 is at the edge of conducting but just not conducting. It needs about 0,7V to conduct. So when the amplified microphone signal has an amplitude of 0.2V at the collector of Q2, Q1 will start conducting. When Q1 conducts, the collector of Q1 will be pulled towards the power supply rail. When the amplified microphone signal has an amplitude below 0.2V, Q1 will stop conducting and the collector of Q1 falls back to ground. This way, the amplified microphone signal is converted to a square wave that moves between ground and the supply rail.
The squarer circuit is followed by a peak detector, formed by D2, C5 and R10. As soon as the microphone picks up a sound that is loud enough (threshold is set by R12), the collector of Q1 will bounce from ground to supply rail with the frequency of the detected sound. At first instance, C5 is discharged, so the voltage at C5 is 0V. When sound is detected, D2 will start charging C5 as long as the signal at the anode of D2 is higher than the voltage over C5. When no sound is detected anymore, while C5 is fully charged, R10 will discharge C5 very slowly, because R10 has a very high resistance. As soon as sound is detected again, D2 will charge C5 again. The voltage over C5 tends to follow the peak of the voltage at the anode of D2. Due to R10, the peak detector is lossy and when no sound is detected anymore, the output of the peak detector will slowly sink to 0V.
Astable multivibrator generating non-linear sawtooth signal:
The peak detector output is connected to the /RESET of a NE555, that is configured as an astable multivibrator. When no sound is detected, the peak detector output goes to 0, so the /RESET of the NE555 becomes active and the astable multivibrator stops oscillating. When sound is detected, the peak detector output rises up to the power supply rail, so the /RESET of the NE555 becomes inactive and the astable multivibrator starts oscillating. The duty cycle of the astable oscillator is set by R7 via D2 and by R13 via D4. By using the diodes we can individually set the ON and OFF period of the square wave produced at the output of the NE555. C7 and R11 determine the frequency of the square wave. The LED is not connected to the output pin of the NE555, because we want the LED to slowly fade in and out instead of blinking. So we use the signal at C7 for the LED. This signal is a non-linear sawtooth waveform that is formed by the charging and discharging curve of C7. Because we don't want to distort this signal, we use 2 transistors Q3 and Q4 that form a darlington pair to buffer the voltage over C7. The darlington pair has a very high current gain, so it will draw a very small current from C7 while driving the LED with a current of about 18mA. R14 determines the current that is sent through the LED. The voltage at C7 will not move completely up to the power supply rail, but moves between 1/3 and 2/3 of the power supply. So the maximum voltage over C7 is about 2V. The voltage over R14 will be the voltage over C7 (= 2V max) minus 2 base-emitter junctions (= about 1.4V) of the darlington pair = 0.6V. 0.6V divided by the value of R14 gives us a current of 18mA maximum. Because the collector current will be fairly equal to the emitter current, the current through the LED will be maximum 18mA.
So check that the LED you are going to use is happy with about 20mA. Otherwise, increase R14 to decrease the LED current.
The circuit is powered by 2x rechargeable 2100mAh NiMH AA batteries and works for about 1,5 to 2 months when we don't make too much noise. :-)
Step 2: Build Pictures
See comment boxes in the pictures for more information