I have a unattended raspberry with a power supply for many device. Raspberry has lately restarts and I think that may be caused by a under voltage. Is it possible to check the input voltage for software? I've seen some projects but used hardware and for me is difficult access to raspberry. If xmbc or osmc shown the rainbow square with detect under voltage, I think that hardware modification is not necesary. How xbmc does to detect under voltage?

Thanks in advance


This answer is correct for Pi models available at the time. The Pi3 and Pi3B+ (and probably Pi Zero W) DO NOT use pin35 to indicate power.

As @joan stated GPIO 35 is connected to the power. This is all with 40 pin header (except Zero - which doesn't actually have a header or AFAIK a power monitor).

pin@p35 { function = "input";  termination = "no_pulling"; polarity = "active_low"; }; // Power low
  • Thanks @Milliways. I've added this line into config.txt file and reboot it, but I still reading a 0 value in pin 35 and I'm testing configuring this pin to OUT and IN but always got same result, a 0 value (under voltage) – crossmax Jan 14 '16 at 10:27
  • This was not intended to be included. It is already in the dt-blob.dts (which is loaded by default by the kernel). I had included this as documentation of the normal setting. It may be possible to change the settings of the pin, but not recommended. This pin is connected to the chip that monitors the supply voltage and the red power LED. It is late at night here and my brain is weary, but voltage should be high if the power LED is lit but "active_low" should give a 0 reading. – Milliways Jan 14 '16 at 12:11

On Pis with the 40 pin expansion header GPIO 35 is connected to a 5V supply monitoring system (it is also the GPIO used to control the power LED on the boards with a power LED fitted).

It will read high (1) if the supply is greater than 4.65V and low (0) otherwise.

See rasberrypi.org forum post.

  • 1
    @agold Edited answer. – joan Jan 14 '16 at 9:45
  • 1
    @crossmax You should not change the GPIO mode. You should just read the level. If you set it up an an OUTPUT you are setting the level yourself. On my Pis the GPIO 35 mode is INPUT. – joan Jan 14 '16 at 10:44
  • 1
    Download and install my pigpio library. After installation type sudo pigpiod then type pigs r 35. – joan Jan 14 '16 at 11:47
  • 1
    I can't explain that, I suppose you may have confused the "system" with your earlier experiments. pigpio bypasses the "system". Have you rebooted? – joan Jan 14 '16 at 13:05
  • 1
    Sadly this is not supported on Rpi 3 any more -- see github.com/raspberrypi/linux/issues/1332 – ndemou Jun 16 '16 at 15:07

In raspberry pi

vcgencmd measure_volts core

It shows the voltage attached to the core of your Raspi. If the source it is not enoght it will make the system fail.

There's more documentation about it in http://elinux.org/RPI_vcgencmd_usage.

If you cannot use vcgencmd I have written some notes about making it work. Have been the whole morning trying to set mine fine because it was not avalible in my last installation

  • 1
    The core voltage is derived from a voltage regulator and won't tell you a great deal about the 5V supply. I reckon the Pi would have reset before you could detect a significant difference. – joan Jan 14 '16 at 11:50
  • Sorry for my confusion, but in overclocking voltage keeps on same value all the time? – Jesus Cepeda Jan 14 '16 at 11:57
  • I just ran this on a Pi Zero and got 1.3500V how does this relate to the 5V input voltage? – Steve Robillard Jan 14 '16 at 12:00
  • 1
    The voltage assigned to the core of the CPU is not the same as the 5V from the income. Processor has its own voltage, and it has to be stable – Jesus Cepeda May 24 '17 at 20:08

having a good power supply is critical to top performance. As in my case, a lot of the time the problem is with the power supply cable (USB to Micro USB). I was getting the low voltage warning and my Pi was only running at 600 MHZ. I moved the cable from the power supply and plugged it into a USB port on my computer and got the same results. This told me that my problem was more than likely the cable. I changed the cable and my low voltage warning went away and my Pi ran at 1200 MHZ. Problem solved!

  • 2
    Hello! Your post has collected two user flags so far and while I do not agree with the flag reason ("not an answer") it is noteworthy that your answer does not address the question at all. So I would not wonder if it collects some downvotes as users might consider it "not useful" at least with respect to this question. – Ghanima Nov 19 '17 at 5:01
  • 1
    The original poster suspects a problem with undervoltage and is looking for a way of trying to measure it software wise to confirm. my thoughts were that at times it may be difficult to confirm a problem but if you eliminate it, that may be just as good. As such, I posted based on my experience with power supply issues and my solution. – Marpy Nov 20 '17 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.