Go Down

Topic: LED sequencing (Read 2557 times) previous topic - next topic

Lingy13

Hi all,

I want to create a circuit that is able to store multiple profiles of different LED sequences/configurations. As I'm completely new to this (Recommended to this by a technician at university), I've no idea what components I'd need to be able to create a circuit that can do this. The LEDs i've been supplied with will be powered by a 12V battery.

Also I've minimal coding skills, so anywhere I can try and learn for myself how to code the LED sequences and profiles?

Thanks,

Riva

You will find loads of similar projects on here if the search option is working and people will willingly give you ideas and help if you describe the problems/needs and supply the relevant information. So questions that first come to mind are...
Do you have a datasheet for your LED's.

How many LED's are we talking about for the sequence.

How do you switch profiles and do they switch instantly or at end of sequence.
Don't PM me for help as I will ignore it.

Lingy13

Thanks for your reply.

It doesn't need to be anything complicated since I just need a prototype for an experiment. It's a test to see whether certain lighting effects can make a motorbike more easily detected, thus decreasing chance of an accident.

As I don't know what you mean by a datasheet for my LEDs, I probably dont have that.

I have 16 LEDs to play with at the moment, but will be paired up to help raise the intensity. The LEDs are supplied  by RS Components, the automotive 12V festoon lamp and holder.

I was initially thinking of just using a switch that goes: On -> Setting 1 -> Setting 2 -> Setting 3 -> Off ->
It would not be a problem for the profiles to switch instantly or at the end of the sequence. I would probably opt for the simplest code to save time.

PaulRB

#3
Nov 19, 2014, 12:50 am Last Edit: Nov 19, 2014, 12:52 am by PaulRB
Hi, what current does each festoon led draw, and how many lit at any instant? I think I would wire 16 Arduino outputs (would have to use analog input pins as outputs) to 2 x uln2803 chips to drive the festoon leds. If that uses too many pins, use 2 tpic6c595. This is assuming the current is less than 150 mA per led module.

Paul

Riva

Quote
The LEDs are supplied  by RS Components, the automotive 12V festoon lamp and holder.
Can you supply the RS part number?
Don't PM me for help as I will ignore it.

Lingy13

part number is LE-0503-03W and it draws 20mA according to their website.

Riva

Right, we have the details for the LED's.
They are 12V with an internal 450ohm resistor for current limiting so as PaulRB suggests you could use a Darlington array like the ULN2803 but this depends on how many LED's your driving (from what you have written before it looks like 8 ports with 2x leds per port.

Don't PM me for help as I will ignore it.

Lingy13

yes. 8 ports, with 2 leds per port. would using the ULN2803 be fine ?

PaulRB

Yes, 40mA per port, 320mA total, is well within the uln2803's maximum current.

Paul

marco_c

For software you can probably modify the MultiBlink example that is in my code repository (link below). Different sequences can be stored as program data.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

CrossRoads

Use TPIC6B595 shift register to sink current from the pairs, or use two and drive all individually.

Make an array with your pattern and shift it out, with 1 = on:
Code: [Select]

byte patternArray[] = {
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00100000,
0b01000000,
0b10000000,
};

Code: [Select]

// time to send out next pattern?
x = x+1;
if (x==8){x=0;} // reset to top of pattern
digitalWrite (ssPin, LOW); // connect to RCLK
SPI.transter (patternArray[x]); // SCK connect to SRCLK, MOSI to Ser Data it
digitalWrite (ssPin, HIGH); // outputs change on this rising edge
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.

Lingy13

Thanks everyone! I've ordered the parts I needed and will crack on with the coding!

Thanks for all your help, I appreciate it.

Go Up