Arduino Micro and Tricolor LED Strip

Hey guys, getting my first Arduino project running and have hit a snag. Can't get the LED strip light from radioshack (RadioShack.com Official Site - America's Technology Store) working with my Arduino Micro.

Here's what I've done:

  1. Downloaded the strip_1m.pde, modified the code for the ATMEGA like so:
    #define DATA_1 (PORTF |= 0X01) // DATA 1 // for ATMEGA
    #define DATA_0 (PORTF &= 0XFE) // DATA 0 // for ATMEGA
    #define STRIP_PINOUT DDRF=0xFF // for ATMEGA
    //#define DATA_1 (PORTC |= 0X01) // DATA 1 // for UNO
    //#define DATA_0 (PORTC &= 0XFE) // DATA 0 // for UNO
    //#define STRIP_PINOUT (DDRC=0xFF) // for UNO

  2. Found an old 12V adapter (tested, puts out around 12.25V), ran hot to LED strip +12V (red), ground to Arduino ground and LED strip ground (black).

  3. Ran LED strip DIN (green) to A0 on Arduino.

Seems pretty simple. When I upload the code to the arduino and plug in the 12V adapter, nothing... no lights at all.

What am I missing?

Thanks so much!

According to the schematics A0 is PF7 on the Arduino Micro. So your code should read:

#define DATA_1 (PORTF |=  0XF0)    // DATA 1    // for Micro
#define DATA_0 (PORTF &=  0X7F)    // DATA 0    // for Micro
#define STRIP_PINOUT DDRF=0xF0  // for ATMEGA

What am I missing?

I think the fact that you do not drive the strip like this. However I can't find the files on that link that tell you how to drive that strip.
From the look of the photos there is a chip that needs driving with data.

However if I am wrong and there is no chip on the strip you still do not drive it by directly connecting it to an arduino. This is because you will fry your arduino by having a voltage of more than the supply connected to it. You need to drive that sort of strip through a transistor.

@Grumpy_Mike: But that's what the manual linked in the shop page suggests. They say you should drive the Arduino with a 12V power supply, connect the Vcc of the strip to VIN, ground to GND and the control line to A0. It really looks like they have a chip on the strip. Each chip is controlling 3 RGB LEDs. There's only one control line, called Data. The OPs problem is that A0 on the UNO is a different pin than A0 is on his Arduino Micro.

@Grumpy_Mike: But that's what the manual linked in the shop page suggests.

It might but if so then it is crap isn't it. Written by an idiot.

pylon:
According to the schematics A0 is PF7 on the Arduino Micro. So your code should read:

#define DATA_1 (PORTF |=  0XF0)    // DATA 1    // for Micro

#define DATA_0 (PORTF &=  0X7F)    // DATA 0    // for Micro
#define STRIP_PINOUT DDRF=0xF0  // for ATMEGA

Great! I guessed these numbers could be the culprit. Where/how did you come up with them? Changed them, still not working.

Grumpy_Mike:
This is because you will fry your arduino by having a voltage of more than the supply connected to it. You need to drive that sort of strip through a transistor.

I hear you on this. But according to the specs: External (non-USB) power can come either from a DC power supply or battery. Leads from a battery or DC power supply can be connected to the Gnd and Vin pins... and the Micro has an Input Voltage (maximum) of 6V - 20V.

I didn't have BOTH the USB and 12V power supply connected at the same time, just the 12V to vin and ground, then I connected the LED strip to those same two pins + the A0 pin. Shouldn't that work?

But according to the specs: External (non-USB) power can come either from a DC power supply or battery. Leads from a battery or DC power supply can be connected to the Gnd and Vin pins... and the Micro has an Input Voltage (maximum) of 6V - 20V.

I didn't have BOTH the USB and 12V power supply connected at the same time, just the 12V to vin and ground, then I connected the LED strip to those same two pins + the A0 pin. Shouldn't that work?

No you are totally misunderstanding this. The Voltage input on the power jack is regulated down to 5V to power the processor. So what ever voltage you put into the power jack you only have 5V on the processor. Therefore you can't feed it with a 12V signal.
When the LED is on, the pin sinks current and everything is fine. When the LED is off there is 5V on the output of the arduino but this is connected to 12V through the LEDs. This causes there to be a voltage of 12 - 5 = 7V across the LED strip. This is enough to turn the red LEDs on dimly. There was a post about this the other day. It also causes the excess current to trickle into the arduino exceeding the maximum input voltage. If this current is greater than 1mA you will eventually blow the internal protection diodes and leave your arduino a brick.

with the IC on the strip it seems similiar to this:

maybe it helps

lax123:
with the IC on the strip it seems similiar to this:
Wiring | Adalight Project Pack | Adafruit Learning System

maybe it helps

They are different LEDs and they are only powered off 5V not 12V.

With reference to my last comments try this experiment. Wire the common +ve to the 12V supply and measure the voltage between the ground and the wire you want to connect to the arduino. You will see the voltmeter will read 12V. You don't want to connect 12V to an input as I said.

Grumpy_Mike:
Wire the common +ve to the 12V supply and measure the voltage between the ground and the wire you want to connect to the arduino. You will see the voltmeter will read 12V. You don't want to connect 12V to an input as I said.

Alright, so I've got the +ve from the 12V supply going to the VIN and the LED Strip. The ground from the supply going to the Arduino ground and LED Strip ground. And the LED strip control going to the A0 Output. The voltage drop across the A0 output and ground is <1V.

And the LED strip control going to the A0 Output.

I didn't say that, I said without connecting it to anything else. If your arduino was unpowered when you did this then I would expect the readings you got.

@Grumpy_Mike I'm not following you.

So you want me to connect the 12V supply to the LED strip (both + and neutral). And then what?

whats written on the small IC, whats its name?

The ICs on the LED Strip are TM1803. Here are the specs:

http://www.radioshack.com/graphics/uc/rsk/Support/SoftwareDownload/2760249.zip

I dont have much knowledge myself but maybe you could use a level shifter from 12 to 5V or just use a voltage divider.
Voltage divider helped me when I needed to use an SD card, SD cards should only get 3,3V, ardu data outputs are 5V, so by using the divider it worked fine and no more errors that I had before.

also i found this: Wiring a 12 V Switch and LED to a 5 V Circuit - Robot Room
maybe it helps

Thanks for the help, all. I ended up getting these, which worked like a charm with my Micro:

If anyone out there gets the micro to work with that radioshack strip, I'd still like to know how they did it.

For what its worth it looks like the guy in this video- Radio Shack Tri-color LED Strips How-to - YouTube is using a Micro with the RS LED Strip. He explains the wiring in the beginning, and it looks like he's using a 12v battery pack with a splitter. Also, I think the library he's using is the older version of the Pololu Library at Release 1.2.0 · pololu/pololu-led-strip-arduino · GitHub. Hope this helps!

The RadioShack LED strips work fine, using the UNO and the code from the RS files. The micro and the LED strip share two pins: ground; and, the data OUTPUT pin from the UNO (A0) to the data input on the strip. The 12 volt + lead to the LED strip does not need to connect to the arduino at all. If the UNO is powered by 12 volts through the barrel plug (NOT the USB), then 12 volts is available on the board's Vin pin. The only limitation of the RS RGB LED strip is that the LEDs are illuminated in groups of three - which is why it needs 12 volts. Because the LEDS are powered as "common anode", with three of the same color in series and the chip connecting them to ground "on command" from the micro. Thus, each group of three LEDS shares one TM1803 chip. Each TM1803 chip on the LED strip is powered with 5V from a local zener diode mounted on the strip itself - one Zener per TM1803 chip. This may seem confusing when you first read the LED srip specs, because although each of the chips operates at 5V, because the three LEDs are in series, the stip itself requires 12 volts to illuminate the LEDs.
RGB LED Strip Schematic (NOT RS - but similar) - http://www.alibaba.com/product-detail/5m-TM1803-dream-color-led-strip_404117879.html
TM1803 spec - http://www.cylinderlight.com/wp-content/uploads/2013/06/TM1803.pdf
Some modified code - with several new patterns - including Red-White-Blue patterns for the Fourth of July are here (code too large for here):
Arduino RadioShack RGB LED Strip TM 1803 4th July Patterns - Pastebin.com