Pages: [1] 2   Go Down
Author Topic: Arduino Micro and Tricolor LED Strip  (Read 4299 times)
0 Members and 1 Guest are viewing this topic.
San Francisco
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys, getting my first Arduino project running and have hit a snag. Can't get the LED strip light from radioshack (http://www.radioshack.com/product/index.jsp?productId=16306856&clickId=489254786&affiliateId=59782&affiliateCustomId=#) 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!
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
#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
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34118
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 @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.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34118
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
@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.
Logged

San Francisco
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
#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.

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?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34118
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

with the IC on the strip it seems similiar to this:
http://learn.adafruit.com/adalight-diy-ambient-tv-lighting/wiring-1

maybe it helps
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34118
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

with the IC on the strip it seems similiar to this:
http://learn.adafruit.com/adalight-diy-ambient-tv-lighting/wiring-1

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.
Logged

San Francisco
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34118
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

San Francisco
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@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?
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

whats written on the small IC, whats its name?
Logged

San Francisco
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Offline Offline
Full Member
***
Karma: 2
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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: http://www.robotroom.com/Pilot-Switch-2.html
maybe it helps
Logged

Pages: [1] 2   Go Up
Jump to: