Go Down

Topic: Sequential LED turn signal (Read 9992 times) previous topic - next topic

drz400dude

I was wondering if it would be possible to make a sequential LED turn signal out of one LED strip. So when I activate left turn the LEDs light up right to left and right signal vice versa. Any input would be appreciated. Thanks!


CrossRoads

Sure, just need a 'smart' LED strip (controller per LED, like WS2812, which is also RGB - see adafruit.com for neopixel), vs a 'dumb' LED strip where one pin controls on/off of the whole strip.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

drz400dude

Cool. I've never messed with any arduino boards so I'm not sure what all I would have to do. My idea is to mount the flex strip to the rear fender of my motorcycle.
1. Would all of the components be too bulky for a motorcycle?
2.  Would/could they be weather resistant?
3. The strips say they are powered by 5vdc, but automotive systems are 12vdc. How would that work?

PaulRB

#3
Sep 29, 2015, 11:47 pm Last Edit: Sep 29, 2015, 11:50 pm by PaulRB
Hi?

1. No. Have a look at Arduino Nano 3, Arduino Pro Mini (you will need a Usb-Serial adaptor) or ATtiny85 (you will need a programmer like USBasp).
2. Some strips are weather resistant, some are not. Your other components will certainly need a weatherproof enclosure
3. You need a 12V to 5V DC-DC convertor.

Paul

drz400dude

Hi?

1. No. Have a look at Arduino Nano 3, Arduino Pro Mini (you will need a Usb-Serial adaptor) or ATtiny85 (you will need a programmer like USBasp).
2. Some strips are weather resistant, some are not. Your other components will certainly need a weatherproof enclosure
3. You need a 12V to 5V DC-DC convertor.

Paul
Thanks Paul. I'll do some more research on the board.

drz400dude

So this is what I was thinking:

-arduino nano 3
http://www.amazon.com/gp/aw/d/B003YVL34O#Ask

-neopixel 60/meter LED strip
https://www.adafruit.com/products/1461

Plus the usb>serial cable which I assume it's for loading the code from computer to board?

And something like this for the 12>5vdc converter?http://www.amazon.com/gp/aw/d/B00BWLP88A/ref=mp_s_a_1_4?qid=1443593114&sr=8-4&pi=AC_SX110_SY165_QL70&keywords=12vdc+to+5vdc&dpPl=1&dpID=41X5keSvRUL&ref=plSrch

As well as the capacitor and resistors they recommend in the neopixel guide.

Any problems with this setup?

PaulRB

That DC converter will be able to run a strip of around 40~45 leds, plus the Nano. How long/how many leds were you going to use on the bike's strip?

Have you thought how you will pick up the signals from the turn indicators on the bike? Did you want to use the strip as a stop/brake light also? And as a reversing light (I know nothing about bikes. Do they even have reverse gear?)

drz400dude

That DC converter will be able to run a strip of around 40~45 leds, plus the Nano. How long/how many leds were you going to use on the bike's strip?

Have you thought how you will pick up the signals from the turn indicators on the bike? Did you want to use the strip as a stop/brake light also? And as a reversing light (I know nothing about bikes. Do they even have reverse gear?)
The strip will only be about 12 inches long at most. The strip has 60/meter. So it will only have about 30 lights at the very most. Should be no problem. Those aren't the EXACT products in going to buy. Just getting together what components I need.

If I'm using the board I can bypass the flasher relays and go from the turn signal switch to the 5vdc converter to the board.

For now I just want to do the turn signals. No bikes don't have a reverse.

The only question I have is how will I seperate left and right turn? It is 2 wires coming off the turn signal switch, can I hook up a left wire to a terminal and have it run the left program and the right wire to another terminal for the right signal program? How does it work?

CrossRoads

The Nano/Promini/whatever has 20 IO pins.
One pin reads left turn input, another for right turn, third for brakes.
Making the left to right sequence, or right to left sequence, or all on/all off for brakes, is fairly simple software program.
Code: [Select]

void loop(){
if (digitalRead(leftPin) == HIGH){
// right to left turn sequence
}
if (digitalRead(rightPin) == HIGH){
//left to right turn sequence
}
if (digitalRead(brakePin) == HIGH){
// all on sequence
}

and expand from there.
Example, if turning, and brakes are applied, do something different.
If brakes are on, and then turned off, do something different.
If brakes are on and turn is selected, do something different.
That's the fun part.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

drz400dude

#9
Sep 30, 2015, 11:39 pm Last Edit: Sep 30, 2015, 11:46 pm by drz400dude
Awesome! Thanks both of you.

Another thing I was thinking, each wire coming from the turn signal switch is 12v. What would I need to do to drop both to 5v and keep the signals seperate?  I guess I could put the converter before the switch? So everything fun the switch on is 5v

CrossRoads

Just need 2 resistors to make a voltage divider for each input.
http://www.raltron.com/cust/tools/voltage_divider.asp
Or use a transistor for better isolation from 12-14V on the signal pins:
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jack wp

Most motorcycles do not have reverse (makes sense), but there are some that do, such as some Honda  Goldwings.

drz400dude

Most motorcycles do not have reverse (makes sense), but there are some that do, such as some Honda  Goldwings.
That is true. A very select few do. But 99% do not. Mostly big heavy bastards too big to back up by pushing with your feet have reverse.

PaulRB

#13
Oct 01, 2015, 08:11 am Last Edit: Oct 01, 2015, 08:20 am by PaulRB
How about these? 144 leds per metre, double the brightness if you need to make your strip less than 12".

WS2812 use up to 60 mA per led. However, that maximum is only when displaying full brightness white. When yellow, the current will be only two thirds of that. Flashing patterns even less.

Paul__B

- arduino Nano 3

- neopixel 60/meter LED strip

Plus the USB>serial cable which I assume it's for loading the code from computer to board?

And something like this for the 12>5vdc converter?
So you do not need a Nano and a USB-TTL converter as the Nano has USB built in.  What you do want instead is a Pro Mini and a USB-TTL converter as you only use that for (re-)programming and disconnect it after.

If I'm using the board I can bypass the flasher relays and go from the turn signal switch to the 5vdc converter to the board.
Well, there a re a few tricks to this.  In general, indicator circuits have the flasher in the power line to the turn signal switch which then switches it to either left or right indicators.  The flasher only flashes when it has the current from the lamps passing through it.  I am not sure whether you proposed "bypassing" the flasher entirely - which would be a problem if you still need to have lights visible from the front - or something else.

The other aspect is that you probably just want the 5V regulator to be fed power whenever the ignition is on, so it can do its job properly, not switched on and off as you might do by having diodes feeding it from each of the signal circuits (including stop) that might be implemented.

For now I just want to do the turn signals. No bikes don't have a reverse.
I was going to comment on that, but others have done it to death.

The only question I have is how will I separate left and right turn? It is 2 wires coming off the turn signal switch, can I hook up a left wire to a terminal and have it run the left program and the right wire to another terminal for the right signal program? How does it work?
So given that you still have lights visible at least at the front and this is only in addition to the normal indicators, you feed power continuously from the ignition circuit and sense each of the left and right turn signals, and the stop signal, with separate lines via the voltage dividers mentioned.

Note that turn indicators - flashers - always work that the moment the switch is closed, the light starts by being on then turns off after a delay and so on.  The reason it works this way should be obvious, but you might wish to take that into account in your program - perhaps half the display lights, then "wipes off" in the direction indicated before it proceeds with whatever other pattern.  And since the signal will be flashing on and off, you have to determine what the maximum "off" time is before you can decide that the indication is actually stopped.

Go Up