On the solar system I'm working for plants irrigation I would like to measure the Voltage to have an approximation idea about how much battery is left so I can decide if it would better to postpone irrigation to next day.
This is the idea I have in mind (controlling ground / open circuit with Transistor IRLZ44N):
However I realize when the Gate of the transistor is off (0V from Esp32 GPIO) the voltage divider is sohwing 23.6V (solar panel MPPT LOAD), however the voltmeter (Other Esp32 GPIO) is showing 40.6 mV.
I'm concerned about the high voltage as I know the tolerance range on ESP32 GPIO pin out is on the range 0-3.3V afaik.
My question is if it is safe for ESP32 doing like this or do you know if is there a better way?
When the mosfet is off, the curcuit is open, so the idea is when the esp32 is in sleep mode all sensor ara disconnected and not spend energy, the first thing after wake up is turn on the pin which handle mosfet gate and give ground to all sensors (relay, bme280, hx711, etc)
The battery is a built in BMS 3S 18650 (Max ~13v) but I'm still not sure if I take measurements on the BMS or the MPPT which is connected to 50W solar panel (Max 18V?), tha is the reason I'm supposing the divisor should be able to divide at less 24V to have a margin and prevent ESP22 gpio is above 3V
If you want to know the battery voltage , I would imagine that you would want to measure the output of the BMS but you need to make sure the battery is not being charged.
A simple divide by 4 voltage divider with a 3.3V 2% zener diode for protection
Determining battery life depends on the battery chemistry. For lead-acid and similar types, you can estimate it using voltage. However, for lithium batteries, which have a very flat discharge curve, voltage is not a good indicator of remaining capacity. In that case, you’ll need a coulomb counter.
Falstad shows 23.954V when the circuito is open, does someone can tell me if this is an error on simulation or it would happen in real life? As far as I know when the transistor is off the circuit should be oppen and the voltmeter should read 0V, doesn't work like this?:
Ok, it seems there was something I don't know about open circuits, so I changed my approach and decided to read the voltage on the source, but now the problem is the voltage drops under expected results should be 2.181V but is dropping until 1.392, I guess the Transistor has some voltage drops. Does someone knows how can I solve this to read the expected voltage?
I can guess the function of capacitor is to limit the current reducing the consumption, or?
However what is the mission of the schottky diode on the circuit? to protect Esp32 shouldn't it be connected to ESP direclty instead of 3.3V source?