LM311 Comparator Sound Light

This article is about LM311 comparator sound light toy.


You can see the circuit working in this video:



Step 1: Design the Circuit

There were two main challenges in this project:
- biasing the comparator to avoid using two batteries,
- stopping the oscillations

I have drawn the circuit in PSpice Simulation Software.

I biased the circuit with Rv1 and Rv2 resistors.


During breadboard prototyping, I could not stop the circuit from oscillating. Thus I added an additional RC filter (made from Rs2, Cs2a, and Cs2b components).


You can use replace 470 uF capacitor pairs with one 1000 uF capacitor. However, those capacitors are usually expensive and large in size.


You can also replace R1, Rv1 and Rv2 with 100 kohms and C1 with 470 nF (low Farad value pillow capacitors are more reliable than higher Farad value (10 uF C1 capacitor) electrolytic capacitors). I have chosen similar resistors (10 kohms) to reduce the variety of components in my circuit to save you time searching for components (if you decide to build this circuit). However, I have not tested the alternative. You have to beware of the offset and biasing currents that can saturate the comparator output with higher value 
R1, Rv1, and Rv2 resistors. This is why R1 resistor is so important and should not be replaced with an open circuit.


Because Cv2a and Cv2b capacitors AC equivalents are short circuits even at low frequencies, the maximum low pass band pass frequency is:

flp = 1/(2*pi*R1*C1)

= 1/(2*pi*10,000 ohms*(10*10^-6 Farads))

= 1.59154943092 Hz

Assuming the impedance of the microphone in parallel with the Rm resistor (AC equivalent model), this frequency will be below 1.5916 Hz.




Step 2: Simulations

I modelled the LED component with three diodes because the old software does not have LED components:

The maximum LED current is just below 10 mA. I have chosen 1 kohm Rled resistor so that the circuit can work with the maximum power supply of 12 V.



Step 3: Make the Circuit

I used a wire wrap socket for the LM311 comparator IC.


The orange capacitor is a bipolar capacitor because the current across the capacitor will change directions when the circuit is working. You have to choose this bipolar capacitor with a low leakage current.

I used two 1 kohm resistors in parallel for Rled (not 1 kohm resistor) because I needed a high current for my big green LED.



Step 4: Encasement

I used a drill to make holes for the switch and potentiometer:




Step 5: Testing

The circuit works with tapping:


The circuit worked with music. This was a direct connection with wire when I disconnected the microphone circuit and connected comparator input (10 uF capacitor pin) directly to computer earphone output by simply pressing on the red DPST (double pole single throw) switch:



Conclusion

The circuit is working. I used a 20 kohm potentiometer to limit the maximum amplitude of music from earphone output that was saturating the LED (causing the LED to be ON all the time). The potentiometer is connected in voltage divider configuration.

No comments:

Post a Comment