0
0
Iot-protocolsHow-ToBeginner · 4 min read

How to Check Raspberry Pi Power Supply Status and Voltage

To check your Raspberry Pi power supply, use the vcgencmd get_throttled command to detect power issues and vcgencmd measure_volts to read the voltage. These commands help identify if your Pi is underpowered or throttled due to insufficient power.
📐

Syntax

Use the following commands in the Raspberry Pi terminal to check power supply status:

  • vcgencmd get_throttled: Returns a hex code showing power and temperature throttling status.
  • vcgencmd measure_volts: Shows the current voltage of the power supply.

These commands help you understand if your Pi is receiving enough power or if it has been throttled due to low voltage.

bash
vcgencmd get_throttled
vcgencmd measure_volts
💻

Example

This example shows how to check if your Raspberry Pi has experienced power issues and what voltage it is currently receiving.

python
import subprocess

def check_power_status():
    throttled = subprocess.run(['vcgencmd', 'get_throttled'], capture_output=True, text=True)
    volts = subprocess.run(['vcgencmd', 'measure_volts'], capture_output=True, text=True)
    return throttled.stdout.strip(), volts.stdout.strip()

status, voltage = check_power_status()
print(f"Power Status: {status}")
print(f"Voltage: {voltage}")
Output
Power Status: throttled=0x0 Voltage: volt=5.1000V
⚠️

Common Pitfalls

Common mistakes when checking Raspberry Pi power supply include:

  • Ignoring the get_throttled output format, which is a hex code where bits indicate different issues.
  • Assuming voltage above 5V is always good; voltage below 4.65V can cause instability.
  • Not checking the power cable and adapter quality, which can cause voltage drops.
  • Running commands without proper permissions or on unsupported Raspberry Pi OS versions.

Always interpret the get_throttled output carefully to understand power problems.

bash
## Wrong way: Ignoring throttled bits
# Output: throttled=0x50000
# This means under-voltage and throttling occurred

## Right way: Check bits in output
# Bit 0: Under-voltage detected
# Bit 1: Frequency capped
# Bit 2: Throttling occurred
# Bit 16: Under-voltage has occurred
# Bit 17: Frequency capping has occurred
# Bit 18: Throttling has occurred
📊

Quick Reference

Here is a quick guide to interpreting vcgencmd get_throttled output bits:

BitMeaningDescription
0Under-voltage detectedPower supply voltage dropped below safe level now
1Frequency cappedCPU frequency limited due to power issues now
2Throttling occurredCPU throttled due to power or temperature now
16Under-voltage occurredUnder-voltage happened since last reboot
17Frequency capped occurredFrequency capping happened since last reboot
18Throttling occurredThrottling happened since last reboot

Key Takeaways

Use vcgencmd get_throttled to detect power supply issues on Raspberry Pi.
Check voltage with vcgencmd measure_volts to ensure stable power above 4.65V.
Interpret the hex code bits from get_throttled to understand specific power problems.
Use good quality power adapters and cables to avoid voltage drops and instability.
Run these commands in the terminal or via scripts with proper permissions.