Monday, September 4, 2017

In our modern world, high bright LEDs can be purchased cheaply to provide low current draw auxiliary lighting to any vehicle. Then it is only a simple matter of connecting the LED to 12VDC and head down the road enjoying your new found wattage. However, there is no fun in the easy way. Follow the instructions below to build your own custom high bright LED driver.
-----
OBJECTIVE: A high bright LED for installation on a Kawasaki KLR650 motorcycle with six programmable modes:

-----
To keep the project simple, an Ardunio Nano is used to control the Gate Voltage (Vgs) of a MOSFET. When Vgs is HIGH the MOSFET switches on and the high bright LED turns on. By using Pulse Width Modulation (PWM) on the Arduino the brightness of the high bright LED can be easily controlled.
-----
You will need the parts in the schematic. All are readily available from Amazon or a host of electronic parts distributors. Of course, the 12VDC power source is provided by the vehicle.

---
On the bench the rig will look and function something like this:

----
The schematic leaves out some details that could be helpful. To control the MODE selection and the STROBE effect we used a handlebar mounted switch. I also drilled a small hole to mount the STATUS LED into the handlebar switch. With coded flashes, the STATUS LED lets the rider know the current mode of the rig. Pressing the GREEN button selects the next mode. Move the turn signal switch to "R" to turn on the STROBE effect. The image below provides some real world connection details. If you get the same handlebar switch we recommend buzzing out the wires first to verify them because the unit came with no diagram and low cost manufactures often change these details.

----
After you use the Arduino IDE to download the source code provided below into your Ardunio Nano you will need to mount to high bright LED. We got a mounting bracket from eBay. In the end it came out pretty nice.

-----
Here is a video of the rig running through all the modes. The quick strobe at the beginning is a wake up self test. The high bright LED swamps out the camera light sensor and doesn't provide a good indication of the actual effect. One note: It turns out Apple has a patent on the Breathing LED pattern (well, for a sleep indicator anyway). Use the "breathing LED" portion of the code with caution or, I guess, risk a cease and desist order.

-----
Here is the Arduino source code for the rig. Good luck!
//------------------------------------------------------------------------
/*
KLR650 Aux LED Driver
July 2019
WhiskeyTangoHotel.Com
Ardunio Nano (should work with other Arduinos)

Program controls a IRF510 MOSFET to drive a High Bright LED Array
(I recommend a heat sink on the MOSFET, but it should be fine without it)
A button switch selects between modes
A switch sets the LED to fast strobe mode
*/

digitalWrite(Status_LED, 0); // 0 turns the LED OFF
digitalWrite(FET_Drive, 0);
delay(Flash_delay);
stobe_on_button (); // check to see if strobe button is still pressed HIGH
} // endif strobe_button HIGH
} // end of strobe_button function