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