0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« on: December 14, 2010, 12:56:47 pm » |
Hi guys,
I am building a police light set up (wait wait, I know, but this is only for my self for demo purposes and to use for offroad use). This will be a simple set up: 2 pods in the back window: each has 12 blue leds (two rows of 6) and 12 red leds (2 rows of 6) 4 pods in the grill each consisting of 4 leds: two blue and two red pods
Totaling 64 leds. I will be using 3mm piranha leds from superbrightleds.
So far I have built one pod ( 24 leds) on a breadboard where each pin connects to two leds (I figured that's at most what it can handle from each pin as its rated up to 40ma)
At this point I am not sure how to proceed to connect the rest 40 leds and make them work together. I have a mega which will easily accommodate this, but don't want to waste it. Or I can build another clone using atmega 328 to use for the other pod(s).
should I use Charlieplexing? Is this the easiest way to accomplish my task? That way I can use just one board?
This will be connected to the car. I have searched topics on connecting it to the car and have gotten a few diff ways to do it.
Therefore I am wondering, if I tap into the radio or perhaps some other source will it be enough to power my 64 leds?
What is the easiest and safest way to connect my clone or uno/mega to my car to have it work?
Thanks,
Roman
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #1 on: December 14, 2010, 01:39:39 pm » |
Just realized that i can use one pin for one color in each pod. BECAUSE i will not be running individual patterns on the leds but rather a bunch at a same time doing the same thing (blink blue , blink red, blink blink blue, blink blink red)
Do i need some kind of led driver for this? i understand that i can basically make this set up work with 2 pins?
pin 12 = all blue (total 32 leds) pin 11 = all red leds (total 32)
how would i go about powering this up in my car?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16439
Available for Design & Build services
|
 |
« Reply #2 on: December 14, 2010, 11:20:20 pm » |
That's pretty straightforward. Arrange your LEDs in strings of 8 LEDs connected in series with a current limit resistor, 4 strings per color. Each string will require <=20 mA from a 16-20V source. Wire the 4 strings in parallel. Obtain a DC upconverter from pololu.com such as this http://www.pololu.com/catalog/product/799to convert the car's 12-14V up to the 20V or as needed for your particular LEDs. Then a single NPN or MOSFET transistor such as IRF3707Z can be driven by the arduino to turn each LED collection on & off.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16439
Available for Design & Build services
|
 |
« Reply #3 on: December 14, 2010, 11:34:09 pm » |
Here's an example of 4 strings of LEDs wired in parallel, driven by a 12V source. The transistor that drives them is elsewhere (and is in fact in this case a 7406 IC, a hex driver that is good for higher currents (40mA) and up to 30V outputs). If you're really driving at 20mA, then just hook up 2 strings per output pin. http://focus.ti.com/lit/ds/symlink/sn7406.pdf
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 269
Posts: 25417
Solder is electric glue
|
 |
« Reply #4 on: December 15, 2010, 04:46:21 pm » |
Just a point, I wouldn't wire two LEDs in parallel as they won't share current equally. You need a resistor in the cathode of each LED, then you can wire the LED / resistor combination in parallel.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16439
Available for Design & Build services
|
 |
« Reply #5 on: December 15, 2010, 07:30:31 pm » |
Sharing current - is that really more of a concern where LEDs with different characteristics are used? I have 8 digits with 7 segments each made of 3 parallel LEDs & decimal points made of 2 parallel LEDs being driven by a MAX7221, multiplexing at 800 Hz (not user changeable). Some digits use Red LEDs, some digits use yellow LEDs, some digits use Orange LEDs. I have been testing with this setup for a while, letting it run for hours at a time, and I am not seeing any visual difference in intensity anywhere. I also have some really bright (10,000)mCD capable white LEDs paired up in parallel, driven by a 7406, that are not turned on anyhwere nearly as often as the digits, that seem to be doing okay.
I'll have to break open a couple of lines and stick a really low value resister in, measure the voltage across it on a scope and see what current they're actually running at.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #6 on: December 16, 2010, 08:43:24 pm » |
Thanks guys for the replies CrossRoads, i made a diagram of what i understand it to be. However i tried searching for the IRF3707Z or 7406 ic but to no avail. Please point me in the right direction. is it also availbale from pololu? so i can order everything at once? I tried radioshack and the like and none have IRF3707Z.  I want this done before new years so i will overnight parts however i dont know what to order. red leds are rated at 20mA and 2.0v blue leds are at 20mA and 3.3v or so. which resistors do i need? I used online calculator and for the blue i got 390 ohm resistor if wired by 4 in series with 8 rows and for red i got 220ohm if using like u suggested Thanks for any tips i really appreciate it Roman
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16439
Available for Design & Build services
|
 |
« Reply #8 on: December 17, 2010, 12:18:31 am » |
Ok Roman, that is a shame, I bought 10 of those a while ago & now can't find them anywhere. I searched at mouser.com, and found this part that will do nicely instead. http://se.mouser.com/ProductDetail/NXP-Semiconductors/PSMN035-150P127/?qs=sGAEpiMZZMvKM5ialpXrmoKPBF94BAPgYour schematic is not quite correct. Make sure to connect up like I have shown - 20V is the top of LEDs in series, finish with the resister going to the Drain pin of the MOSFET, with the Source pin to ground. With this MOSFET you are opening & closing the circuit on the Ground side, and not on the high voltage side. Connect the Arduino pin to the gate thru a 1K resistor, with a 10K to ground. Mouser also has 7406's in stock http://se.mouser.com/ProductDetail/Texas-Instruments/SN7406N/?qs=sGAEpiMZZMtYFXwiBRPs0wQlaYsWIJgxYour resister choices look okay.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #9 on: December 24, 2010, 02:52:21 pm » |
Hi CrossRoads, sorry to bother again but i am stomped. I have received all the parts and i am lost as to how to properly connect everything. I ordered 2 mosfets transistors, 3 7406s and not sure which is better to use and finally got the voltage booster. Please help me with a sketch. I dont understand how do i connect the second part of leds (blue ones, according to the sketch) if it only has 3 pins. Please help i would love to finish this by the end of the week if possible. any suggestions are appreciated Thanks a bunch Roman Here is the current one i just cant understand how to finish it. 
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16439
Available for Design & Build services
|
 |
« Reply #10 on: December 24, 2010, 05:17:13 pm » |
You are oh so close! Just needed to show the 2nd driver:  sketch would be simple - I didn't compile this, just writing from scratch, should be pretty close // define pins used byte red = 11; byte blue = 12; byte on_off_pin = 10; byte button_state = 1;
void setup(){ // define how the pins are used pinMode (red, OUTPUT); pinMode (blue, OUTPUT); pinMode (on_off_pin, INPUT); digitalWrite (red, LOW); digitalWrite (blue, LOW); digitalWrite (on_off, HIGH); // turns on internal pullup resister } void loop() button_state = digitalRead (on_off_pin); if (button_state == 1){ //button normally open, 1 - lights are off) // do nothing } if (button_state == 0){ // button is closed, input is low digitalWrite (red, HIGH); // turn on red lights delay (500); // on for 1/2 second digitalWrite (red, LOW); // red lights off delay (100); // gives a chance adjust?
digitalWrite (blue, HIGH); // turn on lblue lights delay (500); // on for 1/2 second digitalWrite (blue, LOW); // blue lights off delay (100); // gives a chance adjust? } // end of read button state } // end of void loop
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #11 on: December 25, 2010, 06:27:29 pm » |
CrossRoads thank you so much sir.
Ive made a video to show u where im stuck. Iv been trying to modify this all day long and still cant figure out what is the deal.
[media]http://www.youtube.com/watch?v=zfyCKMEP7A0[/media]
It seems like led are lit not whether arduino tells them to, but rather the power suply of the battery.
Any ideas?
Thanks so much
Roman
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16439
Available for Design & Build services
|
 |
« Reply #12 on: December 26, 2010, 12:13:35 am » |
Sorry Roman, was out of the house tonight. What Mosfet do you have? PSMN035? Middle pin is the drain where the resistors meet up. The riight hand pin is the Source, which goes to 9V-/ground. Sounds like you have them swapped. You are running the sketch I drafted? If so pin 10 is an input with an internal pullup resistor. You can fake it being a switch by connecting/disconnecting to ground. Disconnected, it is 'open' and the LEDs shouldbe off. Connected to ground, it is 'closed' and the LEDs should blink on & off.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #13 on: December 29, 2010, 10:13:43 am » |
CrossRoads, Thank you so much sir. I finally figured it out and able to do it thanks to you. Exactly how i wanted it. Thank you 10000 times.  THANK YOU  Roman
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16439
Available for Design & Build services
|
 |
« Reply #14 on: December 29, 2010, 11:10:04 am » |
You are welcome Roman. So what did you end up with? Please share so we can all learn from what you did.
Robert
|
|
|
|
|
Logged
|
|
|
|
|
|