0
\$\begingroup\$

I am using a few ULN2803's to control LED's. The pin connections and circuit that I am using are shown in the figures below.

When a HIGH signal is sent to any of the inputs of the transistor array, all of the LED's switch on, whereas only the one receiving the 5V signal is supposed to be switching to ground.

When there is no HIGH signal to any of the inputs, all LED's are off.

Is there something obvious that I am missing? What would the solution be?

ULN803 Pin connections

schematic

simulate this circuit – Schematic created using CircuitLab

ULN2803 Datasheet

\$\endgroup\$
  • 2
    \$\begingroup\$ Why have you got a 300 ohm resistor in the ground connection? \$\endgroup\$ – Andy aka Sep 23 '16 at 13:53
  • \$\begingroup\$ To limit the current through the LED(s). \$\endgroup\$ – Lkz Sep 23 '16 at 13:59
  • \$\begingroup\$ Have you thought about why that doesn't work when different numbers of LED's are lit? \$\endgroup\$ – John U Sep 23 '16 at 14:47
1
\$\begingroup\$

O1, O2, ... On outputs are open collectors. So, cathode of each LED should be connected to each output. Don't forget to connect the anode of each LED to positive supply line with a series current limiter resistor (First answer shows how to calculate its value). GND should go the negative supply line (i.e. (-) terminal of battery) - If you want to measure total load current, you can place a small resistor (say, 1 Ohm) between this pin and negative supply line. COMMON terminal is for protecting the collectors, so you can connect this pin directly to the positive supply line:

schematic

simulate this circuit – Schematic created using CircuitLab

Also, if you want to drive a single LED for each output, I personally recommend you to use 5V or 9V instead. Because 12V seems to be a bit high.

\$\endgroup\$
  • 1
    \$\begingroup\$ So, the question asked was why his circuit does what it does. Sure, making a recommendation is nice but it doesn't answer the question. \$\endgroup\$ – Andy aka Sep 23 '16 at 15:32
0
\$\begingroup\$

The positive side of your supply has to go to anode of the leds with a resistor in series. The negative side of your supply to the ground. The common again to the positive side of your supply. Is only for protection against flyback. See the example in the datasheet.

\$\endgroup\$
0
\$\begingroup\$

You are raising the common emitter voltage with R1 so that they all turn on.

  • To use it properly, ground pin 9 to Vbat- and supply series Current limiting R to each LED { chose on either side}.

  • Normally the supply voltage is only <2V greater than the LED string

  • You calculate the V drop on R to limit the current and subtract the Vout(sat) voltage from Vbat @ estimated current.

    • If you use a single LED, then choose 5V
      • and (5-1.2-Vf{led}) / If{led} = R
\$\endgroup\$
  • \$\begingroup\$ How does raising the emitter voltage turn on an NPN transistor? \$\endgroup\$ – Andy aka Sep 23 '16 at 14:08
  • \$\begingroup\$ good question. ... maybe...thru the parasitic output diodes not intended as conductors. All LEDs on dim. \$\endgroup\$ – Sunnyskyguy EE75 Sep 23 '16 at 14:23
  • \$\begingroup\$ I think I will try this. Any specific reason to use separate resistors for each LED besides having a constant current flow that does not depend on the number of active LED's? Asking since space is very limited so adding individual resistors could be quite difficult. I don't mind some fluctuations in brightness. \$\endgroup\$ – Lkz Sep 23 '16 at 14:39
  • \$\begingroup\$ What LEd pn and current? \$\endgroup\$ – Sunnyskyguy EE75 Sep 23 '16 at 14:41
  • \$\begingroup\$ Also, you are correct that the LED's not intended to switch on are on dim. \$\endgroup\$ – Lkz Sep 23 '16 at 14:41
0
\$\begingroup\$

Here is how I would do this.

First, I would select a LED (for example this one Datasheet). From this particular datasheet we can see that the typical forward voltage is 3.2 V @ IF 20 mA. (Substitute in your own values as needed.)

Now we need to select a resistor to drop the 12 V supply down to about 3.2V. $$V = IR$$ $$(12 - 3.2)V = 20mA * R$$ $$R = 440 Ohms$$

Now as a check we should ask how much power will be dissipated in the resistor. $$P = VI$$ $$P = 8.8V * 20mA$$ $$P = 0.176 watts.$$ So a 440 Ohm 1/4 watt resistor for each LED is required. (440 Ohms is not a standard value so you can use two 220 in series) On a side note, if this is for a home project that shouldn't be a problem, if not you may want to consider lowering the voltage of the Power Supply (Battery) to waste less power.

Putting it all together...

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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