2
\$\begingroup\$

enter image description hereHow to drive the ULN2003 to show the on/off status of relays (green LED for ON and Red for off)?

\$\endgroup\$
  • 1
    \$\begingroup\$ Welcome to EE.SE. Have you created a diagram or worked this out on paper? What software tools do you have to help you out? \$\endgroup\$ – Sparky256 Jul 17 '16 at 16:35
  • \$\begingroup\$ The ULN' is for driving the relays. The LEDs are your problem. \$\endgroup\$ – Ignacio Vazquez-Abrams Jul 17 '16 at 16:35
  • \$\begingroup\$ @Sparky256 Thanks for your kind words, I just used this schematic with a 1k resistor and it works, Is it possible to add an other LED to show the off state? \$\endgroup\$ – Mehran Jul 17 '16 at 17:10
4
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. On and off indications using one Darlington buffer output.

  • R1 drives the green LED as in your schematic.
  • When Q1 turns off current flows through RLY1 to light the LED. If, for example, the coil resistance was 300 Ω then about 5.5 mA would flow through that circuit. It is very unlikely that the relay will remain on with 5 mA through the coil.

To give yourself some confidence check the minimum hold-on voltage for your relay and measure the voltage across the coil when R2 and the red LED are in series.

[@Sparky256's comment:] If Q1 is OFF, won't there be current flow through R1 and R2 and both LED's? Or enough to keep the Green LED dimly lit.

enter image description here

Figure 2. A Finder 12 V relay with a 300 Ω coil.

At 5.5 mA calculated above the voltage across the coil of this relay would be \$ V = IR = 5.5m \times 300 \approx 1.7 V \$. Let's be generous and say that the LED forward voltage will only be 1.5 V at small current. That leaves 0.2 V across the 1.8k series resistor so the current R1 and the green LED would be \$ I = \frac {V}{R} = \frac {0.2}{300} \approx 0.7~mA \$.

enter image description here

Figure 3. LED forward current and voltage relationship.

Depending on the efficiency of the LED this might be a problem. It will be very faint in relationship to the red LED which would be on at this time.

@Spehro's comment: I would suggest adding an NPN voltage follower (eg. 2N4401) to the lower side of the coil (collector to +12, base to ULN2003 output Q1, emitter to R2 (1.5K). That way the current through the coil when off will certainly be negligible.

schematic

simulate this circuit

Figure 4. Schematic for Spehro to edit.

\$\endgroup\$
  • 1
    \$\begingroup\$ If Q1 is OFF, won't there be current flow through R1 and R2 and both LED's? Or enough to keep the Green LED dimly lit. \$\endgroup\$ – Sparky256 Jul 17 '16 at 17:23
  • \$\begingroup\$ Good point. See the update. \$\endgroup\$ – Transistor Jul 17 '16 at 17:40
  • \$\begingroup\$ I would suggest adding an NPN voltage follower (eg. 2N4401) to the lower side of the coil (collector to +12, base to ULN2003 output Q1, emitter to R2 (1.5K). That way the current through the coil when off will certainly be negligible. Big improvement for one inexpensive part. \$\endgroup\$ – Spehro Pefhany Jul 17 '16 at 17:42
  • 1
    \$\begingroup\$ @Mehran: Thanks for accepting my answer but you couldn't have tested it already! In any case it's a good idea to wait a day or two to see if better answers come along. Spehro, for example, has a modification. Once you accept it's a disincentive for others to answer. \$\endgroup\$ – Transistor Jul 17 '16 at 17:45
  • 1
    \$\begingroup\$ @SpehroPefhany: Sorry I don't follow your idea. When off the current through the coil lights the red LED. It's the voltage across it we wish to keep low to prevent the green turning on. I've posted Figure 4 for you to edit if you feel like it. \$\endgroup\$ – Transistor Jul 17 '16 at 17:52
1
\$\begingroup\$

To get "OFF" state indication use a second ULN2003 driven by the first one. Because the bias current to drive a ULN2003 will make your "ON" LED's come on dim, add a 1K resistor across the ON LED's so bias currents will not turn them ON. This way the first IC turn on the relays and the ON LED, while the second IC turns on the OFF LED (Not at the same time). You can tie all Vcc lines together.

\$\endgroup\$
  • \$\begingroup\$ Am I missing something obvious? Where do bias currents come into this? \$\endgroup\$ – Transistor Jul 17 '16 at 17:22
  • \$\begingroup\$ I should say leakage current through the Green LED and the relay coil. It is enough to turn on a second IC but the Green LED may come on dimly. \$\endgroup\$ – Sparky256 Jul 17 '16 at 17:26
  • \$\begingroup\$ Thanks but you've posted this on Sparky's answer. Which answer are you using? \$\endgroup\$ – Transistor Jul 17 '16 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.