Built and test the circuit shows below:
1. Components
3 1N4001 diodes, 3 LED, 2 0.1uF capacitors, 1 9V1 5.6mA zener diode, 7 resistors, 1 LM324 opamps.
2. Calculation
R6=10KR Vr6=9.1V-0.63V=8.47V, Ir6=Vr6/R6=8.47V/10Kohms=0.847mA
There is no current can flow through the input of opamps, so Ir6=Ir7=Ir8=0.847mA
R7=Vr7/Ir7=0.23V/0.847mA=271R
R8=Vr8/Ir8=(0.63V-0.23V)/0.847mA=472R
Vr5=Vs-Vd2-Vd1=12V-0.6V-9.1V=2.3V Ir5=Ir6+Id1=0.847mA+5.6mA=6.447mA
R5=Vr5/Ir5=2.3V/6.447mA=356R
Vr2=Vs-Vd1-Vled=12V-0.6V-1.8V=9.6V Ir2=Iled=9.5mA
R2=Vr2/Ir2=9.6V/9.5mA=1010R
Vr3=Vs-Vd1-Vd4-Vled=12V-0.6V-0.6V-1.8V=9V Ir3=Iled=9.5mA
R3=Vr3/Ir3=9V/9.5mA=947R
Vr4=Vs-Vd1-Vled=12V-0.6V-1.8V=9.6V Ir4=Iled=9.5mA
R2=Vr4/Ir4=9.6V/9.5mA=1010R
3.Design the circuit
I found the terminal numbers of LM324 show as below
I designed the circuit show as below
4. Built the circuit
First time the circuit I build is not working. I checked the circuit board connection if that same as I done on lochmaster, then I find out i soldered the bridge wire of terminal 11 to the wrong strip. I fix this mistake and the circuit board works fine.
I chose R2=1.2KR R3=1KR R4=1.2KR R5=390R R6=10KR R7=270R and R8=470R.
When sensor input voltage is lower then 0.22V Green LED glows |
When sensor input voltage is between 0.22V to 0.63V Yellow LED glows |
When sensor input voltage is higher than 0.63V Red LED glows |
5. Measuring and Explain
No matter what the sensor input voltage is, the Voltage drop cross the following components won't change.
Vd2=0.70V
knee voltage of diode
Vr5=2.23V
R5 is in series circuit with supply, one diode and the whole parallel circuit of zener diode.
Vc1=11.49V
C1 is in parallel circuit after one diode from supply.
Vc2=9.26V
C2 is in parallel circuit with the zener diode, so the voltage drop cross C2 is even to zener voltage.
Vd1=9.27V
The zener voltage of the zener diode.
Vr6=8.63V
Vr8=0.39V
Vr7=0.22V
R6, R7 and R8 are in series circuit share the zener voltage 9.26V.
When sensor input voltage is 0.9V and Red LED glows:
Vr2=8.57V
The available voltage after D2 minus voltage drop cross red LED and terminal 7.
Vr3=8.25V
R3 is in series circuit with terminal 8 and share the voltage came from terminal 1 after D3.
Vr4=0V
No current flow through R4.
Vd3=0.68V
The knee voltage when D3 works.
Vd4=0.51V
The knee voltage when D4 works.
Vled-red=1.98V
The available voltage after D2 minus voltage drop cross R2 and terminal 7.
Vled-yellow=1.76V
Yellow LED share the voltage difference between available voltage after D2 and available voltage after D3 with D4.
Vled-green=1.27V
Difference between available voltage after D2 and available voltage after R4 from terminal 14.
Available voltage of terminals:
V1=9.83V V2=0.63V V3=0.90V V4=11.43V V5=0.63V V6=0.90V V7=0.80V
V8=0.91V V9=0.90V V10=0.23V V11=0V V12=0.90V V13=0.22V V14=10.14V
When sensor input voltage is 0.9V, it is higher than terminal 13 in-, terminal 10 in+, terminal 5 in- and terminal 2 in-. So inverting voltage for terminals 7 and 8, non-inverting voltage for terminals 1 and 14. Terminal 7 to earth and red LED glow. Terminal 1 connect to "+" of supply and gives voltage to yellow LED circuit, low the voltage cross the yellow LED and switch it off, and current flow through terminal 8 to earth. Terminal 14 is non-inverting, so green LED is reverse bias, it doesn't glow.
When sensor input voltage is 0.2V and Green LED glows:
Vr2=0V
No current flow through R2.
Vr3=0V
No current flow through R3
Vr4=8.55V
R4 is in series circuit with terminal 14, green LED and share the available voltage after D2.
Vd3=10.20V
The different voltage between terminal 1 and the centre of yellow LED and R3.
Vd4=0.7V.
The knee voltage of D4.
Vled-red=1.28V
The different voltage between available voltage after D2 and terminal 7.
Vled-yellow=1.07V
The different voltage between available voltage after D4 and terminal 8.
Vled-green=2.02V
Green LED is in series with R4 and terminal 14, share the available voltage after D2.
Available voltage of terminals:
V1=0V V2=0.63V V3=0.20V V4=11.46V V5=0.63V V6=0.20V V7=10.17V
V8=10.17V V9=0.20V V10=0.23V V11=0V V12=0.20V V13=0.23V V14=0.88V
When sensor input voltage is 0.2V, is lower than terminal 13 in-, terminal 10 in+, terminal 5 in+ and terminal 2 in-. So inverting voltage for terminals 1 and 14, non-inverting voltage for terminal 7 and 8. Terminal 7 connect to earth and green LED glow. Red LED and Yellow LED are reverse bias so they don't glow.
When sensor input voltage is 0.5V and Yellow LED glows:
Vr2=0V
No current flow through R2
Vr3=6.54V
R3 in series with terminal 8, yellow LED and D4, share the available voltage after D2.
Vr4=0V
No current flow through R4
Vd3=7.44V
The different between terminal 1 and the centre of yellow LED and R3.
Vd4=0.65V
The knee voltage of D4
Vled-red=1.27V
The different voltage between available voltage after D2 and terminal 7.
Vled-yellow=3.41V
Yellow LED share the available voltage with terminal 8, D4 and R3.
Vled-green=1.27V
The different voltage between available voltage after D2 and terminal 14.
Available voltage of terminals:
V1=0V V2=0.63V V3=0.50V V4=11.46V V5=0.63V V6=0.50V V7=10.17V
V8=0.86V V9=0.50V V10=0.23V V11=0V V12=0.50V V13=0.22V V14=10.17V
When sensor input voltage is 0.5V, it is higher than terminal 13 in- and terminal 10 in+, lower than terminal 5 in+ and terminal 2 in-. So inverting voltage for terminal 1 and 8, non-inverting for terminal 7 and 14. Because terminal 7 and 14 are non-inverting, the green LED and Red LED are reverse bias, they dont glow. Terminal 1 and 8 are inverting, so yellow LED is forward bias, it glows. Because of the D3 is reverse bias, the current can only go through R3 and terminal 7 to the earth.
Vd2=0.70V
knee voltage of diode
Vr5=2.23V
R5 is in series circuit with supply, one diode and the whole parallel circuit of zener diode.
Vc1=11.49V
C1 is in parallel circuit after one diode from supply.
Vc2=9.26V
C2 is in parallel circuit with the zener diode, so the voltage drop cross C2 is even to zener voltage.
Vd1=9.27V
The zener voltage of the zener diode.
Vr6=8.63V
Vr8=0.39V
Vr7=0.22V
R6, R7 and R8 are in series circuit share the zener voltage 9.26V.
When sensor input voltage is 0.9V and Red LED glows:
Vr2=8.57V
The available voltage after D2 minus voltage drop cross red LED and terminal 7.
Vr3=8.25V
R3 is in series circuit with terminal 8 and share the voltage came from terminal 1 after D3.
Vr4=0V
No current flow through R4.
Vd3=0.68V
The knee voltage when D3 works.
Vd4=0.51V
The knee voltage when D4 works.
Vled-red=1.98V
The available voltage after D2 minus voltage drop cross R2 and terminal 7.
Vled-yellow=1.76V
Yellow LED share the voltage difference between available voltage after D2 and available voltage after D3 with D4.
Vled-green=1.27V
Difference between available voltage after D2 and available voltage after R4 from terminal 14.
Available voltage of terminals:
V1=9.83V V2=0.63V V3=0.90V V4=11.43V V5=0.63V V6=0.90V V7=0.80V
V8=0.91V V9=0.90V V10=0.23V V11=0V V12=0.90V V13=0.22V V14=10.14V
When sensor input voltage is 0.9V, it is higher than terminal 13 in-, terminal 10 in+, terminal 5 in- and terminal 2 in-. So inverting voltage for terminals 7 and 8, non-inverting voltage for terminals 1 and 14. Terminal 7 to earth and red LED glow. Terminal 1 connect to "+" of supply and gives voltage to yellow LED circuit, low the voltage cross the yellow LED and switch it off, and current flow through terminal 8 to earth. Terminal 14 is non-inverting, so green LED is reverse bias, it doesn't glow.
When sensor input voltage is 0.2V and Green LED glows:
Vr2=0V
No current flow through R2.
Vr3=0V
No current flow through R3
Vr4=8.55V
R4 is in series circuit with terminal 14, green LED and share the available voltage after D2.
Vd3=10.20V
The different voltage between terminal 1 and the centre of yellow LED and R3.
Vd4=0.7V.
The knee voltage of D4.
Vled-red=1.28V
The different voltage between available voltage after D2 and terminal 7.
Vled-yellow=1.07V
The different voltage between available voltage after D4 and terminal 8.
Vled-green=2.02V
Green LED is in series with R4 and terminal 14, share the available voltage after D2.
Available voltage of terminals:
V1=0V V2=0.63V V3=0.20V V4=11.46V V5=0.63V V6=0.20V V7=10.17V
V8=10.17V V9=0.20V V10=0.23V V11=0V V12=0.20V V13=0.23V V14=0.88V
When sensor input voltage is 0.2V, is lower than terminal 13 in-, terminal 10 in+, terminal 5 in+ and terminal 2 in-. So inverting voltage for terminals 1 and 14, non-inverting voltage for terminal 7 and 8. Terminal 7 connect to earth and green LED glow. Red LED and Yellow LED are reverse bias so they don't glow.
When sensor input voltage is 0.5V and Yellow LED glows:
Vr2=0V
No current flow through R2
Vr3=6.54V
R3 in series with terminal 8, yellow LED and D4, share the available voltage after D2.
Vr4=0V
No current flow through R4
Vd3=7.44V
The different between terminal 1 and the centre of yellow LED and R3.
Vd4=0.65V
The knee voltage of D4
Vled-red=1.27V
The different voltage between available voltage after D2 and terminal 7.
Vled-yellow=3.41V
Yellow LED share the available voltage with terminal 8, D4 and R3.
Vled-green=1.27V
The different voltage between available voltage after D2 and terminal 14.
Available voltage of terminals:
V1=0V V2=0.63V V3=0.50V V4=11.46V V5=0.63V V6=0.50V V7=10.17V
V8=0.86V V9=0.50V V10=0.23V V11=0V V12=0.50V V13=0.22V V14=10.17V
When sensor input voltage is 0.5V, it is higher than terminal 13 in- and terminal 10 in+, lower than terminal 5 in+ and terminal 2 in-. So inverting voltage for terminal 1 and 8, non-inverting for terminal 7 and 14. Because terminal 7 and 14 are non-inverting, the green LED and Red LED are reverse bias, they dont glow. Terminal 1 and 8 are inverting, so yellow LED is forward bias, it glows. Because of the D3 is reverse bias, the current can only go through R3 and terminal 7 to the earth.