Go Down

Topic: Arduino controlled led system. (Read 5 times) previous topic - next topic

Crimson13

So, high everyone! I'm new here and to the whole world of arduino but I'm eager to learn!

So I'm here to get your opinions on my next project and hopefully get some questions answered.

My newest project: Arduino controlled led system.

What I am hoping to accomplish is a multi "zoned" led system for my car.
I participate in various things that allow me to use warning lights on my vehicle, some things are for a local government agency and some is for other things that involve police escorts.  Currently I have a cheap led flasher from China that I bought off of ebay before the foreign sellers started jacking their shipping charges.  The flasher came with 2 sets of lights with each set having 3 pods of 3 leds.  The flasher has 3 patterns, mode A is side 1 flashes 4x then side 2 flashes 4x, mode B is alternating flash (1,2,1,2,1,2,1,2,1,2,1,2?..), mode C is both sides at the same time.   These leds are amber and are mounted in the rear window.  Since getting the flasher I have added some white led strips in the grill and tied them into the wires for the other lights.
So I don't have many lights and would like to add more.  But real warning leds are expensive and I don't have a few hundred to drop into that. What I would like to do is have an arduino control all the leds around the car independently.  Attached is a map of the different "zones" that I would like to control.  The front and rear have two zones so the leds can have alternating flash patterns.  
There are a few goals I have for this project to be able to do.
1.      Individual zone control. (on, off, strobe, etc?)
2.      Preset patterns or modes. (zones 11+12 alternate, zones 21,22,23,24 on, etc?)
3.      Use a LCD display to scroll through the zones and modes.
Bonus Goals!!
4.      Use RGB leds and control each color channel in the zones.
5.      Have an additional zone for a traffic advisor (arrow stick).
So my first question is what arduino would I need to have this work?  The interior zones are just extra that I thought would be cool to have a glow from under the seats and dash.  So could I get by with an Uno or would I need a Mega?
I know others have driven high powered leds from an arduino before so that not a huge issue.


Thanks for your time!

Crimson13

Sorry for the double post, but I couldn't add the image in my first post :\



CrossRoads

Not sure what the numbers mean in your picture.
If you can get by with 17 outputs (assuming you leave Rx/Tx free to give the arduino commands) and you are powering all those things with 12v, then you can have any arduino, even the clones, control 1 MOSFET per I/O pin as the simplest solution to turn power on/off to each zone.
If that's not enough zones, then you can write to a shift register and have the shift register control the MOSFETs.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Crimson13

The numbers would be the area of each zone.  I numbered them in the 10's, 20's and 30's so I know what area of the car is that zone without having to think about how I numbered them. 10's would be exterior zones and 20's would be interior zones.  I added the 30's as a last minute thing, but I think I'll just add them to them to the 10's zones.

If my research is right, I would use 6 pins for the lcd, and 5 pins for the joystick I want to use.  So that would leave me with 6 pins.  But if I use a shift register I can have more?

I think I counted the joystick correctly but I'm not 100% sure.

LCD  http://www.makershed.com/ProductDetails.asp?ProductCode=MKAD15

Joystick


CrossRoads

Yep - simple way is define a shiftclock & dataout line for each zone, then shift out however many control bits you want per zone.

For example, here I shift out 16 bits (but are only using 9).
I used 74F374's because I had some and didn't have any shift registers on hand, and I needed something where I could monitor the code without having to watch it via the serial monitor.

If you want more than 3 zones, that can be accomplished as well. Write to one shift register, use the outputs to enable/select other shift registers that do the control you want.


Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Crimson13

Ok I think I get what you're saying. Well kinda at least, I'm still trying to wrap my head around all of this stuff.  I've been an amateur radio operator for the past 6 years so I'm not a stranger to electronics but this is my first time actually "making" something.

So at this point my biggest question is will an Uno work with the lcd, joystick, and lets say 5 zones?  Right now I'm just trying to figure out what Santa needs to get me for Christmas!  ;D

Thanks for answering all my questions so far!!

Grumpy_Mike

Quote
will an Uno work


By and large yes, but it depends on exactly what you want to do.

Crimson13

Well I've pretty much laid out what I want it to do in my previous posts.
Are there any questions you have about what I want it to do?

CrossRoads

#8
Dec 06, 2010, 01:37 am Last Edit: Dec 06, 2010, 01:38 am by CrossRoads Reason: 1
Ok,
Here's my idea for you.
I've created a generic 328-based arduino symbol with power inputs & serial lines on the left, and the balance of the I/O lines on the right. I started numbering the pins with D0 as pin 1 and working around the board. I left the FTDI type lines in there because they are there on Prominis, which  I use a lot.
I also created a symbol for a TI TPIC6B595 shift register.

This part is 2 stage - data is shifted in using SerIn and SerClk, then loaded in parallel to the output drivers with LoadClk.
Clear/ clears (sets to 0) the first stage registers when low.
OE/  lets the parallel stage drive the output drivers when low.
The output drivers are N-Type Mosfets.  They can switch up to 50V, so would be good in a car, and up to 150mA.
You would have them connect the 'bottom' of LEDs to ground as I have shown. (Boffin1 in South Africa introduced these to me).
You could also put a pullup resistor on them to force a high output when not driven.

Or you could use other shift registers and drive higher power capable Mosfets such as International Rectifier IRF3707Z.

I showed the Arduino as having the same serial data shifted into the first stage of every shift register. You would then use Load clock to load the one set of outputs you wanted to drive.

Alternately, you could use longer shift out sequences and let the data ripple thru all the chips, then just have 1 Loadclock to all the chips to change them all at the same time, leaving you 5 more pins to do other stuff with.
Depending on how you set up your software, one way or the other may have its advantages;
speed of writing to a specific part for example, maybe ease if wiring if the chips are to be spread out with the lights being driven.
Your LCD may require specific I/O pins to be used, I didn't see a datasheet.
I did this up kind of quick, I would normally make the lines straighter & stuff. But this will give you and idea on how to proceed.

Look for stuff like this vellemanusa.com,  ecs1/2, to build it up on.

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Crimson13

Wow!!  Thanks for all that great info!  Being so new to this kind of thing I think I'll stick with just using the arduino before I work in the shift registers.

You know the old saying: "Don't try to run before you can walk"? Well doing all of that is running a marathon before I can crawl!

But thank you again for all your help.  I'll be posting more once I get my stuff in and start working on things.

CrossRoads

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Crimson13

Me again!

Well I got my Uno and have been doing every tutorial I can find!

Since my last postings I've made a couple of changes.

First I'm not going to use the joystick I posted about earlier.  I've since found a library for a wii nun-chuck that only uses 2 pins for the joystick, button, and accelerometer.

And I've also found a strand of RGB leds that each led is individually addressable and only uses 2 pins. http://www.adafruit.com/index.php?main_page=product_info&cPath=37&products_id=322

I've got almost every individual part of the system working separately now I just need to combine it all.

My biggest hurdle is the menu format that I'll navigate on the lcd.  I've not found a great way to learn how to do that, so I'm on the hunt for that.

Another small step is finding a transistor that is high enough amperage for a car battery but works at low enough voltage.  I bought one at radioshack and it worked but I didn't pay attention to the amps on the package and my home-built bench power supply (old atx power supply) made the transistor release the magic smoke.

retrolefty

There is a menu library floating around that might help you put the structure you need to tie everything together: http://www.arduino.cc/playground/Code/Menu

Good luck with your project.

Lefty

Crimson13

That looks like that should help me a bunch! Thanks!

CrossRoads

Quote
Another small step is finding a transistor that is high enough amperage for a car battery but works at low enough voltage.  

Try a MOSFET like this:
http://www.hobbyengineering.com/specs/IR-irl520.pdf
Put 12V into LED Anode, to current limit Resistor, to MOSFET Drain. Source to ground. Arduino pin thru 100 ohm resistor to Gate, 1K resistor from gate to ground.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up