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

Yes.

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

Uhhh...so why are they not making the 105C's w/ the 25v from the start? Just cost?

EDIT: Or just jump to the 85v?

They don’t need it for the simpler programs and cost is different.
Place an order to the factory and they might make it. It’s all about what shops want to sell and buy or order from the factories/distributors.

For DIY most people go with Attiny85 in this package.

Here is the SALES THREAD

Hi Bocian,

thanks :) I spent a lot of hours optimizing code to get all the functionality into the 1kB of ATtiny13. I occasionally used ATtiny25 and 85, also experimented with off-time memory (using a cap and a 100k discharge resistor; yours is the simplest off-time memory setup I've seen; nice idea to use the internal resistance. I'll have to investigate further), but my premises were not to mod the hardware.

I really wish they had used ATtiny25 or better.

However recently I begun to design my own boards, clearly not using the ATtiny13 :) After so many hours of writing compact code, I feel sort of guilty when writing 'expensive' (in terms of program space) lines of code, even though the 85 has plenty of space. :)

How do you make the 0.2% and 0.015%? Just by PWM levels or something more tricky? I found that the real brightness at the lowest PWM levels strongly depends on hardware variations. With some luck I get a nice very low low, the same value in another driver/LED combo (same models) may be much brighter - or won't even light up.

DrJones sorry for a mess, but I’ve answered Your question in sales thread 0:)

Maybe if Your custom project is not very advanced yet You should think about using current regulation based on operational amplifiers instead of common AMC7135. That gives You lower drop Voltage for a constant current regulation and possibility to mix digital control PWM and analog output (no flickering and using LED advantages in lm/W when low powered). Currently I’m developing Headlamp XP-G2 S2 mod using such solution and it works wonderful (those efficiencys when powered 0,2-20mA and more)l 8)

Ok, about the cap on the input pin. I was reading this thread, https://budgetlightforum.com/t/-/17286#comment-400487, which outlines what DrJones was referring to with a discharge resistor. Does an I/O pin have a specified state when power is disconnected from the MCU? According to the diagram in the datasheet (what PilotPTK referenced), although not a complete diagram of the circuit, it looks like the cap would discharge immediately when the device is powered off. I tried measuring the resistance of the pins, but different pins came up with different numbers and the resistance changed over the time that my DMM was connected.

It's great that adding a simple SMD cap can give us "off-time" mode switching, I just don't see how it will work besides just trial and error (add a cap and see how long it takes to discharge). It would be nice to know what state the pin is in, and what the resistance is, when the battery is disconnected.

Bocian: I'll reply here though :)

Interesting; I didn't know the ATtiny25 can handle the lowest modes more reliably. I'll try that. And yes, one of my next drivers will have 2 channels, one with only 1*7135, the other with the remaining ones. I'll also try an AMC7136 based driver for a change.

I thought about an OpAmp linear driver, too, PWM filtered with an RC low-pass (maybe second order), but I'm not enough of an electronics engineer to know how to choose a suitable OpAmp for those small voltages down to some µV for the low modes. There's quite a gap between understanding the principles and really building a working circuit (depending on the complexity of course).

JonnyC: I tried measuring the resistance of star4 to GND; depending on the multimeter used I get ~5 MOhm or 30 MOhm - they measure at different voltages. I'll probably try an oscilloscope soon.

It is in off state and the resistance is dynamic, not the same value at different voltages. I asked before, Bocian did not like the questions.

Yes a capacitor is enough if you have a big enough capacitor and big enough resistance in the MCU when it is off so the capacitor does not discharge too fast. The specs don’t say these values like resistance of different pins in an off state.

The way it is implemented in BLF-VLD thread is by adding a resistor and using a smaller capacitor, to charge the capacitor fast there is a diode to bypass the resistor. All you need really is a capacitor if you can find big enough one for your MCUs resistance.

Johhny, 1st page, I got: 66kOhm on 3 samples of Nanjg105C with ATtiny13A, on all pins, 200k range on DMM, minus on ground. If I put minus on pin the resistance was 27kOhm. Resistance was higher when I used 20MOhm on the DMM, maybe 1.3MOhm, I did not note it down. It is really a bit of a trial and error unless you can make a graph of resistance vs voltage.

From Bocian’s values of capacitors I calculated/guessed a resistance of about 1MOhm for the capacitors to have some reasonable voltage left after 0.5-1s. Although beware he uses 25V not 13A, may not be that comparable.

JackCY - Sorry, I totally passed over your exchange with Bocian and then asked basically the same question, ha . I looked through the datasheet and searched the AVR forums and couldn't find any info on the state of pins when the device is powered down. So it really does just seem like a crap shoot on picking a capacitor that would work.

Is there a maximum amount of 7135s this can control/be a master too?

In my opinion: 1-2 or max. 3 of additional AMCs on board (105C) should not cause a problem (if You correctly cooling them in flashlight). But You must keep in mind that the electrical connections in this driver was not designed for currents like 4-6A.

PS. I can always (if remove orginal MCU anyway) drill a hole in PCB + connection to other side of driver and solder there copper wire from one side to another. Also can solder better connections between AMC current stabilized ground :slight_smile:

Ive done a total of 16 before on more than one occasion. 5,9A on a single 105C (Qlite). I have seen others go higher on a single board...

I have seen master/slave setups around the 15A range. (Something I will do soon too, not with the one Im buying from you, but I might try that out too.)

If that can be done with a regular 105C, I would assume yours can handle it just as well?

Do you or anyone know if there is an upper limit if you master/slave 105C drivers with 8-12x7135 on each board? Can a 20A driver be made? 0:) (Im aware of possible issues with switch, spring, etc ..)

(picture from DrJones)

Oh, let me help.

This has been discussed before - in the big mammuth thread - from post #164 (look here) thru post #177 (Especially read #171).

Ah, thanks! I figured it had to be somewhere in the monster thread.

Thanks sixty.

RaceR86: why not use direct drive for outputs above 5A?
Seems silly to me to stack many boards to get a current that you can get with a single FET.
Unless of course you specifically need the current limited to a certain value.

Two improvements have been made:

- increased speed of PWM

  • thermal protection now works more smoothly (hardly noticeable to the eye when reducing brightness)
    We are thinking also about implementing additional/alternative method of temperature treshold adjustment (after some multicliks driver turns on in 100% mode, then by touch, when sense max. safe temperature You click and from now on this “touched temperature” is written as a max. temperature treshold. What U think fellows?

Ah, I had the same idea (for setting the temperature limit) a few days ago and had noted it on my to-do list for my bigger drivers. So obviously I like it :) The user should be advised to do that temperature threshold configuration with full batteries.

I personally like to see a noticeable step in brightness when thermal protection kicks in, but that's just my taste.

What's the reason for increasing the PWM speed?

Because, it was in my opinion, a little bit too much audible in previous version of thermal protection mechanism (therefore we modified both) :slight_smile:

how about some kind of notification that output is being reduced due to temperature, it would be nice to know that heat shedding is not sufficient, and one can even test different environments to figure out how long the light can maintain output before temperature induced reduction (and even compare between lights)