luxdrv - custom modes driver firmware with ramping

Wow, this is way over my head... it'd be nice if one of you guys offered custom programmed drivers for sale. I'd love to have H,M, and strobe as low is useless for my bad night vision.

Rich

First of all, thank you DrJones for all the programming work. Way out of my league!

+1 to finding one of you that might want to program for others. I can add 2+2=4, but it usually takes me about 3 tries..... Each time I do it!

So, have any of you Tido, DrJones or any other wizards, thought of doing boards for others?

I'd like to have a real current regulated buck driver fitting in a 16mm pill that can be powered by a single LiIon cell (being able to also handle two would be a BIG plus). Unfortunately there doesn't seem to be any one available that fits the bill.

Dear Tido,

The National Semiconductor's LM3405 may fit the bill which Vin operating range from 3V to 15V but the max. current is only 1A. I have built a 12mm 0.6A buck driver employing this IC.

I did some searching on integrated buck regulators and I agree, they all seem to be limited by a max output voltage of ~80% of input, which won't work for a single li-ion cell, except maybe for the first few minutes after a fresh charge, and if the Vf of the emitter is low enough. For 2x Li-ion setups though these chips look attractive.

@dorpmuller, @Old-Lumens:

I just received 3 more NANJG 103Cs which I don't really need right now (4.99$ each), so I can send them to you customized to your wishes. They'll be more expensive though, due to postage and paypal fee; it's nearly 8$ in total (for what I paid for the driver plus worldwide shipping and paypal).

I was considering putting together a flashing service for anyone looking to have a custom driver. I'm not nearly as good as Tido and DrJones, but I at least have the equipment to do the flashing. I programmed 6 8x7135 boards for oldbobk and they seem to be working well for him.

DrJones, I haven't tried out your code yet, but the ramping feature is really cool. Again, one of those things where I said "why didn't I think of that?". I'm working on a new program that's really quite basic, but is something that I've really wanted, and I'm running into so much trouble. I should just bite the bullet and use your or Tido's code.

These is out of what I can even imagine to do, but I appreciate a lot the efforts you are making for such nice custom drivers.

I would love to see one of the V2 ones from Kaidomain, keeping the low voltage signal to be used with non protected cells (26650) and the ramping, is it possible? Do you know if the low voltage signal can be regulated to 2.6V?

The KD V2s seem to use a different µC, so I can't reprogram them. If they are PICs (I doubt that, but I don't know), Tido probably can do something (I don't like PICs, so I won't).

With the Nanjgs, changing the low-batt level is easy.

JonnyC, what do you want to implement?

I basically had two different programs that I use. One is the basic cycling through modes. If the light is on for more than 2 seconds, it stores that mode. If it's on less than 2 seconds, it will move to the next mode the next time the light is on. This works both for forward and reverse clickies.

The other version allowed me to "click" to the mode I wanted (can't think of better terminology). It only works with forward-clickies, but the light doesn't turn on until .25ms after the switch is pressed. If you want to access mode one, you do a short soft-press once, then turn the light on. If you want the third mode, you do three soft-presses then turn it on. This allows you to turn the light on for ~1 sec and not have it switch to the next mode, which is frustrating with the previous UI.

Basically, I'm attempting to integrate the two. I have the code for it, which logically seems right and compiles, but I keep running into weird debuging issues and the code does not do what I think it should do when I flash it to the light. So for now, I've given up.

any idea if i can get away with these instead of a soic 8 clip?

DrJones,

I just wanted to take a second to thank you. I ended up taking your code to implement basically the same thing but with memory. I had to change a few things around, but it's working out awesome. I love the ramping! And actually by chance, the ramping works perfect with memory. Once you find the right brightness, turn it off, then turn it back on to go to that level. If you turn it right back off, it will go to the next mode the next time. But if you leave the light on for more than 2 seconds, it stores that mode again, so you can maintain your custom light level for as long as you'd like.

- Jon

Hm, that's what my driver does, too... What did you change? I also have to admit that I didn't understand the concept of the driver you mentioned in your previous post, though I understood both single concepts.

Budgeteer: No, they are too big.

This is awesome guys! DrJones thank you very much for sharing. I will attempt this in due time

Would it be possible to add temperature monitoring together with the voltage monitoring already added?

Sure. You need to connect the temperature sensor to a different pin (i.e. one od the stars) and add some lines similar to those for battmon (plus changing ADMUX) in the ISR(WDT_vect).

Hi Dr. Jones,

I have a basic question about the PWM frequency on the attiny13 that I can't figure:

The max clock speed is 20Mhz, and the internal clock is either 9.6MHz or 4.8MHz. I can't figure out which number is the true max PWM freq. (assuming pre-scaler of 1), and further, why you and others list the max PWM freq. in kHz. I know phase-correct PWM divides clock freq. by 2 but for fast PWM mode, how does one calculate the max PWM freq., and can the timer be run off a system clock speed of 20MHz, or is the internal oscillator freq. the only possible timing input for hardware PWM? Sorry for the basic question but I can't seem to figure it out.

To get >9.6MHz you'd need an external oscillator (quartz). Without, the maximum is the internal 9.6MHz RC oscillator.

Max frequency is ~37.5kHz: 9.6MHz divided by 256 (counting from 0 to 255) in fastPWM.

9.6MHz/510 ~19kHz for phase correct PWM (counting up&down 0..255..0..255..).

I use 4.8MHz/510 = ~9.4kHz

Thanks, that clears it up.

Hey.
The link to version 0.22 does not work.
They could fix it? thanks
Alexander

Hi, can not make the functioning modes as in the Lumodrv?.
I would like access ramp mode only by pressing the button for some time. In ramp mode, the end and beginning are also marked by a flash?
Also would be nice to have modes, strobe, beacon, a group of modes separately.
thanks
Alexander