I have modified my schematics based on your suggestions. Thanks for that.
A made a low-pass filter for the LDO, separated the GND for the high and low current parts of the driver and also made a low-pass filter for the pwm signal of the mcu and connected the Iadj pin to the filtered pwm signal through a voltage divider.
I used this tool to determine the RC values. R=4,7k and C=1uF will result 0.026V ripple and 0.01s settling time.
the position of I adjt capacitor is not right, it should be between ground and the chips pin, or add a 2. there for 2 stage low pass
also the resistors seem odd 4.7k upper voltage divider then a 2. divider 30 and 10k
original GT driver uses upper voltage divider 10k then lower 3.3k in parallel with 1uF
But now you’ve left the EN pin unused… with I_adj dimming alone, you won’t reliably get below a certain threshold (10% or so). Too high for moonlight mode, hysteresis issues etc. To get below that, you combine PWM dimming (EN line) and analog dimming (I_adj).
You go down to the lowest stable analog value, from there on down it’s PWM.
Here’s the ramp values from Anduril on the GT driver for example - PWM1 is EN, PWM2 is I_adj:
P1 and P2 go to the switch, correct? I think the convention is to pull the switch line low (with internal pullups enabled). For flexibility in terms of firmware, I’d do the same too.
You can also use higher values for the voltage divider if you want to minimize parasitic drain.
R5 wanted to be a pull-down resistor for the pwm pin of Attiny I just posted an old image by mistake.
Rfltr=4.7k and Cfrtl=1uF are the low pass filter and the output of this filter is diveded by a 10k and 3,3k resistor that I also corrected and connected to Iadj.
Cfltr is connected between the pwm pin and the GND. I have 2 GND traces (high and low current) joined at battery minus.
The idea was to filter the 5v pwm and than divide it.
I do not need lower modes than 25% pwm.
But why not, I will try to do this dual EN-Iadj settings. Lets go…
P1 and P2 go to a piezo switch. I will test it how it behaves in pull down way. But I do not want to use any of the popular firmwares, they contains much more features and a “complicated” UI I do not need.
I only need and off and a few (ex. 25, 50, 100%) on states. That’s all.
Hmmm the first filter was "more correct" but you have to take the 4k7 into account. So R7 would have to be more like 25k. But you can simplify the thing:
Ah I see. Is it one of those integrated things that need their own supply? Because those I think exist in several variants like open-drain, open-source (or pnp, npn) etc. that dictate how you have to interface them.
No objections so far but these few:
Clearance from components to copper areas looks way too low. (This makes it quite hard to tell what’s going on there.) Those from traces to copper look about right. You should check these values against the PCB manufacturer’s guidelines anyway before submitting.
There’s still a few copper islands that could be removed (e.g. under L1) , and conversely, a few pads could have more copper around them. (B- and L- on the FET side look funny)
And are you sure the LM3409 has a good GND connection? It looks kind of boxed in, and I don’t see any vias to the GND plane on the other side. Can’t hurt (for thermals too!)
edit: the ATTiny GND looks like it goes nowhere too…
Thank you. I have increased the clearance to 0.5mm between parts and traces to solid regions. I use easyeda to design and I also order the pcb from them. They offer : min. trace 3.5 mil min. space 3.5 mil Unfortunately I can’t remove islands separately in easyeda, I can remove all or keep all. Or I do not know how to do it. I think LM3409 and attiny GNDs are connected. B- and L- looks strange because I used separate GND for the high and low current side and this is the place where these grounds are joined.
Yup, I can’t find that either. Though personally, I’d remove them all and patch up where necessary. (i.e. a GND ring on each side, build up the areas I want with polygons)
OK I can see it now. But now you’ve isolated the FET side outer copper pour from GND entirely , you could easily use that and stitch it with a copious amount of vias to the other side. I also think you could put the central GND point opposite right under (or beside) the LM3409, use both planes (remember the 3409 needs heatsinking too), and you could save yourself a lot of convoluted routing. As long as you avoid thin loops it’s okay.
The way it is now, you have those 2 GND connections snaking around the board forever before they reach the node.
Most important issue last, didn’t spot this before, this need to be fixed first: your input caps belong before the sense resistors, you have them after. I wouldn’t take the chance that this works without regulation issues.
On the topic of resistors: there’s 21, 21.5 and 22 mOhm resistors so you could save some real estate there.
strange design
did you consider that the LM3409 also produces some heat?
it has for a reason the colling pad this should contain 4 vias and be thermally bounded to ground on bot sides and this ground should also be connected to drivers rim, you insulated it all the way around
I would put it way closer to the boards edge
also your board has no spring pad, usually this also helps with bypassed spring to absorb some heat from the driver
go with all resistors and the small “no power” caps to 0603 size
use a TO277B diode to save some space
do not insulate battery ground from diver edge ground!
you also have your inductor and switching MOSFET on pretty few copper, no viases to get some heat moved to the other side
same with the reverse diode, for god sake connect that ground there to driver rim for heat sinking, especially with significant higher input voltage than LED there is a lot heat produced by this diode