Read 3.3 volts via analog read pin???

robedney

Active member
My project uses the Teensy 4.0 and an OLED display, powered by a lithium battery (5v). I want to add a low battery warning to flash on the display. This may be a truly stupid question (I'm learning as I go here), but can I feed the from the 3.3v pin on the Teensy to one of the analog read pins? If so, I could read that voltage and experimentally determine when whatever the cutoff voltage for the Teensy regulator is getting close and flash a warning on the OLED. Is this a truly bad idea???
 
No because the 3.3V is the analog reference as well, so it will always read full-scale. You need a voltage divider from the battery and measure that with the analog input.

BTW I've not seen a 5V lithium battery, do you mean a power bank? If so its voltage won't drop until its exhausted anyway as its internally regulated.
 
Back
Top