mobydrv - programmable driver mainly for cycling (electronic switch)

Recently I had some PM discussion with mattthemuppet and got some insight into what kind of UI might be suitable for cycling. The result is a new driver: mobydrv.

The driver hardware is just a NANJG105C (2.8A or 3.04A) or NANJG101AK1 (1.4A), well known linear drivers with an input voltage of 3-5V, suited for one Li-ion cell (or multiple in parallel; or 3*alkaline or 3-4*NiMH in series) driving one LED (like XM-L, XP-G, Nichia etc.). Multiple LEDs can be driven using a master/slave setup.

The main goal was to make it very easy to switch the brightness up and down to adapt to changing illumination needs while riding. Switching the light off is more difficult though to avoid accidental darkness.

Also some different kinds of strobe have been implemented: Two oscillating strobe patterns for being seen, but these are not just blinking on and off, but instead oscillate between high and low brightness (so the light is never off then). They come in two patterns (regular:oOoOoOoO and double-pulse:oooOoOoooooOoOooo) and can be adjusted in brightness (just like the constant brightness modes). Not going off allows better estimation of your position/distance, while the blinking catches attention.

It also has two mode groups for more flexibility. Each mode group has it's own memory, so if you toggle groups it will return to the previously used mode of that group.

It is fully 'programmable', i.e. every mode can be changed, also the number of modes can be changed. I found the method used for changing the brightness very comfortable, much nicer than the typical ramping usually used. The steps can be counted, so you can know what level you are in.

  • Short taps (<0.3s) switch up: OFF > L > M > H (> H ) (supposing you have 3 modes)
  • Long taps (>0.3s) switch down: H > M > L (> L)
  • and so does a press&hold: H >> M >> L >>>>>>> OFF >>>>>>> battery level indicator
  • which additionally allows switching off (~2s hold)
  • If you continue to hold or press and hold when already off, you get a battery level indicator: A number of blinks shows the battery status; about one blink for every 0.1V above 3.0V without load (~12 is full, ~4 is pretty empty).
  • If you do a short tap immediately followed by a long tap (tap-taaap), you switch between mode groups.
  • Quickly tap 8 times to get into programming mode, a dim oscillating signal indicates that. It now awaits your command, which is another series of fast taps:
    • 2 fast taps: Change the brightness of the mode in which you started the programming mode (with 8 taps). This applies to constant brightness and strobe modes. The light shows that mode's current brightness, use press&hold to ramp up and down (alternating). You can use press&hold as often as you want. When you found your desired new brightness, double-tap (2 quick taps) to store it (single tap to abort).
      The ramp consists of 12 steps with lots of choices in the mid/high range to suit your brightness-vs-runtime preferences: 1 2 5 10 16 25 32 40 50 63 79 100 (in %)
    • 3 fast taps: Switch current mode between constant brightness, regular strobe, double-pulse strobe and from there back to constant brightness. (To get from regular strobe back to constant mode, you have do the whole procedure twice.)
    • 4 fast taps: Delete the last mode (if there's more than one).
    • 5 fast taps: Append a new mode (max. 7 modes).
    • The above programming will be temporary, i.e. not be conserved beyond a battery change or lockout. This allows testing your new setup. But you can make it permanent:
      8 fast taps: Stores your current mode configuration permanently, i.e. it will not be lost when the power is disconnected (battery change, lockout).
  • Battery monitoring: Whenever the battery falls below 3V under current load, brightness is reduced (about half). This will repeat down to a very low level, it will not switch off though.
  • 170µA quiescent current when off (depletes a full 2200mAh cell in 1.5 years).
  • 18kHz PWM frequency, not visible, not audible.
  • The initial mode setup comes with 3 brightness modes in group 1 (2% - 50% - 100%) and some strobes in group 2 (low double-pulse, high double-pulse, high regular), but by programming you can change and mix the whole setup.

I actually use this driver in my SmallSun ZY-T29, and while switching it off is not the most comfortable thing for a 'normal' flashlight, I really like to be able to switch it up and down so easily.

PM me if you want one.

(more of my drivers)

Sounds great, PM sent!

:slight_smile: great job DrJones. I think this has been well worth the effort, how ever little the effort may have been on my part! Can’t wait to get mine, even though I don’t have anything to put it in yet…

Perfect timing!

I have a new XM-L2 light that is ready for assembly, just needs a driver and some batteries.

PM sent

Looking forward to giving it a whirl!

Thank you,

Don

That's awesome that you put a website together outlining all of your programs! Thanks!

Sounds awesome! Love the idea of being able to change output level up or down! So does this only work with lights with an extra electronic switch, or can it be used on lights with a single standard tailcap clicky?

-Garry

JonnyC: Thanks… And my next firmware is just set to go :slight_smile:

garrybunk: It requires an electronic switch/momentary pushbutton, like the ZY-T07, ZY-T11, ZY-T29. An additional power clicky is not required. It will not work with just a normal clicky.

That’s because with a momentary switch the driver can measure how long it was pressed, whereas a clicky just cuts power, so the driver can’t do anything when the clicky is pressed.

by “momentary pushbutton” do you mean forward clicky, as I have 3 or 4 spare plus a host and XPG2/XM-L2 leds waiting for the right driver,and I’d like to try this one.Sounds like an awesome driver.

No, not a clicky…

I meant a tactile switch, i.e. a non-locking momentary switch, like a key on your keyboard or a button on your mouse. It also does not carry the 3A LED current, but is just a little button connected to the MCU, signaling it if the button is pressed (and carries only a weak signal current). It is connected to one of the stars of the NANJG board.

The driver is always connected to the battery power and thus always drains a bit of current even when off; it’s 170µA in case of the NANJGs, mainly due to the battery level sensing voltage divider. The MCU itself takes <10µA.

The whole setup us called an electronic switch, because the main load (the LED) is switched on and off electronically, not by mechanically breaking a contact.

DrJones, this looks like a great board!
Do you think if I removed a couple of the 7135’s from the 1.4A board this would be a good driver for a rear bike light using a red XR-E (max current of 700 mA)? I’m mainly thinking of using the strobe pattern modes.

Sure, that was one of the design goals…

if you wanted to go completely crazy, a triple parallel red XP-E at 1.4A would be fantastically bright, even as a mule. It’s what I did :slight_smile: I can’t wait to stick an optic on it, should be amazing. You can get the boards from Illumination Supply (or Cutter perhaps) and the LEDs from Cutter.

A red XP-E should be able to go up to 1A easily enough and would probably be fine at 1.4A with the oscillating strobe as it’ll only see that current when it “pulses”.

Ha ha Matt! I did build a double red led in the past with a 1.5A driver in a gutted $3 rear light housing.
I felt too guilty to ride with it as it was kind of like being hit in the face; only with light. Also it was extremely unfriendly in bunch rides :wink:

ah yes, definitely not a good option for group rides :slight_smile: Still, you could set up the driver with 2 modes - one full strength oscillating for commuting or solo rides and one low power one for group rides. I’m not sure that the low power version of the oscillating mode will be low enough for group rides, but it would be a good option. This kind of scenario is exactly the reason for being able to put different types of modes together and also for the 2nd mode group - you get to choose exactly what you want and how to set it up. I think it’s awesome :smiley:

Ordered! Thank you DrJones

Also ordered one :D

I’ve used reed switches as momentary(NO) switches. This looks great. Sending pm.

Received myne today, I hooked it up and made a video :)
Excellent job with this driver DrJones :)

great video sirius, looks like the double pulse mode came out perfectly! I really am going to have to tear my rear light apart again to fit one of these :slight_smile:

Yeah, I was sceptical about that to, but it turned out as an interesting one :) It works excellent. There is only one thing that would make this driver a perfect one and that is instant power off, but that is not so easy to do, probably would have to sacrifice programing features...

I will program it with 4-5 level brightness modes and 1 or 2 double-pulse modes :)

Again, excellent work DrJones :P