Measuring power usage

Note! This only works on the early BeagleBone demo images, where the TPS device wasn't in use by the new cpufreq and tps drivers.

In a battery-operated environment, it is very useful to be able to measure the power usage of the BeagleBone. You can do that by reading the voltage drop across the 0.1 ohm resistor that sits between SYS_5V and SYS_VOLT, and it can be done in code by routing those voltages to the onboard ADC on the BeagleBone, and reading the values from there.


1. setting the TPS for SYS_VOLT: 
root@beaglebone:~# i2cset -y 1 0x24 9 5 
root@beaglebone:~# cat /sys/devices/platform/tsc/ain8; echo "" 
1557 

1557/4096 * 1.8 = 0.684V 
Scaling this by 7.08 (2x for the voltage divider at the output of the 
TPS, and 3.54 for R1/R1+R2) 
SYS_VOLT=4.87 

2. setting the TPS for SYS_5V: 
root@beaglebone:~# i2cset -y 1 0x24 9 2 
root@beaglebone:~# cat /sys/devices/platform/tsc/ain8; echo "" 
1858 

1858/4096 * 1.8V = 0.82V 
Scaling this by 6 (2x for the voltage divider at the output of the 
TPS, and 3x for internal divider) 
SYS_5V=4.90 

3. The voltage difference across the 0.1ohm resistor (R3) is 0.03V, so 
the current is 0.3A or 300mA. 


Power usage in Watts is P = V * A = 4.90 V * 0.3 A = .47 W



TPS reference:


TPS chip is at base address 0x24.

The MUX register is at sub-address 9:
  • 9:MUXCTRL, Protection: None, Analog Multiplexer control register

The values are (three lower bits):
Analog multiplexer selection
  • 000 – MUX is disabled, output is HiZ
  • 001 – VBAT
  • 010 – VSYS
  • 011 – VTS
  • 100 – VICHARGE
  • 101 – MUX_IN (external input)
  • 110 – MUX is disabled, output is HiZ
  • 111 – MUX is disabled, output is HiZ

(some parts copied from here: https://groups.google.com/forum/#!msg/beagleboard/cFBUxgsrZYA/sZ3FIQgDysMJ)

Comments