OLIMEX / ESP32-POE

ESP32 IoT development board with 100Mb Ethernet and 802.3 Power Over Ethernet (POE)
Apache License 2.0
292 stars 110 forks source link

External power sense exceeds analogue voltage max #42

Closed CZEMacLeod closed 11 months ago

CZEMacLeod commented 11 months ago

Looking at R4/R9 voltage divider taking the +5V nominal supply voltage (which might be slightly over depending on the power source), it would appear that the input voltage on GPI39 would be 3.4V. While this might not technically damage the chip (I believe the IO pins are rated up to 3.6V) this still means that we can't see full scale voltages and any potential brown out on the 5V rail.

The battery has R22/R17 of 470k/470k for a ~4.2V max input giving ~2.1V or 63% of full scale. This actually seems kind of low, unless the charge voltage is significantly higher... Perhaps 330k/470k might be a better choice. This would give ~2.5V at full charge and be 75% of full-scale giving a slightly better resolution. This would also be a good choice for the R4/R9 pair to give ~2.94V for a 5V input at 89% full-scale.

I don't know if there are any other reasons behind these choices, but it feels like this is a mistake.

DanKoloff commented 11 months ago

We reviewed your input and we can't find mistakes here.

R4/R9 is for detection presence of external power supply via digital input, not to measure it.

R22/R17 is always connected to the battery and should be higher impedance so the battery won't discharge via it. You have enough scale to measure it.

CZEMacLeod commented 11 months ago

@DanKoloff R4/R9 can still apply a voltage of 3.4V to a 3.3V input using 47k/100k assuming 5V is 5V. Is the drop across D1 or FET1 sufficient to prevent this? What happens if 5V is fed in externally through EXT1?

DanKoloff commented 11 months ago

No problem to provide 5V on EXT1 as long as you don't have USB attached at the same time. 3.4V is not a problem for the ESP32.

Edit: it is user's responsibility to ensure the 5V on EXT1 are exactly 5V (probably regulated and protected) and that no USB is present at the same time.