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

56 posts / 0 new
Last post

Pages

Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland
Polish project: Extended version of Nanjg 105C driver based on Attiny25V

Welcome everyone! Greetings from Poland 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:

0,02%
0,15%
1%
4%
10%
18%
25%
32%
50%
70%
100%

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.

Edited by: Bocian on 02/08/2014 - 11:49
ImA4Wheelr
Offline
Last seen: 6 days 5 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7915
Location: SC

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".

Chloe
Chloe's picture
Offline
Last seen: 3 years 3 months ago
Joined: 01/30/2013 - 14:14
Posts: 4595
Location: 联合王国

Thanks for sharing! ^^ Welcome to BLF! Party

P.S. forum link needs to be the full url to work:
http://www.swiatelka.pl

sp5it
sp5it's picture
Online
Last seen: 10 min 30 sec ago
Joined: 12/25/2012 - 07:51
Posts: 856
Location: Poland

Where we can download firmware?

Think of how stupid the average person is, and realize half of them are stupider than that. George Carlin

 Anyone offended by my signature please fill Complaint Form. Thank you.

Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland

ImA4Wheelr wrote:

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


Yes. That is correct.
jacktheclipper
jacktheclipper's picture
Offline
Last seen: 4 hours 24 min ago
Joined: 10/31/2010 - 21:18
Posts: 4858
Location: Florida , U.S.A.

Welcome to the forum , Bocian .

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

Buwuve
Buwuve's picture
Offline
Last seen: 2 years 5 months ago
Joined: 02/11/2011 - 14:49
Posts: 1975
Location: Germany

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?

Light up the darkness.

Le_Zouave
Le_Zouave's picture
Offline
Last seen: 3 months 1 week ago
Joined: 12/11/2013 - 07:12
Posts: 240
sp5it wrote:
Where we can download firmware?

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).

Lithium
Lithium's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 08/18/2012 - 06:01
Posts: 256
Location: Brittany

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

Want DC-fix? PM me!

Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland

Buwuve wrote:

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?


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):
Le_Zouave
Le_Zouave's picture
Offline
Last seen: 3 months 1 week ago
Joined: 12/11/2013 - 07:12
Posts: 240

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.

ImA4Wheelr
Offline
Last seen: 6 days 5 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7915
Location: SC

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

Please excuse my manners.  Welcome to the forum Bocian.

Gj
Gj's picture
Offline
Last seen: 14 hours 27 min ago
Joined: 06/26/2013 - 15:44
Posts: 3044
Location: NY,USA

Welcome!

ryansoh3
ryansoh3's picture
Offline
Last seen: 2 months 3 days ago
Joined: 08/04/2012 - 08:21
Posts: 3880
Location: US

Great work, thanks for sharing.

Welcome to BLF!

BLF ≠ B-grade Flashlight Forum

 

JackCY
JackCY's picture
Offline
Last seen: 4 years 5 months ago
Joined: 12/28/2012 - 16:30
Posts: 588
Location: Czech

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:

Quote:
I am not an advocate of complex things, which nature should be simple and intuitive

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.

Quote:
Precise battery cell voltage measurement

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?

Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland

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). or here

MountainKing
Offline
Last seen: 2 weeks 2 days ago
Joined: 12/01/2011 - 03:20
Posts: 2273
Location: Lost Islands ™

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

Never ever forget and forgive. Niwal**er new kid on the block trying to act tough.
http://budgetlightforum.com/node/24847
Do not support this brand.

DINODIRECTSCAM COMPANY. DO NOT BUY
http://budgetlightforum.com/node/11324?page=2#comment-254983

Le_Zouave
Le_Zouave's picture
Offline
Last seen: 3 months 1 week ago
Joined: 12/11/2013 - 07:12
Posts: 240

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)

phantom23
phantom23's picture
Offline
Last seen: 4 days 3 hours ago
Joined: 09/26/2011 - 17:39
Posts: 766

Bocian wrote:
I don’t know any BLF-VLD driver… Can You give some links?

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

http://www.swiatelka.pl/viewtopic.php?p=109336

JackCY
JackCY's picture
Offline
Last seen: 4 years 5 months ago
Joined: 12/28/2012 - 16:30
Posts: 588
Location: Czech

Bocian wrote:
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

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.

Quote:
EEPROM is used to write values and counting clicks.

Yeah so with every click as usual.

Quote:
EEPROM writes are make not when we switch off the lamp but only when parameters change or sensing click.

Can’t write when it is off anyway Wink

Quote:
MCU pins have not usually definited resistance but there are sum of semiconductors parameters and this “resistance” changes depending on measurement conditions (voltage).

Yes. That’s why I asked.

Quote:
In measuring voltage on capacitor uses ADC not state of the pin.

Ah, ok.

Quote:
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).

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

Quote:
Also temperature protection is very useful (especially for small and powerful 18650 flashlights (like here). or here

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

Quote:
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).
Where here or on the PL site? What is the name of the thread?
Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland

OMG Tired JackCY if you are not able to understand/imagine how this driver works it doesn’t mean it has to be failure. It works just fine and everything is described in detalis – first post. And I tell you the truth : this mechanism saves EEPROM writes comparing to typical NANJG driver Smile . I see You don’t know to much about Li-Ion cell parameters. Have You heard about internal resistance of Li-Ion cell? It is an aging, destructive process of Li-Ion cell life cycle. Now, genius answer me: which way of voltage measurement (under load or in resting condiction?) is better to verify internal resistance (wear level) of a battery cell?

JackCY
JackCY's picture
Offline
Last seen: 4 years 5 months ago
Joined: 12/28/2012 - 16:30
Posts: 588
Location: Czech

Internal resistance is measured under load, surprise I can measure it too.

OMG you, who said it is a failure?
Too many questions for you I guess, not enough praise.

Saves EEPROM, I guess the same way other drivers do. Just maybe not the stock ones but since those are locked and we can’t copy them and investigate them we can’t tell anyway.

Both readings of a battery can be useful.

Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland

There will be added one more function: RESET to factory settings (modes to: 0,15%; 10%; 32%; 100% and temperature for a safety threshold to 60*C). Inovoked by 8-click.Just in case if user’s Deregulated settings (and have a trouble to correct set by itself). In few days I will provide pricing.

Chloe
Chloe's picture
Offline
Last seen: 3 years 3 months ago
Joined: 01/30/2013 - 14:14
Posts: 4595
Location: 联合王国

Bocian, will this driver be available to purchase?

Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland

Chloe wrote:
Bocian, will this driver be available to purchase?

Yes, it will be. Soon.
djozz
djozz's picture
Offline
Last seen: 40 min 14 sec ago
Joined: 09/07/2012 - 17:04
Posts: 15958
Location: Amsterdam

I think it is a wonderful driver, If they are not too expensive, I'm in for a few when available Smile

Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland

There will be also available another, cheaper version of programmable driver based on Attiny13A (everyting like in this project except temperature monitoring and battery cell voltage measurement).

Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland
JonnyC
JonnyC's picture
Offline
Last seen: 10 months 3 weeks ago
Joined: 01/14/2011 - 19:12
Posts: 1145
Location: Green Bay, WI - USA

I'm mostly interested in swapping out an Attiny13a for the Attiny25v.  Same package size but with 2k memory vs 1k and a temp sensor?

DrJones
DrJones's picture
Offline
Last seen: 3 years 6 months ago
Joined: 01/05/2011 - 13:30
Posts: 1044
Location: Frankfurt, Germany

Yes. Smile 

Bocian
Bocian's picture
Offline
Last seen: 17 hours 47 min ago
Joined: 01/17/2014 - 13:12
Posts: 67
Location: Poland

JonnyC wrote:

Same package size but with 2k memory vs 1k and a temp sensor?

Yes.

PS. Hi DrJones, nice to see You. You are doing a great job here with Attiny13 Smile

Pages