Electronic – Beaglebone Black Power Switch Detection

battery-operatedbeaglebone blackpowervoltage measurement

I've looked around and found a bit of information regarding attaching a 3.7V lithium battery to the BBB (Beaglebone Black) but I haven't found an exact answer to what I am looking for. I understand that the battery voltage, when connected, can't be monitored to determine how much life is left that's fine. However, I would like to be able to tell when the system switches from 5V barrel jack connector to the 3.7V battery backup.

I want to implement some emergency shutdown features on my system in the event that communications and/or power are lost. I was going to trigger this based on when the Beaglebone switched over to battery, with some timer giving the main power time to come back online, but I can't find information on how to determine when the system makes the switch. Is there an I/O pin or an internal reading that I can check to determine when the BBB switched to battery power?

If I can't check it internally does anyone know what pin I could tap for a voltage divider into the ADC to measure this? My guess would be VDD_5V (P9-5) as the system would no longer be able to attain 5V and would dip to whatever the battery voltage is.

Best Answer

Your approach of monitoring the VDD_5V going into the AC pin of the PMIC seems OK. There is also the possibility of reading the PMIC Interrupt registers or Status register. Checkout chapter 9.6.4 and forward of the PMIC TPS65217 on TIs website LINK. According to the description in table 3 and table 11 the AC pin power level should be possible to readout. See the Status register description here:

enter image description here

If you need the system to shut down really fast, you probably want to utilize the interrupt register.