Polish project: Extended version of Nanjg 105C driver based on Attiny25V

Welcome everyone! Greetings from Poland :slight_smile:

I would like to present extended driver according to my personal project. Basically, I have to mention I am not an advocate of complex things, which nature should be simple and intuitive. From my experience I have concluded it is better to force a user to adopt certain regulations, which they will accept as theirs with time, instead of adding a handful of clicks just that one person has what they want. Let’s move into details now.

The heart of the driver is a microcontroller of the Atmels family AVR a – Attiny25V. High-speed PWM (lack of low mode flicker). Multiclick driver uses a ceramic capasitor, which is used to avoid the continuous “grinding” of EEPROM, which as we know has its limits – breached by a few;)). It has 4 programmable modes among the palette of 11types of brightness available in programming procedure. Factory settings are as follows: 2, 5, 8, 11 (0,15; 10; 32; 100).

Navigating between modes works two-way. One click makes you move to another mode in the loop, double click takes you back to the previous one. It allows us to; for instance, reduce brightness without clicking through stronger modes in the loop. After reaching the verge of the loop, moving further will cause „a jump” to the next verge of the loop.

The ceramic capacitor is used as one binary digit memory with a limited time of holding information. It is used to differentiate short loss of power supply voltage (click) from switching off. Standard capacitor 470nF secures time, after which power supply loss is off for about 0,5 sek. Capasitor change to 1 µF allows the time extension (the length of a click) to 1 second. Hence every loss of power supply shorter than 0,5 second is treated as “a click”, each subsequent click after shining shorter than 0,5 second is treated as the next click of a multiclick.

The programming procedure of a given mode is elicited by 6-click, while being in the mode we wish to change. Displaying the sequence occurs in the lowest mode (signaled by one twinkle) upwards. Every mode displays for about 1,5 of a second. After reaching 100% there’s one twinkle, then it displays modes downwards. The mode is programmed during the display invoked by a click or by the mechanism of turning off the switcher. If we cease to do anything during the procedure of presenting modes upwards and downwards, the light brightness will remain as previously set.

Brightness level palette available in the programming process:


Stroboscope (The strobo) mode is invoked by 3-click. The intensity of the flashes is the same as in the mode we have invoked the stroboscope, and has an optimal frequency 2Hz.

Precise battery cell voltage measurement under full load is invoked by a 4-click. I have approached the subject in my own way, assuming the following:
Practical band of discharging the battery cell Li-Ion under load ranges from 4.0V to 3.0V. After invoking a 4-click, the lamp flashes for a short moment in 100, then the measurement happens. After that, with a number of flashes in 20 mode, the driver informs us about one tenth of V by 3.X. For example 8 flashes indicate the voltage of 3,8V; 5 flashes mean 3,5V, etc. The range is from 0-10 where 10 indicates 4.0V (the battery cell just unplugged from the charger), while no flash (3.0V) means that in a moment you will be receiving a low voltage level warning. This way of measuring proves correct in diagnosing new lamps and an associated drop of voltage in the whole construction (a contact quality, etc.), since we are given the information which physical voltage is found on the driver level.

Temperature monitoring
This procedure always works in the background and monitors current driver temperature. It is based on a processor internal temperature sensor 25V. After reaching safety threshold (default 60C) the driver flawlessly reduces power, then tries to equalize to the set work mode. If the heat isn’t effectively absorbed, next reduction occurs while holding to the preset safety threshold. After cooling the lamp (for instance, cool air blow around the lamp case) the face value returns for the programmed mode. This mechanism is efficient enough, so that we could even wrap the running lamp in a blanket without any fear of damaging the equipment… or the blanket ;-).

Since the range of tolerance for sensors of the processors within the Attiny 25/45/85 family is rather high, the Procedure of Service Regulation of Temperature for Safety Threshold (default 60C) has been implemented. It also allows advanced users for tuning the driver so it would fit the construction it works in.

10-click – the temperature limit extended 5C upwards, confirmed by 3 flashes.
12-click – the temperature limit extended 5C downwards, confirmed by 2 flashes.

The above changes can be done repeatedly, e.g. 10-click performed twice in a row will rise the temperature by 10C (3x =15C etc.), just as 12-click tunes the mechanism to our needs.

Auto-calibration of temperature safety treshold invoked by 9-click (when assembled in flashlight: driver start in 100% mode, lamps head getting warm, then by touch, when sense max. safe temperature, by any click this “touched temperature” is written as a max. temperature treshold).

RESET to factory settings (modes to: 0,15; 10; 32; 100 and temperature for a safety threshold back to 60*C). Inovoked by 8-click.

The low battery cell voltage warning starts when the cell, in a working mode reaches about 2,9-3,0V. Then a single flash appears and a reduction to another, lower level from the programmable modes palette (we reach ~2,9V in the given mode, and after a flash, we drop to another, lower mode). This works to the level 3 (1). When this happens the lamp will retain this level, flashing periodically every 10 seconds. After reaching 2,8V you will experience the last mode reduction to 2 (0,15). After reaching critically low voltage 2,6V, the driver 4 flashes and goes into sleep mode.

According to my guidelines, my friend Pyra is the codemaker of this project. By the way, please visit our flashlight forum: www.swiatelka.pl

The driver is available in two versions, 3,04A based on 8-pack AMC7135 BIN 380 mA and a standard 2,8A on AMC 350mA. The drivers on offer will have soldered wires 0,35mm2 in silicone insulation (model type, current of continuous operation - 10A). Upon request (without any additional payment) they can have a soldered metal plate of the Omten PBS101C switcher (this switch has a 5mV voltage drop@5A and plates made of coated bronze), where the spring with a positive terminal connects to the cell. This increases the surface area of contact between the driver and the cell, by reducing voltage drop all in this place. I believe it is better material than the usual, brass disk.


Sounds interesting. Just to make sure I understand. One can select, lets say, 3 of the above power levels and not have to see the others?

Tried the above link, but say "page not found".

Thanks for sharing! Welcome to BLF! :party:

P.S. forum link needs to be the full url to work:

Where we can download firmware?

Yes. That is correct.

Welcome to the forum , Bocian .

This project of yours is very interesting . Thanks for sharing .

Your driver has a few nice features. I like the two way navigation and have one question:

Would it be possible to get a seqence like: 32%, 100%, 0,15% or must the lowest mode on position one and the highest mode on the last position?

Is there a possibility to translate your forum directly to another language (with a switch button - I don't notice one) or should I use google translation?

I think he wants to sell that driver (and I won’t blame him for that, just keep the price reasonable).
Remind me a lot of DrJones custom Nangj driver but he also moded the hardware. I replaced the driver of a Convoy S2 with DrJones lucidrv and it’s now my EDC, everytime with me, changing mode is so so nice.
How fast exactly is PWM? (drjones drivers are 18kHz).

Sounds really interesting. If the price is reasonable, I’m in for testing :slight_smile: Now I’ll have to find new hosts…Maybe the new Solarforce L2D

You can program mode loop as You will. For example 100, 32,18, 0,02 or 100, 0,15,100,0,15 (in this case only two usable modes) and always can change/manage it by 6-click. There are plenty of capabilities. I didn’t mention about mode memory. After min. 0,5sec. (or any longer) OFF driver next time will start in previously used mode. We can disable mode memory by making short like on the photo below (after OFF start always from first mode in loop):

For choosing memory mode, maybe it’s better to be able to choose by clicking and not by soldering and be able to lock a mode, for morse transmission.

When will this driver available for purchase? Can you provide pricing?

Please excuse my manners. Welcome to the forum Bocian.


Great work, thanks for sharing.

Welcome to BLF!

What is the difference compared to BLF-VLD programmable?

Do you still use eeprom or how did you avoid using eeprom to save it?

The UI is quite complicated, unnecessarily. I thought you said:

This is not simple and using some tons of clicks to set things is way far from intuitive.
It’s like having a cheat sheet nearby to reprogram it by clicks.

Is actually the incorrect way to measure battery voltage if you measure it at 100% load on the output.

Temperature monitoring of ATtiny, practically useless. For applications where one needs it a more robust way of measuring is safer and relying on a MCU temperature instead of LED temperature could be disastrous in those applications.

The capacitor values are also confusing, my ATtiny’s have resistance there (3 samples, all pins) 66kOhm so something like 1uF would hold high state for 0.09s = 90ms. Not 1000ms.
If it would be 4.7uF and 10uF then it is believable and seems correct.
Or if the resistance would be 660kOhm.

What resistance do your I/O pins show when off power? (Negative of your meter has to go on ground, otherwise it turns to be 27kOhm for me.)
Are the capacitors really 470nF and 1uF or 4.7uF and 10uF?

And a correct link.

Also what is the PWM frequency? Plan to release code or sell drivers?

Hi JackCY. I don’t know any BLF-VLD driver… Can You give some links? PWM frequency is around 16kHz. JackCY with all due respect but You must educate more in electronics. How do You want to measure resistance of semicunductor (Attiny MCU). It is completely ridiculous (You measure also resistance of LED diode?) EEPROM is used to write values and counting clicks. EEPROM writes are make not when we switch off the lamp but only when parameters change or sensing click. MCU pins have not usually definited resistance but there are sum of semiconductors parameters and this “resistance” changes depending on measurement conditions (voltage). In measuring voltage on capacitor uses ADC not state of the pin. In my opinion (and opinion of people using this driver) voltage measurement under full load works very well and exact (giving us information about current Li-Ion cell condition). Also temperature protection is very useful (especially for small and powerful 18650 flashlights “(like here)”:http://www.swiatelka.pl/viewtopic.php?t=12630. or here

I like to read technical stuff which I don’t understand. Makes me realise how stupid I am!

Blf vld is for budget light forum versatile led driver.
A custom firmware for attiny13. It’s free that’s why jackcy use it.

Jackcy, look for the first thread, he explain how and why he replace the eeprom.
The multiple click is not a problem, DrJones drivers use even more click (better have a reverse clicky).

Bocian modified the 105c hardware so it’s clear that he plan to sell that driver. I am already happy with Dr Jones lucidrv (a 105c with programmable mode that he sell without giving the source)

You can find something about it even in your local forum:


Is it? On an assembled driver measuring at the place where the capacitor is? How is the resistance for that added capacitor be somehow different once it is there?

Plus all parts have resistance, capacitance, inductance, …
Some are parasitic and some parts even use these parasitic to a useful degree.

Yeah so with every click as usual.

Can’t write when it is off anyway :wink:

Yes. That’s why I asked.

Ah, ok.

Under load, yes. But normally you measure resting voltage to decide if a battery is charged or discharged.

Have D4/S6, never needed temperature protection for it.

Where here or on the PL site? What is the name of the thread?