1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Arduino In vehicle mood lighting

Discussion in 'Project Logs' started by ste2425, Jun 13, 2013.

  1. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,393 (1.50/day)
    Thanks Received:
    370
    Location:
    Huddersfield, uk
    Since my University course has ended ive found my self with spare time :)

    So i decided to stay on the programming bandwagon and start an Arduino based project. Love these little boards the things you can do with them are fantastic and for the price you can pick them up for everyone should have one.

    Anyhoo the grand plan:

    To create a system that performs ambiance lighting within a vehicle that reacts to the way said vehicle is driven. Current plans are for it to fade from what ever colour is selected to red depending on how hard the driver accelerates and when the vehicle is about to red line it will flash red at you reminding you it doesn't like it. Then with the use of an accelerometer hard cornering will cause the outside side of the car to fade to red. The sharper the corner the more red. I believe it will have to take into consideration the vehicles speed as well as the reading from the accelerometer so that it doesn't give false readings. Then there will be the joy of pots holes, speed bumps that could cause the results to be unexpected but ill worry about that when the accelerometer arrives. :)

    Current progress so far is just bread boarded up. Because of the limited number of digital input and output pins ive employed the use of shift registers. As all im doing is basically routing a high or low signal to LED's there's no form of serial communication it'l be a good exercise to learn how to use shift registers. I could then expand that to hopefully run other devices such as TFT displays through a shift register as ive seen it done. Currently ive got one register in use and can control the PWM of each of the eight LED's connected to it individually.

    I have an array of predefined RGB values for various colours which the user can select between and the Arduino will fade each LED colour up or down to the new colour creating a nice transition between the two. The colour selected is then stored in the Arduino's EEProm so that colour is automatically selected when it next powers up.

    There's also a few functions which create some nice colour fades effects which the user can control the speed of the fades. Im thinking of implementing this to automatically be used when driving on motorways.

    Currently the LED's draw power directly from the shift register so they are quite dim. Im awaiting some more registers to control more LED's and also some transistors. The plan it the sift register will control the transistor which will act like a switch between the LED's and the Arduino's power source giving me the LED's at full power.

    Im really excited about this and even thought of what i could do next, creating a dock for my iPhone to interface with the stereo and give me steering wheel controls for it. Even better if i do get a TFT display working with shift registers to create a keypad entry entry system where the user has to enter a code before the vehicles ignition system is given power :) That could then be expanded even further with the use of a OBD-II shield to give each driver of the vehicle their own code. You could then log how well each driver is driving it, how sharp they corner, hard they accelerate and their MPG per trip. Great fun :)

    [​IMG]

    I know how much you all like photo's with your logs but sadly thats it for now. When my new toys arrive ill get more and post a video of its functionality at the moment :)
    mlee49, Sasqui and micropage7 say thanks.
  2. micropage7

    micropage7

    Joined:
    Mar 26, 2010
    Messages:
    5,610 (3.53/day)
    Thanks Received:
    1,286
    Location:
    Jakarta, Indonesia
    interesting project
    waiting the update :toast:
  3. Sasqui

    Sasqui

    Joined:
    Dec 6, 2005
    Messages:
    7,501 (2.37/day)
    Thanks Received:
    1,313
    Location:
    Manchester, NH
    Me too... subscribed
  4. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,393 (1.50/day)
    Thanks Received:
    370
    Location:
    Huddersfield, uk
    Thank you very much :)

    [​IMG]

    Not much of an update but new toy's arrived whilst i was at a job interview. Just waiting on the transistors and pcb boards before i can move onto the next step :)
  5. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,393 (1.50/day)
    Thanks Received:
    370
    Location:
    Huddersfield, uk
    Sadly no more updates just yet but how many cores does an Ethernet cable have and running 5v down them won't be an issue right?
  6. t_ski

    t_ski Former Staff

    Joined:
    Apr 11, 2006
    Messages:
    10,749 (3.54/day)
    Thanks Received:
    4,194
    Cores? You mean wires? There are four pairs of twisted cable, and depending on what kind of CAT you're using, there may be a shield in it as well. 5V probably won't be too bad on it, depending on what amps you're trying to draw through it.
    Crunching for Team TPU
  7. Sasqui

    Sasqui

    Joined:
    Dec 6, 2005
    Messages:
    7,501 (2.37/day)
    Thanks Received:
    1,313
    Location:
    Manchester, NH
    Exactly...

    Look here: http://www.powerstream.com/Wire_Size.htm

    3.5 A for "Chassis wiring"
    0.577 A for "power transmision"

  8. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,393 (1.50/day)
    Thanks Received:
    370
    Location:
    Huddersfield, uk
    Well finished moving house, job interviews are over, i got the job by the way :) working for a company called Cascade creating payroll and HR software :) so i can continue with this little project :)

    Well so far im about halfway through soldering various things onto PCB so i can make more room on my breadboard and work on other things.

    [​IMG]

    Not much interesting really just using transistors to act as a switch so the LED's are not drawing power directly from the shift registers. Plus soldering them onto boards this size means bits can be upgraded and expanded easily rather then having to take apart one large PCB
  9. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,393 (1.50/day)
    Thanks Received:
    370
    Location:
    Huddersfield, uk
    Right so I spent all yesterday messing around soldering my shift registers onto the PCB's and these transistor boards so my LED's arn't drawing power straight from the registers only to realise ive made a very stupid mistake.

    First ill show pictures.

    [​IMG]
    Here's my shift register board, ignore the sellotape im waiting for my shrink wrap to arrive. Three registers with eight outputs each controllable independently.
    The board to the left is the transistor board, where ive made a big mistake :(

    [​IMG]
    My soldering. Not the best in the world ill admit but ive never soldered onto a PCB before and the tip on my soldering iron is the size of a small moon. There's no shorts however and everything is secure so it does the job.

    [​IMG]
    And a quick test and it all work fantastic :)

    Now the problem.

    When i decided to use the transistors to seperate the power draw from the shift registers i didn't have my RGB led's so i set it up on the breadboard and tested on my single LED's at it all worked. I took photo's for reference and moved on to the next task. I since bought my RGB LED's then decided to solder up three of the above transistor boards, one for each colour. When to set them up and realised my mistake. The transistors work by switching the ground. My RGB LED's have a shared ground. :banghead:

    As i don't know much about how the transistors work i liked them to a relay you get in cars and thought well if it passes the ground why can't they pass the live. So wired it and as you can guess it didn't work and made my shift register very toasty. So now i either have to by separate red, green and blue LED's which will make installing them in the car harder or sack off the money and time spent on the transistor boards and try to find a new approach. Not happy
  10. Aquinus

    Aquinus Resident Wat-man

    Joined:
    Jan 28, 2012
    Messages:
    6,006 (6.56/day)
    Thanks Received:
    1,954
    Location:
    Concord, NH
    You shouldn't solder imho until you have the circuit completely figured out. You should get an extra large breadboard for prototyping. Just my 2Ā¢.
  11. AsRock

    AsRock TPU addict

    Joined:
    Jun 23, 2007
    Messages:
    10,761 (4.15/day)
    Thanks Received:
    1,643
    Location:
    US
    Not seen one of those boards since my training many many years ago. They look like they are made of plastic now ?.

    You can get a wider beam of leds if you flatten the head of them too so if it's close to some thing the the light is more wide spread.
  12. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,393 (1.50/day)
    Thanks Received:
    370
    Location:
    Huddersfield, uk
    Do you mean the breadboard? Yes its plastic what were they made of?

    And i know i probably should have developed everything before soldering but that's why its being developed modular.

    I think ive found a solution. My led's are common cathode if i get a set of common anode ill be able to feed them a single separate live then switch each ground with the transistors right?

    Everything else is working as it should, the board with the shift registers on works great with every pin being addressable and not interfering with each other. The transistor boards work great as well as long as their switching the ground. If the common anode LED's will work then that side of things is done. All the boards are soldered up. Now i can work on the input side of things with getting a reading on the cars rev's and look into using an accelerometer.
  13. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,393 (1.50/day)
    Thanks Received:
    370
    Location:
    Huddersfield, uk
    [​IMG]

    Well its all soldered up now, tested and working brilliantly when switching the ground. Need to wait on new RGB led's to get the actual effect.

    Ill hook it all back up and post some pics/vids of it all working as i took it all apart to stick to the cardboard.

    Soon ill have to think about some form of case :/
  14. mlee49

    mlee49

    Joined:
    Dec 27, 2007
    Messages:
    8,475 (3.52/day)
    Thanks Received:
    2,103
    Hi! Nice project :D

    Just curious though why you're using shift registers to power your LED's. I would suggest a very simple LED driver, heres a good start:

    http://people.eecs.ku.edu/~callen/501/Driving_your_LED.pdf

    I made the LED driver circuit my Senior Year:

    [​IMG]

    Note the LED is on the left, with the transistor(metal tin can looking thing) next to it.

    We used a Bias voltage of 10 volts though from a source, your Arduino only has a 5V supply at 1A(I think) so you're LED driving resistors will change significantly.

    Also, why are you using the Digital IO for the LEDs? I would think for the mood lighting effect you could use the Analog and just script some output voltage to drive your LED driver into different ranges(aka vary the brightness).
  15. ste2425

    ste2425

    Joined:
    May 27, 2008
    Messages:
    3,393 (1.50/day)
    Thanks Received:
    370
    Location:
    Huddersfield, uk
    Ha thanks :) Your boards look much neater than mine.

    Im using shift registers because i needed more outputs than the arduino has. From three digital outputs on the arduino i think i can link around 70 registers with eight outputs each (i intend to do more then the mood lighting).

    Also this is the first thing ive done with the arduino, besides knight rider lights. When i Googled how to get more outputs this was the first thing that looked like it would do the job, haven't seen anything about LED drivers until you mentioned it now actually :p

    Also im using a library called Shift PWM its quite compact and allows me to simulate using the PWM outputs on any output of the shift registers. Each output of each register can be addressed independently so i can do colour fades with my RGB LED's. Also i can make one LED dimer or brighter then the other, so they can be adjusted in-car in case one is more dazzling then the others.

    EDIT:

    Just had a look through that link and OHHHH MYYYY GOD my brain seriously hurts.

    Whilst browsing google to find a funny picture to try and show maths killing my brain i stumbled across this and it made me laugh.

    [​IMG]
    Last edited: Jul 11, 2013

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page