HID Bike Light My bike mods and accessories blog

Ever since I had a bike, I wanted it to have a headlight. I wanted something that is bright and lasts long enough for a few trips around town. I have a few HID bulbs and ballasts from past HID drop in retrofits so I had an idea. This is what I came up with.

Some specifications:

The housing originally uses an H3 type halogen lamp and my spare bulb is a 9006/HB4 type. After a bit of metal bashing and elbow grease,
I was able to fit it into the assembly with the right bulb position for focus.

Burn time is a total of 2.5 Hours from full to totally flat.

Above is the DIY battery charger (black thing with lights) which is a CC/CV automatic version with built in Balancer. (all discrete and analog. No microprocessors of any kind) Takes about 6-8 Hours to charge.

My old but faithful bike. I think this is already about 10 years old.

Here's the entire abomination attached to the bike with reusable zip ties (I don't usually use that much zip ties...)

Beam Photos. The spill light just at the front wheel isn't actually that bad. It's just a camera artifact:

In an empty soccer field at night...

On a street...

My view when riding...

So far, I've done several trips around town and in all cases, this light catches everyone's attention.

Next in line: A six LED 555 Timer based brake/Tail light for added safety.

06 Feb 2011:

I hated the bluish light of the blue tinted glass cover. Remember that this is a cheapskate project so buying another housing is not an option. (besides, I couldn't find another one with the right size and shape)

Here the housing is on my makeshift turntable with a hot air tool on the side to soften the adhesive:

It actually didn't work. A knife inserted between the glass and reflector and slowly prying it open did the trick but left the glass edge full of small cracks. The reflector didn't have any damage. I won't be using the glass anymore so it's not a problem.

I made a ring of acrylic by heating and bending an acrylic strip around to form the ring. Using a cutting disk held on a drill press, I was able to trim the acrylic ring so the ends are flat and true:

Gluing a flat piece on the front, a little work with the band saw and belt sander then sealing with silicone to the reflector and the new cover is done!

Here are the results of the new cover:

Before / After:

Before / After:

Before / After:

Before / After:

I'm not sure if it is obvious in the pictures, but in actual use, I like the brighter, pure white output. I used the same settings on my phone cam (night mode).

I actually had issues with the acrylic lens softening due to heat but nothing major. It softens only when the bike is standing still for more than 10 minutes. When running, there is no problem.

02 Nov 2013:

A couple years later, I'm still using the same bulb/ballast but the Li-Ion battery is already crap. I'm now using a 15Ah 14.6V LifePO4 battery pack that I made with a lot more capacity. With just one 35W HID, battery life is about 5Hrs continuous burn. I could even run dual HIDs if I wanted since I don't ride that long anyways. There's already more than enough energy storage! Here are some pics of the setup.

The bike with headlight on:

LED tail/brake light using 12x 5mm LEDs:

Power analyzer so I know how much battery life is left:

LiFePO4 battery pack, power analyzer and HID ballast on the frame:

LED tail light and microswitch underneath connected to the brake line:

23 May 2014:

My old bike is now showing its age, squeaking and stuff when running the trail. I decided to get a new one since it's pretty old anyways. Decided on a budget and bought a bike from a nearby store. Realized the stock parts probably won't last the way I use it, I decided to upgrade all important parts and blew way past my budget. Still better than having something fail in the middle of the trail anyways. I also added a proper switch for the HID lamp near the handgrips and also added a horn and horn button for those pesky cars that swerve into me when I pass on the right lane. Pics of the install to follow when I get to it.

The new bike:

25 May 2014:

Here are a few more pictures of the new bike with the old setup reinstalled with the slightly neater wiring.

35W HID on handlebar, ballast and battery pack mounted on the frame:

Headlight mount:

Tail/brake light assembly:

horn mounted on front fork:

Tail/brake light:

Horn button and headlight switch:

Front disc brake:

Rear disc brake (with brake light microswitch):

12.6V 15Ah LiFePO4 battery pack:

Ready to ride:

15 Jun 2014:

I got tired of having to undo/tighten hose clamps everytime I have to remove or attach the battery pack to charge. I was thinking of ways to make it easier to mount and almost settled on using bolts and simply using a screwdriver/wrench to undo. But I didn't want to settle for that, I wanted a quick release type mechanism. While thinking, I looked at the wheels and then it hit me.

Old method of attachment:

A quick trip to the bike store and bought a pair of quick release skewers:

Removed the old shaft, used long screws and cut off the heads to make an allthread shaft:

Bracket bolted to frame (via existing holes for water bottle):

Nut side:

Quick release lever on other side:

19 Jun 2014:

I wanted to move the headlight to the center of the handlebar to make it more balanced. I also wanted to get rid of the zipties holding the ballast to the frame to make it neater looking so I fabricated a bracket that bolts to the unused screw holes for the bottle holder. I then changed the tail/brake light by getting a cheap red blinker from a dollar store and tearing it apart just using the case. Take a look at the pics for the upgrades.

Stainless steel plate headlight mounting bracket. Light but sturdy:

It's now in the middle of the handlebar:

Mounting bracket for the ballast. You can see an aluminum bar running along the top of the bottom frame tube:

I also added slots for aesthetic reasons and it also allowed me to tie things to it if needed:

Other end of the aluminum bar wedged in the frame to keep it in place:

New tail light assembly from dollar store blinker:

Used protoboard and mounted 24 0603 SMD red LEDs to it and another series resistor (not seen) to dim it in tail light mode.
Resistor is bypassed with a microswitch to brighten up when braking:

Here it is lit up in tail light mode:

A reason I wanted to upgrade it is for viewing angle reasons.
The 5mm LEDs in the old tail light is highly directional. SMD LEDs and the fresnel cover allows a wide viewing angle:

23 Jun 2014:

I finally made a smaller battery pack for short trips or trips that start out during the day and then had to go home after dark. Or I could use it as a dual battery setup and use the smaller one as emergency power if the larger one runs out on long trips.

Four Boston Power Swing 5300 cells:

Wired all in series and added a balance plug:

Shrink wrapped and there you have the complete pack.
Charge indicator shows all cells flat since I've just run them dry to see how long it'll last:

Test setup - battery strapped to the bike frame:

I can do a dual battery setup with enough juice for more than 5 hours total runtime:

09 Jul 2014:

I couldn't see the gear positions when I'm riding at night so I needed an illuminated gear indicator. A couple SMD leds, some thin wires and some superglue later, this is what I got.

Connected an SMD LED to the end of some stripped ribbon cable and superglued inside the shifter case:

This is how it lights up now:

And tested in total darkness:

06 Aug 2014:

I was able to aqcuire another set of Boston power cells and made another 4S battery pack. Now I have two for a total runtime of 2.5hours with a 2.2lbs battery pack for short trips. The previous LiFePO4 battery pack weighs in at 6lbs and lasts over 4.5hrs continuous runtime which I will still use for long trips.

The two battery packs put inside a project box:

And now mounted to the frame with Y cable to parallel the two packs together including the balance plug:

With the 4S pack, I get about 16.8V when fully charged. The HID ballast doesn't seem to mind the higher voltage but the horn is noticeably louder and the tail light gets a little warmer in use.

30 Jan 2015:

Just wanted to share a pic my cousin took of me riding in the woods.

03 Jun 2015:

The battery gauge I was using is only stuck to the side of the battery pack as seen above. My feet gets caught up to it so I needed a better way of reading remaining capacity.

I bought a few of these LCD type battery readouts to try out and they can be programmed for a 4S Li-ION battery pack.

It looked that there is barely enough space on the top so I cut a slot on the top part of the case and wedged it in.

It was a tight fit!

Glued a connector on the bottom to connect the balance cables. This serves three purposes. 1: To keep the wires in place during riding, 2: Wire the two packs in parallel (including the internal taps of the cells) and 3: A convenient place to tap a supply line for the battery gauge.

This is how it is plugged in during use.

Battery is full.

Installed in the bike. The frame does obstruct the view but moving my head to the side a bit and it is still visible.

07 Jun 2015:

My bro bought a new bike so I took his old bike and used the parts to upgrade mine. Basically, the only things left from my original bike was the frame and pedals. I also took the opportunity to neaten up the wiring and make it nicer.

Guts of a giveaway pen with built in light,laser and UV led. I used this for the control switching as it already contains a 3 mode switch and a momentary switch. Perfect for lights and the horn.

Wrapped the above PCB in shrinkwrap and used a 4 core USB cable to connect to the main box.
Left button operates the horn.
Right button turns the tail light on, another press turns the headlight on and another press turns everything off.

Ballast and control box wedged underneath.
The control box holds a 5V regulator (to power the PCB) some transistor switches (to interface the control PCB) three 10A relays and some misc noise filtering components.

Horn bracket. The V cut acts as a wedge so that the split grips the inside of the front fork tube when the long screw is tightened.

The original design mounts the horn up front but upon testing it in the trails, one jump and the fork hit the horn bracket so I had to move it.

Some cutting and drilling and the horn is now tucked underneath the frame.

Horn viewed from the other side.

Tail/Brake light is rewired with 3 core cable. This allowed a neater wiring to the power source.

Since my new brakes are hydraulic, I no longer had access to the moving parts in the caliper to actuate the switch.
This required some clever thinking to attach a micro switch (from a broken mouse) on the brake lever in the handle bar.

Bike as a whole (without the battery pack). The next pictures are just to show the other parts of the bike that I had upgraded.

New handlebar

sealed bearing headset

Front fork

Front forks are air suspension.

Front hub

Alivio crank

Lightweight wheelset, hydraulic brakes

Loaded rear hub

Aluminum alloy pulleys with sealed bearings

11 Jun 2015:

Some trail riding and the horn mount is giving me issues. It hits the frame and feels flimsy. I also found out that the horn I used has a figure-eight dispersion pattern where the lobes are at the front and back of the disc. By facing it down, I basically had full output coming back at me so it hurts my ears everytime I had to use it. I really had to make a front facing mount for it.

Some parts of the hardware. PCB standoffs drilled on the side and the stainless strips are from wiper blades bent to run around the headset bearing. The polycarbonate pieces are not shown.

The bottom part holds the horn. The allthread seen here holds it to the top piece so that it doesn't slip/tilt downward during rough riding and bouncing in the trail.

The top part is similar to the bottom piece minus the hole for the horn bolt and is 1/4 inch narrower.

The horn mount complete.

I would like to try LEDs this time but the mounting method would not hold on my heavy trail riding. I tested one on my uncle's bike and it is pretty bright. Four should be insane! I might give it another try once I figure out a good way of rigidly mounting them to the frame.

12 Jun 2015:

I did some more mods. I changed the switches and mounted the COB PCB into the relay box and changed to a different type of tact switch.

I have not shown what was in the black box so here it is. It is just a bunch of relays, a 5V regulator and some transistors.

Here is the COB PCB which contains the control flip flop that is used to select modes.

The new buttons. The large tact switch controls the horn. The smaller tact switch on the right controls the lights.

Here it is installed. I have just done some trail riding and the mod works and feels much better than the crappy tact switches on the PCB.

27 Jun 2015:

Time for an upgrade. The HID light is nice but the ballast and reflector is kind of cumbersome. I decided to try LEDs.

I was planning on using four but it was becoming unwieldy so I decided on three as a compromise.

The bracket is made from polycarbonate and aluminum.

The polycarbonate bracket mounts to the handlebar and is a convenient place to mount the aluminum bar.

The LED bars are then mounted to this thick aluminum strip which is 9 inches long, 0.5 inches wide and about 0.125 inches thick.

Here is a closeup of the handlebar clamp.

Now I have an option for low beam and high beam.

In low beam, the middle one lights up and is pointed low to the ground.

For high beam, all LED bars are lit with the outer two pointed almost horizontally.

Testing in the backyard. This is the control image.

With the low beam on.

High beam on.

Took a trip around the village and found this short trail. Again, control image.

Low beam.

High beam.

Overall, swapping the HID + ballast to LEDs saved me about 200-300g. Now, since it consumes less power, I could remove one battery pack from the case and save another 500g. With all three LED bars lit, power consumption is about 25W total so that would mean 3.5 hours runtime with just one pack or 7 hours with the twin packs! I also only use one LED bar on roads so runtine would extend even more!

05 Jul 2015:

I went with my brother doing a 48km trip around a local mountain.

There are three tropical storms headed our way so it was raining heavily at times when we did the ride. Needless to say, the electronic switching gear got some water in it and the horn sounded off by itself so I was not able to use any of the electrical stuff during the ride.

I had to take the control box and the brake/tail light off and resealed them with hotmelt glue. The Deans connectors on the battery packs got a bit of corrosion due to rain and flood water so they also got the hotmelt glue treatment on the exposed conductors. Otherwise, the other stuff are fine. The LED bars are already waterproof so they did not have trouble.

Here is me fitting the resealed electronics back to the bike.

25 Oct 2015:

I had a bunch of Samsung 18650s from old laptops which were still good. Having the Boston Power cells were fine but having two Deans connectors, two balance plugs and Y adapters were kinda messy so I decided to repack the battery box.

The cells were linked together by copper tape for the parallel links and used copper braid for the pack series links.

The whole pack is a 4S4P config for a total of 16- 18650 cells.

Output connectors are now a pair of banana jacks for a removable cable.

Initial balancing of the pack. Testing shows decent performance.

Not as good as the Boston Power cells but still decent.

26 Feb 2017:

I changed the low beam LED to a different kind of LED bar for farther spot throw

I also needed a bike stand for when I don't have any place to lean it on. So I decided to make one.

I started with a T6 plate and cut it to the shape I need.

Shape almost complete. Just need to resize two holes, and sand the sharp edges.

Bent to shape as needed and bolted on the legs.

Legs are from 0.5inch angle aluminum 18 inches long.

Ends are cut to a point.

The bike rests on the stand via the pedal.

The notch is there to keep it in place.

Here it is as a whole.

I could put it on the rear carrier if I have to.

07 Mar 2017:

Time to update the control unit.

This is a Atmega328 breakout board I had a bunch made for little projects like this. It is programmed via ISP.

A second board is put on top which will contain interface and powersupply circuitry.

A 78L05 regulator supplies power for the micro, six TPCP8103H mosfets (4.8A) for the lights and power switching and some 0603 LEDs sprinkled for diagnostics. The green 3mm LEDs are for the battery gauge.

Not much on the bottom side, just a few 0603 resistors.

The inside of the old control unit. It is a mishmash of parts to make a pen button switch work on 17 volts and drive high current loads.

With all the old parts removed, ready to put in the new stuff.

This is the new circuitry. I still used the same buttons but modifying its functions is a lot easier.

So far, the 328 controls high and low beams, (headlight on off via long press, beam hi lo on short press) tail lamp blinks when headlamp is on, lights steady when braking. It also has a 4 LED battery indicator which also auto detects if I'm using a 3S or 4S pack. and disables high beam when battery drops low and also disables the low beam when it gets extremely low. tail lamp blinker still operates for safety. It also has a timer that shuts everything off including the micro and horn button so there is zero power consumtion on standby. Pulling the brake lever wakes it up.

I also added push to connect terminal blocks for the output and button connections so that it will be easier to service.

After installation, I realized I had to make a few last minute tweaks. The brake light runs 100% duty for 5 seconds and then PWM-ed to 75% duty after that to prevent overheating of the LEDs if the brake is held on (when waiting at stops) as they are quite overdriven on 16.8V.

Using my DIY pogo pin ISP connector, I'm using an UNO as a programmer.

indicators light up. I was testing with an almost empty 3S pack so there is only one LED left.

It works.

Animated GIF of the battery gauge.

I pulled the brake lever to wake it up, displays the battery level, no brake or headlight command detected so it went to sleep again.

I also bought a cheap $10 bike pump since I did not have any.

It fits behind the battery pack nicely.

I wanted a brighter high beam but could not find a suitable LED lamp.

Then my grandpa crashed his scooter and broke his LED lamp so I used what's left of it to make one.

Chopped the aluminum housing to fit the new TIR reflectors I plan to use.

The LED lamp uses two Cree XM-Ls as its light source.

I chopped two of these LED lamps to make the new reflector along with a piece of acrylic to hold them.

Put it all together and mounted it to the bike.

It makes a really nice flat and wide beam, perfect for lighting up the trails.

I was tinkering with the code and burning the bootloader to set the fuse bits. Ended up bricking the micro. Tried everything and after researching, I may have set the fuse to run external oscillator while the circuit is running internal clock. Used my signal generator to provide a clock to XTAL1 pin and tried a few times until I lucked out and worked!

Tested it in the trails. This is the control image.

Low beam on. This is the mini LED bar with yellow tint. I have tried running it without the tint but I hated the bluish white light.

It is perfect for road use, The bright hotspot in the middle lights up the road directly in front while the flood spill is plenty for the foreground and for other vehicles to see me.

High beam. It is very wide and flat so most of the light goes to the front and sides. It lights up the trail nicely, it does look more bluish than in real life which is a nice pure white.

I changed the code to run only the duals on high beam here when before, it was running both at high and the mini on low.

05 Jul 2017:

Bought a new set of lights intended for motorcycles.

There are two versions, one uses a smooth reflector, the other a cylindrical lens.

Here is the one that uses the lens, used as the low beam.

Wiring is hidden by techflex braided loom.

Retrofitted to the existing bracket.

Control image in the side of the house.

Low beam

High beam

Biked around to find a dark street.

Low beam

High beam

Page updated and copyright R.Quan © 6 Feb 2011.