Basically to hold the state a little longer in case the MCU pin take a little longer to settle.
I get how the capacitor value would do that, and that makes sense.
I raise POWER_HOLD_PIN in the first line of setup() and it's never had an issue, but I could see that being a solid improvement. What value would you recommend?
Also how does raising R3 help in that matter?
My workshop is a bit messy but it works too. Looks good
It would ... right.
It would allow the cap to discharge a little slower. Also help the cap charge up a little bit better.
What value?
Well, for the cap I would pick an electrolytic cap (of basically whatever value I have; I dont own a warehouse). Which typically means a 5uF to 20uF. a 1uF seems too small, and a 50uF/100uF seems a bit overkill, but perhaps I am wrong.
Resistor would be basically between 20k-50k.
How does the output turn off, however. Is the MOSFET a toggle?
Fantastic, now both make sense. Thank you.
I'll kerjigger it a bit and test it some more.
Good revision recommendation.
Same idea, the button is connected to the battery directly, and battery has protection circuit so 3.2V maybe is the lowest and then it wonât switch on
Not bad. I've been taught to try to avoid hot buttons.
PA7 is your power hold pin?
PB0 is, PA7 is input, allows to detect button press when system is on, but I think I moved it to esp32 in the end to handle all holds and inputs. it was a process
Nice, so you have the same features.
I like that the MCU can turn off the PSU on its own and still detect the button press, which could be retasked after startup.
I typically use long-press to turn off the system. It also gives time for a shutdown and save sequence.
Wouldnât you just need to hold the button for 0.11 seconds longer for system to power up if you donât change values? Whatâs the worst that could happen, the hold pin wouldnât be initialised so it would power down when you release? but then we are talking about super momentary action from super fast person
same
0.11 is not bad, but I do see the point. When I poll buttons, I aim for a 0.05 capture. Little more than doubling R3 should help with that, I think.
Not the real value though, was just making a point
Now I'm itching to calculate it or test it with my tiny scope.
555 delay off relay.....few cents each on internet shops.
Ok....
So this is the circuit I should use?
And is this power hungry? I want it as low-powered as possible whenever it isn't on the charger.
Where does it test for the battery being charged? My original circuit has two small leds - one shows charging, one shows charged. But these will be hidden inside a case, so I want my OLED screen to show the status instead. This is the LED setup:
@bluejets How power hungry is a relay?!?
I have to look closer to be sure about the circuit, but the itty bitty current might drain a battery in 70 years or so.
Perfect!
Some of the users with more experience will have to review this for you. I wouldn't build it until others have weighed in on it.