3.1.4.1 System Voltage Measurement
The AVR-IoT Cellular Mini board has a system voltage measurement circuit using
the MIC94163 switch and a voltage divider connected to an ADC
pin on the AVR128DB48, enabling on demand measurement and preventing
leaking power through the voltage divider.
AVR128DB48 Pin | Function |
---|---|
PE0 | ADC0 (AIN8) - System voltage measurement |
PB3 | GPIO - System voltage measurement enable |
The system voltage is available as an input on PE0 and is divided by four. To measure the
system voltage, follow these steps:
- Configure the voltage reference for the ADC.
- Set PB3 high to enable the voltage divider.
- Set PE0 as input for the ADC.
- Run a single-ended ADC conversion.
- Calculate the voltage using the
following equation:
Tip: For power conservation,
disable PE0, PB3 and the ADC after the measurement.