LED "Neon" Glow Lights for Automotives

by sentryGun53 in Workshop > Cars

10449 Views, 41 Favorites, 0 Comments

LED "Neon" Glow Lights for Automotives

IMG_0627.JPG
IMG_0611.JPG
IMG_0594.JPG
IMG_0603.JPG
IMG_0596.JPG
Overview
This project simulates custom "neon" lighting for the bottom of your car. It will give a bright yet subtle glow, in any color you want - without the need for expensive installation or fragile glass tubes.

Why?
Does your car not look badass enough? Maybe you drive a Subaru, or a Toyota, or a Volvo (like me). You don't want to put a noisy muffler on it, or a spoiler - no, those are too try-hard, and way overdone. Nope, you want something subtle.

How?
We are going to add flexible RGB LED strips to the bottom of the car. This will let you make the car glow any color you want.

Cost?
About $120 total

Tools?
-Soldering iron and solder
-Drill
-Wire cutters and strippers
-Screwdrivers or wrenches as required (to route wires through the car).
-Electrical tape and zip ties
-Caulk (optional)

Parts

RunningLights_01.JPG
IMG_0601.JPG
RGB LED strips - $16 x 4 = $64
Each strip is 1 m long. Most cars are less than 2 meters from the back of the front tire to the front of the rear tire. These strips can be cut to size, and wired together (end to end). They are coated in rubber, and so they are quite waterproof and shatterproof. They also come with a strong adhesive backing, that holds surprisingly well over time. At 12V, the LED's are bright enough for the glow to be seen well at night, and even a little bit during the day. Since these strips are RGB, they contain sets of red, green, and blue LED's - by mixing these three colors at the right ratios, you can create any color of glow (more on that later).

Arduino - $30
This popular, flexible microcontroller will be used to interpret user inputs, and control the LED strips accordingly. There are a ton of different variations on the Arduino platform. The one I use is a bit of a home-brew solution - I actually re-purposed an old Sentry Controller for the task.

MOSFETs - $1 x 3 = $3
MOSFETs are transistors that can switch a high-current load (the LED strips) using a 5V signal (from the Arduino). If you want to know how they work, read up on the wikipedia article.

Voltage Regulator - $1
This will be used to step down the 12V from your car's electrical system to the 5V required by the Arduino.

Perfboard - $3
You can get this stuff at most hobbyist supply stores or online. We will use it to wire up the MOSFET part of the circuit.

Wire - approx 15 ft = $5
12 gauge should be fine - these LED strips can only take up to about 600 mA each. Get something waterproof and reliable, because it's likely going to be running on the bottom of your car - not a happy place for electrons.

Touch screen (Optional) - $10
I will show how to use a resistive touch screen (glass panel only, no display) to make a custom color selector. You may want to buy a breakout board for the connector - otherwise it's going to be a pain to solder (I found out the hard way).

Single RGB LED - $2
This will go in the control panel. It's useful when adjusting the color from inside the car, so you know what color the glow is. Because it's not very suave to open your car door and look down to check.

Button - $0.50
This will come into play later, to ease the process of adjusting the color with the touchscreen.

Install

IMG_0588.JPG
IMG_0589.JPG
IMG_0590.JPG
10261-03_i_ma.jpg
Placement
The LED strips are going to go under the sides of the car, along the "running boards". The idea is that you cannot see the strips themselves while standing near the car, but they cast a glow downwards onto the pavement below the car. The effect is a bright glow coming from under the car.

Length
Measure the distance you want the LED strips to go along. If this distance is more than a meter, you will need to splice two or more strips together. This is not difficult. All you need to do is match the ends of two strips, and solder matching colored wires together. Be sure to weather-seal the connection with electrical tape. If the strips are too long, you can cut off the excess. Cut at one of the areas marked for this purpose (see picture below).

Surface Preparation
Before sticking the strips on, you need to clean the surface they will be sticking to. Naturally, the bottom of a car is a pretty dirty place, and that adhesive backing will not stick well to dirt. So, use a rough sponge to wipe off all the dirt. If there is rust, use sandpaper or steel wool until you have a smooth, clean surface. This step is very important, as it will determine how long your setup will last.

Installation
The LED strips come with a strong adhesive backing. Peel it back a little at a time, starting at one end, and working your way to the other. Press the strip firmly to the car's frame, and hold each section in place for 10 seconds or so to ensure a good bond.

Wiring

IMG_0568.JPG
IMG_0553.JPG
RunningLights_01.JPG
Schematic.png
IMPORTANT!
Disconnect your car's positive (red) battery terminal before attempting to wire into it. This is not really for your safety (12V can't hurt you much). Rather, it is to eliminate the risk of frying your car's electrical system by accidentally brushing wires together that you shouldn't brush together. That being said, if you end up needing to have the car on for some steps (eg. probing for a +12V wire), then be very careful about what you touch together.

Wires to Strips
The most difficult part will be to run wires from the Arduino and MOSFET circuits to the LED strips themselves. I was able to drill a hole through a floor panel, and then run the wires under the carpet and rocker panel covers, into the dashboard area (see pictures). Remember to seal up any holes to the outside. Caulk will do.
The strips have 4 wires: Red, Green, Blue, and Black. Oddly, the black wire is the +12V source for the strips. The red, green, and blue wires are the negative leads for the RGB LED's on the strips. See the schematic diagram below for details.

Common Cathodes
An important aspect of the LED strips and the single RGB LED is that they both have a common cathode. This means that one of the wires is for the positive supply voltage, and the other three wires are the individual colors' negative connections. So, we control these by controlling how much electricity we "let out" from each of the negative leads. In the case of the single LED, we can do this directly from the Arduino, but for the LED strips, we will use 3 N-Channel MOSFET transistors to do the job.

Perfboard Circuit and Arduino
Check out the wiring schematic for exact details. I recommend you use the perfboard for the MOSFET and voltage regulator circuits. Leave long wires to the touch screen, button, and single LED, so that you can mount these on your dashboard.

Supply Wires
If you are going to mount the touchscreen, button, and single LED on your dashboard, you will need to find a wire that you can use to power the whole setup. If you can find a wiring diagram for your car (Haynes service manuals are a great source), then locate a usable wire that carries +12V. If not, you will need to poke around with a voltmeter until you find a suitable wire.
You want a wire that is on when the key is in the ON or ACCESSORY positions, but not when the key is out or in the START position. I spliced into the wire going into the back of the cigarette lighter. Of course, a much better solution would be to run your own circuit from the battery, with fuse and everything - but that's a whole different project altogether.
You also need a Ground (GND), or negative, wire. These are usually "grounded" to the frame of the car - the entire frame is a giant negative terminal.

Control Panel
Find a good spot for the touch panel, button, and single LED on the dashboard. Mount them, drilling holes to run wires behind them. Note: only one side of the touchscreen is touch sensitive. Don't put it on backwards; you will feel like an idiot (I did). Stow the Arduino and perfboard circuit somewhere behind the dashboard. 

Once you have wired everything up, solder all connections, and wrap them with electrical tape. We don't want to zap anything (your radio? GPS?)

Code

ColorSelector.bmp
Color Selector Chart
Before you can use the touchscreen, you need to put the color selector chart behind it. Get the image (below), scale it to the proper size (it should extend to all edges of the touch screen), and print it off. Glue or tape it behind the glass touch screen panel.

Arduino IDE
In order to load code to the Arduino, you will need to download the Arduino IDE. Instructions at the link

Here's the code (copy/paste into the Arduino IDE):

-----------(begin code)-----------

/* -------- LED Running Lights --------
=======================================
Bob Rudolph
sentryGun53@gmail.com
v02 12/29/11
*/

const float yMin = 170;
const float yMax = 870;
const float xMin = 68;
const float xMax = 920;


const int LEDr = 9;
const int LEDg = 10;
const int LEDb = 11;
const int STRIPr = 6;
const int STRIPg = 5;
const int STRIPb = 3;
const int bottom = 14;
const int top = 15;
const int left = 16;
const int right = 17;
const int button = 2;

int rValues[264];
int gValues[264];
int bValues[264];

int r = 0;
int g = 0;
int b = 0;
int x = 198;
int y = 30;


void setup() {
  Serial.begin(9600);
  int rVal = 255;
  int gVal = 255;
  int bVal = 25;
  for(int i = 0; i < 44; i++) {
    gVal = gVal - 5;
    rValues[i] = rVal;
    gValues[i] = gVal;
    bValues[i] = bVal;
  }
  rVal = 255;
  gVal = 25;
  bVal = 25;
  for(int i = 44; i < 88; i++) {
    bVal = bVal + 5;
    rValues[i] = rVal;
    gValues[i] = gVal;
    bValues[i] = bVal;
  } 
  rVal = 255;
  gVal = 25;
  bVal = 255;
  for(int i = 88; i < 132; i++) {
    rVal = rVal - 5;
    rValues[i] = rVal;
    gValues[i] = gVal;
    bValues[i] = bVal;
  } 
  rVal = 25;
  gVal = 25;
  bVal = 255;
  for(int i = 132; i < 176; i++) {
    gVal = gVal + 5;
    rValues[i] = rVal;
    gValues[i] = gVal;
    bValues[i] = bVal;
  } 
  rVal = 25;
  gVal = 255;
  bVal = 255;
  for(int i = 176; i < 220; i++) {
    bVal = bVal - 5;
    rValues[i] = rVal;
    gValues[i] = gVal;
    bValues[i] = bVal;
  } 
  rVal = 25;
  gVal = 255;
  bVal = 25;
  for(int i = 220; i < 264; i++) {
    rVal = rVal + 5;
    rValues[i] = rVal;
    gValues[i] = gVal;
    bValues[i] = bVal;
  }

  pinMode(LEDr, OUTPUT);
  pinMode(LEDg, OUTPUT);
  pinMode(LEDb, OUTPUT);
  pinMode(button, INPUT);
  digitalWrite(button, HIGH);

}

void loop() {

  if(digitalRead(button) == LOW) {

    // get x position
    pinMode(bottom, INPUT);
    pinMode(top, INPUT);
    pinMode(left, OUTPUT);
    pinMode(right, OUTPUT);
    digitalWrite(left, HIGH);
    digitalWrite(right, LOW);
    int x_unscaled = analogRead(bottom);
    x_unscaled = 1024 - x_unscaled;
    x = int(map(float(x_unscaled), xMin, xMax, 0, 264));
    if(x < 0) {
      x = 0;
    }
    if(x > 264) {
      x = 264;
    }

    // get y position
    pinMode(bottom, OUTPUT);
    pinMode(top, OUTPUT);
    pinMode(left, INPUT);
    pinMode(right, INPUT);
    digitalWrite(top, HIGH);
    digitalWrite(bottom, LOW);
    int y_unscaled = analogRead(left);
    y = int(map(float(y_unscaled), yMin, yMax, 0, 200));
    if(y < 0) {
      y = 0;
    }
    if(y > 200) {
      y = 200;
    }
    y = 200-y;

  }
  if(x < 100 && y < 60) {   // white
    r = 255;
    g = 255;
    b = 255;
  }
  else if(x >= 100 && y < 60) { // black
    r = 0;
    g = 0;
    b = 0;
  }
  else if(y >= 60) {  // multicolor
    r = int(map(float(rValues[x]), 25, 255, 0, 255));
    g = int(map(float(gValues[x]), 25, 255, 0, 255));
    b = int(map(float(bValues[x]), 25, 255, 0, 255));
  }

  analogWrite(LEDr, 255-r);
  analogWrite(LEDg, 255-g);
  analogWrite(LEDb, 255-b);
 
  analogWrite(STRIPr, r);
  analogWrite(STRIPg, g);
  analogWrite(STRIPb, b);
 

  Serial.print(x);
  Serial.print("   ");
  Serial.println(y);

}

-----------(end code)-----------


Load Code to Arduino

Press "Compile". Wait for the IDE to say "Done Compiling", then plug in your Arduino, select it in the Tools > Serial Port menu, and press "Upload". Wait for the IDE to say "Done Uploading". Then, you are done loading the code.

Code Function
To set a color, press that color on the touchscreen and hold it down, then press the button. You can also hold the button, and move your finger to select a color. The color is set when you release the button.
The single LED gives you some feedback on what color you are selecting, so you don't have to look down at the ground to figure it out.

Legal Info

Check your state laws to see how your local regulations deal with aftermarket lighting. By following this tutorial, you assume all liability for your actions.

Common restrictions:
Must be shatterproof
Cannot be certain colors (no red, blue)
Must be amber or yellow
Must be located only on certain parts of the car (between back of front tire, and front of rear tire)
Must not be visible more than 75 feet away from the car
Can only be used in parking lots or on private property
Banned altogether