Ford Escape Automobiles Forum banner

Microcontroller controlled lighting system.

6933 Views 24 Replies 7 Participants Last post by  Crimson13
My newest project: Arduino controlled led system.

I'm cross posting this on a few sites so please let me know if something doesn't make sense.

Arduino is an open-source electronics prototyping platform, designed to make the process of using electronics in multidisciplinary projects more accessible. The hardware consists of a simple open hardware design for the Arduino board with an Atmel AVR processor and on-board I/O support. The software consists of a standard programming language and the boot loader that runs on the board.

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

Light zone map. Zone 24 would be the cargo area.


Possible RGB Leds to use. Each led has a chip which makes each led individually addressable with only using 2 pins from the arduino for the whole strand.
http://www.adafruit.com/index.php?main_page=product_info&cPath=37&products_id=307

I was going to use a playstation controller joystick for navigation of the menu, but I recently saw that someone has figured out a library for a wii nun-chuck so I can use the joystick, button, and accelerometers with only 2 pins and power.

My whole deal with the number of pins I use is because the Arduino only has so many output pins and the less I use for somethings means the more zones I can have without getting into shift registers, which is a bit over my head atm.
See less See more
1 - 20 of 25 Posts
Those LED lights are pretty neat! I take it you would control them through SPI? It seems like you could use one for each zone (the description also says that you can cut them to, for example, make two 10-LED zones), with a mux like this one to direct the SPI clock to the LED chain for the zone you want to control.

Another possibility would be to use shift registers off of the SPI bus to drive LEDs. However, the shift registers I've seen are either on or off, meaning that you wouldn't be able to adjust the color of the LEDs hanging off it.
I actually wouldn't need to use a spi I can just use the arduino. And as far as cutting the led strand, I would only lengthen the wire between them because I can control each led on the strand individually and wouldn't need to use any more pins on a second strand.

Shift registers are an option for the exterior lights since they won't be RGB, but I'll see how many zones I want to have. With cutting down on the pins I would use for the joystick and those RGB leds I can have 7 zones, the lcd, the nunchuck, and the rgb strand on my arduino uno before I need to use a shift register. And since the indavidual zones are only the exterior, I think that's plenty for what I wand to do right now. I might add a shift register if I want to add an arrow stick in the rear window at some point but that's down the road.
I can't wait to see how this works out for you. I'm vary fascinated with the arduino. Great platform for RGB projects. Post pics and vids along the way!
Yeah the arduino is great. It was my Christmas present to myself, so I haven't had it for real long. I knew it did led things really well but I'm learning that it can do SO much more. So once I get this project done I'll make a permanent pcb for it and get a new chip for the arduino (which is only $5) and start a new project. I really want to try my hand at a cnc mill or a 3d printer/plastic extruder.

I've got most of the individual parts working but my biggest hurdle to overcome at the moment is the menu that I want to navigate on the lcd but someone on the Arduino forums pointed me to a menu library that I'm going to look at.

Tomorrow I'll take some pictures of the arduino so people can see what that looks like. And I'll try to get a graphic schematic done soon too.
3
So here's a picture of the Arduino hooked up to the lcd. The blue part is the arduino it self and the white thing the lcd is on is called a solder-less breadboard which is used to prototype electrical circuits before having to make a custom pcb.



And some info on breadboards for those of you who don't know.



See less See more
So I got my package-o-goodies!

I got 6 mosfet transistors, 1 arduino screwshield, 1 wiichuck adapter, and a few other things.

When I tried to test the mosfets I was having some issues. They would only have the leds stay on and not switch off and on like they should.

So with some help I figured out the problem with the mosfets. Well the problem was more of how I was testing them. The gate of the mosfet needs to be able to "drain" the charge that's on that pin so it can go "low" and then when you send a signal (5v) to it, it goes "high". So to fix this I put ground on the gate and the leds turned off, and as soon as I hit it with 5v they turned on. So I'll have to add a 10k pull down resistor on the gate to gnd.

So my next step is to get the nunchuck working and then try to battle this menus system.
Progress on the CARduino!

I have finally got the nunchuck working. It took a lot of help from a friend that's knowledgeable in C and bits and pieces of code from about 3 different examples of how to use the nunchuck with an arduino. But we got it to work. So now the arduino returns the position of the joystick and the status of the two buttons on the nunchuck.

Next step is to convert this sketch into a library so I can include it in the menu system code and use the values of the joystick and buttons to navigate the menu.
Sounds like it's coming along nicely. Can't wait to see it completed!
Thanks, I should get a chance to work on the menu system this week. Once that's done and I test the system with some single leds I'll order my strobe heads and maybe the rgb led strand.
Thanks for posting this. It got me thinking and inspired me to do some things. I cant wait to see your outcome and I'll let everyone know what going on with mine once I get the peices I need.
Thanks, I'm learning as I go so its a bit slow-going. Most of my time is waiting for one of my friend's that's a coding wiz to have some time to help me.
Well this isn't dead yet!!

I put the "PRO" in procrastination, so sometimes progress takes time. And with most of the coding being done by a friend, I kinda let him work at his own pace.

But we've made progress: The LCD now reads the modes and zones with their current state. Navigation is done via nunchuck joysitck and state change (on/off) is done via the "C" button.

Next up is putting in the different patterns. Other than that the next big hurdle is going to be to get me to pull the trigger on some emergency vehicle grade led pods. After that will be some testing to see if I need to use heatsinks and/or a fan on the mosfets and working out some sort of case to mount everything into.

Another option that I may try to include is a traffic adviser or "arrow stick". That would have 6-8 pods that I could have light in sequence to the left or right to direct traffic. I think for that, I'll try to make the bar for that from scratch. Using some 3/4inch U-channel aluminum and "piranha" style leds. I might use a LPD6803 chip in each of the pods of the traffic advisor so I can string them together and just call what pod I want.

Other Escape related projects I'm working on include: installing a 800watt inverter, making/installing a hood hinge-mounted ham radio antenna, and making/installing a power distro block for all of my extras (radio, emergency lights, CB, siren, etc...)
See less See more
:thumb: Sweet! i wanna see this in Action soon. :D
There's not much to see at the moment.

But I guess I could make a short video that shows the setup and the mode/zone stats on the LCD.
Im just Double checking on if i see this correct. Your planning on Adding Lights to the inside of your Ride by Zoning them into different parts by using this Board to control them all correct?
Actually the plan is to do the exterior lights first. And then if I have enough pins left on he arduino, I'll add the RGB to the interior.

I do various things that allow me to use emergency lights on my car, so instead of just buying lights off the shelf I decided to make my own system.
Crimson13 said:
Actually the plan is to do the exterior lights first. And then if I have enough pins left on he arduino, I'll add the RGB to the interior.

I do various things that allow me to use emergency lights on my car, so instead of just buying lights off the shelf I decided to make my own system.
Sweet! :yahoo: :thumb: :D
Excellent! Regarding pulldown resistors, I would think that an Arduino digital output would drive a 2N7000 gate directly, assuming the digital output always outputs either+5V or 0V. If its 0V state is actually "disconnected" (not "connected to ground") then you need a pulldown as you say, but I'd make it 100k or even 1M ohms to save power. A 10k pulldown would be appropriate at the end of a cable that might pick up noise.

If I weren't so busy in my day job I could dive headlong into Arduino myself. Has anybody done an Arduino interface to OBD-II?
astro said:
Excellent! Regarding pulldown resistors, I would think that an Arduino digital output would drive a 2N7000 gate directly, assuming the digital output always outputs either+5V or 0V. If its 0V state is actually "disconnected" (not "connected to ground") then you need a pulldown as you say, but I'd make it 100k or even 1M ohms to save power. A 10k pulldown would be appropriate at the end of a cable that might pick up noise.

If I weren't so busy in my day job I could dive headlong into Arduino myself. Has anybody done an Arduino interface to OBD-II?
From what I quickly read, the 2N7000 can only do around 500mA current. So I'll stick with the ones I have, as they can handle more. The led pods I'm looking at shouldn't pull that much, but I'd rather over-build than under-build.

I may try a different resistor for the pulldown, but the 10k works, and I have a lot of those laying around for some reason.

A quick google search for arduino obd-ii, returns a lot of results. So I'm going to say, yes, someone has done it. And they probably have a nice tutorial on how they did it.
1 - 20 of 25 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top