How To Build a Flashlight With Perfect Modes (picture heavy)

Hi Tido

Yes - I have tried 1/255 and it seems very stable and usable (I like an ultra low low).

When using two different 14500 Li-ion cells I measure the following current at the tailcap, but please keep in mind, that my multimeter is a cheap one, so the PWM probably fools it:

DX Trustfire "Blue", sku 19626 @ 4.14V: 0.52A

DX Trustfire "Flame", sku 26124 @ 3.75V: 0.58A

I wanted to take a reading with a NiMH cell, but I just discovered, that the light does not come on at all, with any of my NiMH cells (even fully charged ones)...

I use the BLF-VLD with only 5 modes and no memory ( 255/255 -> 32/255 -> 1/255 -> Strobe -> "Soft Beacon").

Can you think of a possible explanation for the light not turning on with NiMH ?

The same here. I am waiting for 4 pc. of 101-AK from DX ordered nov.6 -shipped nov.25!

So I have now programmed a SKU: S009742 from Kaidomain ordered nov.8 arrived nov.22.

I just don't own an emitter (yet) that runs on 2.8 A. The XM-L plug-in is to expensive for me - I fear it should be caught by the P.O.

(I would really like to test that emitter) .

Actually, I bought that driver to harvest the 7135's for bringing the 101-AK's to do 1.4A, but now I will keep it for the future XM-L

I got my 8-pin clip to work after 1 hour of surgery and will now sacrifice the BLF for a better life, hopefully.

The ATtiny needs at least 1.8V to work.

Ahh - the good old P.O. - here we have a limit of around 15$ - above this value you get an additional 30$ in handling fee plus 25% VAT :-)

The BLF AA-Y4E worked fine with NiMH before I re-programmed it, so there must be another explanation I think ?

Oh, I smell Denmark here. Welcome, fellow countryman.

I think that the $ has risen so the limit is only $14 now

At least we are in the same "boat".

The NiMH matter could be an issue for Tido, perhaps initialization is wrong. Or there should be some form of charge pump to bring the voltage up.

Yes. Actually, that is exactly what I dreaded. When using Li-Ion, the driver is most likely in direct drive and not boosting. On NiMH it needs to boost, but the "on" periods are probably too short to allow the boosting circuitry to start up. Have you tried if it works with higher PWM levels?

Also, could you post a picture of the PCB's component side? Maybe there is no special driver chip and the ATtiny was used to switch the coil. In that case you're screwed when it comes to using NiMHs.

Nice - thank you - and "godaften til dig også" (sorry non-Danish forum members)...
The SKU S009742 from KaiDomain looks interesting - especially with the new XM-L arriving. I'd better place an order :-)

I could try make the BLF start in the lowest mode, and see if it will run with NiMH's again.

Btw: what is the PWM frequency when running the BLF-VLD firmware - I am very impressed with the flickerfree operation: I see no flicker whatsoever even in the lowest (1/255) mode

Tido: I think we cross-posted :-)
I'll grab my camera (and soldering iron) and upload some images in a minute...

I just tried making the driver have one mode only - 1/255 and 255/255 - but it still won't start on NiMH's :-(

Sure - here goes:

You should try the highest mode (255/255). This way there is a constant current draw from the LED and the boost circuitry should not be impaired by the output PWM.

If you used the fuse settings I posted yesterday, the chip is clocked at 4.8MHz. With phase corrected PWM this should result in ~9kHz PWM frequency. This gives me an idea, you could try setting the chip to 1.2MHz (9.6MHz and CKDIV8 fuse set), thereby reducing the PWM frequency. This would result in longer "on" phases, maybe long enough for the boost circuit to stabilize. But for this the driver needs to be recompiled and after flashing the chip might not be accessible any more with your programmer.

I use these parameters when flashing the chip - I took them from your post the other day:

avrdude -P /dev/tty.usbserial-A600aSmp -p t13 -b 19200 -c arduino -u -Uflash:w:BLF-VLD.hex:a -Ueeprom:w:BLF-VLD.eep:a -Ulfuse:w:0x79:m -Uhfuse:w:0xef:m

I am willing to try to lower the chip clock - could you give instructions on this ?

Should it fail, and my driver board becomes dead beyond repair - I will just put on a smile, wait for my AK-47/101 drivers to arrive and - most important - not blame you :-)

Hmm, the chip below the red wire is a candidate for a boost control circuit, but I can't really tell without knowing how it's connected to the other components.

One thing you could try is flashing the old program into the ATtiny to see if it will work again. This way we can be sure it's a problem with the software and not just a hardware defect. Of course we'll need a copy of the original driver software... sixty545, don't flash your BLF, we need to make a backup of its firmware first!

Well, it's getting late and need to get up early. We should continue with this tomorrow, maybe via IM or IRC.

Yep - I also need to get up early tomorrow - so lets call it the day.

Lets get a copy of the original firmware (from sixty545?) - it could be fun to see, if it will work again.

I guess the original fuse settings are also interesting - perhaps the original clock is set much lower ?

I won't, I have found another victim, my WF502-B with an AK-47 set to 3-level. I can understand that the fixed mode BLF-VLD2 has 3 levels, but which 3 of the 9 defined levels is it? Oh- I see it now, is it no. 3, 6 and 8 (MODE_LVL008, MODE_LVL064 and MODE_LVL255)?

I will do that. A problem is that today is my wedding anniversary, but I guess I can sneak out to dump the firmware if I have precise instructions on how to do it.

Yes - these are the modes used in the original BLF VLD as far as I know. I had to use some time, to understand how Tido sets up modes - but it is actually quite clever…

I hope Tido can help here, as I am not expert on avrdude and its many options :slight_smile:

sixty545, please try the following command to dump the firmware:

avrdude -pt13 -c usbasp -P com2 -u -Uflash:r:flash-dump.hex:i -Ueeprom:r:eeprom-dump.hex:i -Ulfuse:r:lfuse-dump.hex:i -Uhfuse:r:hfuse-dump.hex:i

This should create four files, one each for the program flash, eeprom, high fuse and low fuse.

OK, I can give it a try tomorrow evening. Then I need a way to pass the files to nkildal.

I just sent you a PM with instructions.

Btw: I just now spent 2 hours resoldering my SOIC clip - it turned out, that 5 of 8 connections had broken.

Some of the pins had pulled back yesterday - I guess I must have broken them in the process of pushing them out again - sigh :-|

I think the 6 pin ic is a PAM 2803 or similar ,DC DC converter which must start first to feed the atmel chip.

To start pin 4 must be in high state as in simples driver without modes.

I took another picture of the driver board, showing the 6-pin chip, but the number on it is not easy to see - it may look like CF80Q...