Read voltage from analog input pin
The BeagleBone® Black board has six analog input pins. Each analog input pin has a
12-bit ADC that converts the analog input voltage to a digital voltage reading. The
ADC-driver built into the Linux® kernel returns the voltage measurement converted to a double. The
values range from
0 V (
1.8 V (
Never connect a voltage greater than
1.8 Vacross the ADC pins. Voltages greater than
1.8 Vcan damage the board.
Always connect the negative (ground) side of a voltage source to
GND_ADC. The ADC measures positive voltages only. A reversed connection can damage the board.
Read Voltage at Pin
Read voltage at pin
bbb = beaglebone(); readVoltage(bbb, 'AIN0')
ans = 1.64
pin_name — Name for analog input
Name character vector.
voltage — Voltage at analog pin, in volts
Voltage at analog GPIO pin, in volts
Introduced in R2015a