Building a better bike tail light

I’ve been wanting a better tail light for my bike for a long time, but I haven’t really liked what I see in stores. So, I decided to just build one. The idea is to put a small red light on my bike, aimed backward, with a high-visibility flasher mode. Probably lots of DC-Fix on the lens to make the beam spread as wide as possible. I think a 1x16340 host should provide enough battery life without being terribly large, and it’s a lot easier to build/mod one of those than a 1xAA light.

I’m waiting on parts right now, but here’s my design/spec so far. These are kind of just my notes, and probably are lacking some explanation…

  • Host: Ultrafire 602C host: $4.25 from FastTech
  • Emitter: Red XP-E2 on Noctigon: $6.50 from RMM
  • Battery: Efest 16340 V2 IMR 550mAh: $3.95 from RMM
  • Driver: Nanjg 3x7135 “AK-47A” driver: $3.00 from RMM
  • Bike attachment: cheapo lockblock clone from DX, $2ish, already have a few
  • Clip? (maybe): $1.96 from FastTech
  • DC-Fix: already have lots of it

Total: $19.70 to $21.66 (less than most of the non-Walmart tail lights I could buy locally, yet should be a better product)

I’ll have to write my own firmware for it, but that shouldn’t be too hard.

While deciding on an emitter and driver power level, I checked out the red XP-E and XP-E2. It looks like the XP-E2 gives a nice boost in overall output and efficiency, but it also costs twice as much.

Red XP-E2 output: testing a red XP-E, and comparing it to a red XR-C, 22/4/'14: XP-E2 results added in post #32 (and blue and green XP-E2, output tests )
Power/output levels, approximated from graphs:

  • 350mA: 56 lm, 2.05V, 78 lm/W (or 44 lm/W at 3.6V)
  • 700mA: 142 lm, 2.3V, 88 lm/W (or 56 lm/W at 3.6V)
  • 1050mA: 180 lm, 2.42V, 71 lm/W (or 47 lm/W at 3.6V)
  • 1400mA: 233 lm, 2.6V, 64 lm/W (or 46 lm/W at 3.6V)

Optimal: 142 lm at 700mA (most efficient power level in lm/W, and bright enough for my needs)

Modes: probably five: (2x7135, 700mA, 550mAh battery)

  • low 2%: 2.8 lm, 39 hours
  • med 20: 28 lm, 3.9 hours (or 15, 21 lm for 5.2 hours)
  • high 100%/700mA: 142 lm, 47 minutes
  • high-vis flasher 2%/20%: 2.8/28 lm, 20 hours

    (steady on at 2, flash three times at 20 once per second)

    (10ms med, 35ms low, 10ms med, 35ms low, 10ms med, 900ms low)
  • high-vis 2Hz beacon: 75 hours

    (flash at max for 5ms, wait 245ms, flash again, wait 745ms)

Mode memory: Yes. If the bike hits a bump and the battery contact is briefly lost, I want it to return to the same mode it was in as soon as power is restored.

I tried this general setup with my S10-Ti MELD, and it seems to work pretty well. But I don’t want to use such a nice shiny light on my bike, so I’m building a similar one (or three) with only the features I need for the road.

The biggest potential issue I can see is that the beam will only be about 170 degrees wide. Some tail lights are actually visible for about 270 degrees, but doing that would require a convex diffraction cap. However, this should still be okay since there would be only a narrow angle to the side where someone wouldn’t get direct light from either my head light or my tail light, and the head light is bright enough to make me visible regardless.

In any case, I’ll post more details after I have parts and can start putting them together.

(reserved for build details, link to firmware, etc)

Hi all, I live in France and new here !
I’m interested in this project since I’ve thought of a similar project for my MTB.
The 16340 form factor would be compact enough to fit under the seat, and standard sized driver and emitter are possible, so I chose the same host from FT.
I’m looking for a stock driver (Nanjg maybe ?) that could provide a good 2Hz flashing or fat beacon mode maybe ?
>10Hz strobe mode is really not usable on roads
Do you know any driver that I could order online to do this ?
Thanks !

Have you considered the eliptical TIR?

I have something similar to on my bike.

It’s bright and … everyone hates to ride a bike behind me. Really. It flashes badly into person behind.

So the moral is: don’t forget low flash light mode (or even modes) :slight_smile:

(different variations of 0.5W rear bike lights:

Subscribed. 8) We seriously lack of drivers that is suitable for cycling purpose.

These look great. Pulse style signal is cool too.

Subscribed, very interesting idea. I’m sure this is going to be a great light, and a great thread

If you want to make the project because it’s fun then good. But utility wise, hard to say no to the existing lights already made. Even the brightest lights popular with cyclists only produce 20-70 lumen max, they’re wateproof, run for hours, durable, and a refined product.

A 20 lumen red flasher in your face while you’re driving at night is really blinding as it is already. 140 would just knock someone’s contacts lens out. Remember the rear lights are to be seen not to see with so you don’t need to go too high in lumens.

This is one type of light where I’d say you’re best to get what’s already available if utility is strictly what you’re after.

Rear light with ambient light detection? Bright at day, dimmer at night. + additional modes

Most quality bike lights are expensive. This is BLF after all? :stuck_out_tongue: Magicshine has model with 85lm now. I believe the lumen numbers will not stop from here. I switch on my SK68 with red XP-E when I am on the road. Entire setup cost less than $5. If too bright, I pop in AA. For daytime ride, I can use 14500 for higher viz. The only cons is no control to flashing pattern. I replace all o-rings(<$0.5) to close up all the gaps.

Sk68 is compact and it is tuck under my seat. For leisure pavement/ park ride, I will use my 5x 5mm LEDs that has a super long runtime.

Welcome to BLF!

I’m not aware of any stock drivers which have good bike-friendly flasher modes. That doesn’t mean there aren’t any, but I’m not familiar with any. The closest I’ve seen is a “20-mode” 1xAA driver from DX, which has a 3Hz strobe in its third mode group. However, if I recall correctly, a 3Hz red strobe is the most likely to trigger epileptic seizures… so maybe not a great idea.

Yes, but it’s another extra part and I don’t think it would make the beam wide enough. It’s nice that the TIR would avoid light loss above and below, but I don’t think that will be a big issue. I’m also not sure how it’d fit into this host, since the host is narrower than a Convoy, and it would probably change the internal spacing and might require a longer battery or spring or something. I’ll probably just put DC-Fix on both sides of the lens for maximum spread.

Thanks. Even if I don’t use one of those, its specs provide a useful data point for me. I think it said 18 lumens, and I had been wondering what exact lumen levels would be too bright. So, I might adjust the output of mine down even farther.

I suspect that the one I have now is only a lumen or so. It claims to get 140 hours on 2xAA batteries. With some very rough calculations, I worked out a very rough guess of about a lumen in order to get that runtime on those batteries… but I haven’t, like, actually put it into my light box for testing. I should probably do that. :slight_smile:

In any case, if a lumen is about “normal” for a tail light, I might want to do the high-vis flash at something more like 1lm / 10lm instead of 2.8 / 28. But that should be a simple firmware change. If there’s enough room in the ROM, I could even have both — a dim one for biking and a bright one for signalling emergency assistance.

You guessed it — I do want to make this for my own entertainment. Otherwise, I’d spend that time researching something to buy.

I don’t really intend to use 140 lumens on the road. I find 140 lumens to be plenty for my front light, so it’d be way way too much for a rear light. I think the brightness conversion between “be seen” and “see with” is a factor of something like a hundred, or maybe even two hundred.

I chose the 140 lumen max because the measurements I found showed it to be the most efficient level for this emitter. I can turn down the brightness in firmware but, since it’s using PWM, all the runtimes will be based on its performance at maximum. Plus, when I take it off the bike it might be nice to have a bright red light.

Sorry, I’m not planning to give it ambient light detection. If I need multiple brightnesses, I don’t mind simply tapping the button to change modes. I don’t think I’d want to reduce the runtimes with an extra sensor, either, or make it no longer waterproof by drilling a hole for the sensor to use.

ToyKeeper, I built a red tail light a while ago using a single osram golden dragon LED, lithium ion cell and a 2x7135 driver. The LED was well heatsinked (even though it never got more than 5 deg C above ambient temperature without heatsink) The LED failed after a couple hours of intermittent use. I replaced it using another osram LED and that failed too… l decided to buy two xpe LEDs and put them series ( to increase voltage) and this combination has been working for hours and hours without problems.

The output of the driver was below the max rating for the golden dragon LED so I’m assuming either the LEDs were faulty or the lower vf of red LEDs caused them to fail. Your experience may be different.

WRT drivers, I think the mobydrv from Dr Jones has some nice blinky modes AND their brightness can be adjusted. Only problem, electronic switch.

Ah, the Osram Golden Dragon… that was the first genuinely bright LED I ever saw. I bought one in the form of a battery-powered puck light just so I could have a bright LED, and carried it around sometimes like an awkward glowing hockey puck so I could see things at night. The main issue with it was that its switch was an infrared motion sensor, so it was impossible to keep the thing from turning on by accident.

It’s still around, though it really isn’t very useful without a wall adapter.

In any case, the parts for my bike lights won’t be here for at least a couple weeks. Gotta wait for shipping from China. Maybe if my missing package shows up though (tracking says “delivered” but it’s not, filed a case with the post office), I can at least start on the firmware. For reference, this driver is similar to what I use. The 3Hz strobe is what I use most of the time.

Nice fine. Thanks you so much.

As eebowler mentioned, I developed mobydrv for biking use, with quite some input from mattthemuppet,

It's for electronic switches though, mainly to be able to switch the head light's brightness up and down without going dark.

If source code is available, I’d love to try it out. Or even better, I’d love to include it in my firmware repository.

You can have complete driver for something like 10$ but the code is property of DrJones :wink:
P.S. I have 2 of those, very nice UI

DrJones, is it okay if I include a copy of nlite.hex and its associated description (both from ) in my firmware repository, along with attribution and links to your site?

I’m planning to publish a collection of flashlight firmware on, a code / project management site, or perhaps, if people prefer that instead. I’d like to include anything you’re willing to share.

I tried to leave it alone and go do something else, but I failed.

So, after messing with attiny13a code for an hour or two, I’ve got a working firmware build which should function as a bike tail light. It’s heavily based on JonnyC’s STAR on-time firmware. I don’t have the hosts to actually build the lights yet though, so I’m not sure if the brightness levels and such are actually appropriate.

In any case, here is the current mode list:

  • Moon
  • Low
  • Medium
  • High
  • Moon-low flasher: Using moon as a base level, flash at one level brighter four times for 5ms each. Repeat this cycle once per second or so.
  • Low-med flasher: Same as above, but with higher output.
  • Med-high flasher: Even higher output.
  • Heartbeat: Blink very briefly (2ms or so) twice on “high”, then wait. Timing is approximately the same as a human heart beat at 60bpm.

Low-voltage detection and step-down are enabled (but untested since I don’t have any low batteries).

The driver can’t be configured based on soldered stars. Configuration currently requires modifying the code and rebuilding it, because the binary is almost 1024 bytes. I had to shave off a bunch of optional stuff to reduce the size. I may be able to re-enable this later if I can reduce the size further.

On-time mode memory is enabled. I don’t normally like it, but this means occasional bumps on the road won’t cause the light to reset to moon mode — when it gets power again, it’ll go back to the mode it was on. However, it also means you must cycle through all modes to go backward in the sequence.

The exact timings are off, since _delay_ms() isn’t very accurate. I got it pretty close to 1Hz / 60bpm on my hardware, but I suspect the timing may vary on different drivers.

If anyone wants to try it, the .hex file is here.

The Launchpad project is: Flashlight Firmware Repository in Launchpad
Here’s the link if you’d like to browse the code online.