1

I'm not super-good with my electrical foo. But I've managed to get a ULN2803 wired up to give the +12v that my RGB LED strip needs. The strip has four connectors, RGB and common +12v.

My concern is that (I think) the Arduino is shorting out- while the Arduino processes my loop, the USB connection dies and the RX/TX LEDs light up.

Here's how I am wiring things. I'm currently powering the Arduino through USB, so when I say "power supply" I'm referring to the +12v supply I'm using.

  • power supply ground to Arduino ground, ULN2803 pin 9.
  • power supply +12v to 2803 pin 10, common +12v on LED strip.
  • arduino output pin 11 to 2803 pin 1
  • 2803 pin 18 to green LED strip

So, that's my circuit. It works- the strip lights up. But again, I think it's wrong. How do I correct it?

  • "2803 pin 19 to green LED strip" ... What? – Ignacio Vazquez-Abrams Sep 21 '14 at 21:10
  • @IgnacioVazquez-Abrams it's actually pin 18 (corrected), note the goal is to light a RGB strip from the Arduino, so pin 18 is connected to the 'green' segment of the LED strip. – tedder42 Sep 21 '14 at 21:44
  • Is it a common ground LED strip (as per title) or common 12V LED strip (as per point 2 in question)? – geometrikal Sep 21 '14 at 22:01
  • @geometrikal it's common +12v (sorry, I got the title wrong), 'common anode'. – tedder42 Sep 21 '14 at 22:18
  • How is the arduino powered? From the same 12v? – Gerben Sep 22 '14 at 18:11
1

The COM pin on the ULN2803 is for protection when driving inductive loads, which means motors, solenoid. For an LED, nothing needs connect to COM.

The chip you are using is a low side driver. That means it connects between the low side of the load (your LED) and ground. When you drive +5 to the input pin, the transistors will conduct, connecting the output pin to ground.

So for your LED strip make the following connections:

  • Arduino output pin -> driver input, 1B = pin 1
  • driver output, 1C = pin 18 -> LED strip R G or B
  • +12 -> LED strip common power
  • ground -> GND = pin 9

Without the ground connection on the driver chip, no surprise that odd things happened. There are diodes designed to protect the input and output pins (see chip data sheet). Without the ground connection to the driver chip, the input protection diode might have been conducting back to the microcontroller output pin.

  • so, the only change you recommend is to not connect COM to +12v (or to anything). I did that, and initially it starts to work (say, with one color) but as I add more input/output pairs (R,G,B) it goes into "failure mode"- I don't know if it's shorting or going overvoltage on USB, but it's definitely dying. I can drive all three colors at a low PWM value (say, analogwrite 30) but anything further on all three colors causes the Arduino to fault out. That makes me think that I'm doing something very wrong. – tedder42 Sep 22 '14 at 2:37
  • 1
    The input pins on the driver can't draw enough current to exceed the ratings of the Arduino output pins. More likely you are exceeding the rating of the 12 V supply or the LED's. Start at DC without any microcontroller: Just with wires turn each color on and off, one at a time. Touch for a second the driver input to +5 and see that the LED lights. Does the driver chip get hot? If not, then plug it in and leave on a few seconds. Still not hot? Then try turning on 2 at a time, then all three. Once you have shown that driver chip, power supply, and LED are okay, then go to code. – jdr5ca Sep 22 '14 at 4:26
  • I spent an evening with my Fluke meter and a bunch of different debugging attempts. LEDs work fine on their own. I worked back up to arduino+driver and ensured the +5v and +12v lines were holding their voltage, then checked the amperage of the LED strip. (1.3A per color). That's actually more than the 12v+2A supply is rated for, but I was testing ONE color and it was failing. Ultimately it was the USB power source. I hooked it up to an actual +5V source and the Arduino quit "crashing". So it must have been drawing enough current to cause my OS to suspend power. Also, the USB hub died! – tedder42 Sep 25 '14 at 4:48
  • so basically, @jdr5ca, your hardware debugging process was perfect to figure this out. – tedder42 Sep 25 '14 at 4:49
  • Current measure mode -- highly overlooked feature of even the simplest DVM. Better than setting things on fire. 1.3 A each? That is more than the rating of the driver chip, yes? – jdr5ca Sep 25 '14 at 7:56

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.