jwatte
Posts: 203
Joined: Sat Aug 13, 2011 7:28 pm

GPIO output is only 1.6V?

Wed Mar 05, 2014 3:41 am

I am using a Rev B Pi to run XBMC, using the raspbmc install. This part works okay.
I am feeding it 5V through pin 2 (and ground through pin 6) rather than powering through USB-in. This comes from a 1.5V switching regulator that happens to be available on an extension board I've built to control some external things, which in turn is driven from a silent 12V linear power supply I also built. (Funny story, I started with off-the-shelf parts, and they all made coil or capacitor noise, and one thing led to another ...)

Now, I am trying to drive a small N-channel MOSFET (a BS-170) through the GPIO pins to control an external relay.
Unfortunately, the GPIO signal output from the Pi is too weak to turn it on.
I have tried both pin 7 and pin 12; I can measure an output voltage of about 1.6V when they are "high" and 0V when they are "low" using my multimeter.
If it was just one pin, I'd believe that I blew a pin through accidentally shorting something when not paying attention, but as it happens to two different and somewhat distant pins, I'm wondering whether something else is going on.

Here's how I turn on a pin:
1) make sure my user ("pi") is in the "gpio" group so I have write permission.
2) echo "7" (or "12") into /sys/class/gpio/export
3) echo "out" into /sys/class/gpio/gpio7/direction (or gpio12)
4) echo "1" into /sys/class/gpio/gpio7/value

Am I doing something wrong here?
Literally, this script should turn it on, right?

Code: Select all

#!/bin/bash
echo 7 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio7/direction
echo 1 > /sys/class/gpio/gpio7/value

jwatte
Posts: 203
Joined: Sat Aug 13, 2011 7:28 pm

Re: GPIO output is only 1.6V?

Wed Mar 05, 2014 3:44 am

Aaaand the solution is that the GPIO number should be the Broadcom GPIO signal number, not the RPI header pin number.
So, if I use GPIO4, and measure on pin 7, all is well. And why I saw a difference at all when using another pin, I have no idea. Sensitive instruments and leakage voltage?

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: GPIO output is only 1.6V?

Wed Mar 05, 2014 3:53 am

jwatte wrote:Aaaand the solution is that the GPIO number should be the Broadcom GPIO signal number, not the RPI header pin number.
So, if I use GPIO4, and measure on pin 7, all is well. And why I saw a difference at all when using another pin, I have no idea. Sensitive instruments and leakage voltage?
If you were measuring a floating input pin the voltage could have been anything.

Anyway, root cause established and fixed. Well done.

Return to “Troubleshooting”