Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [gpio]

GPIO stands for General Purpose Input Output and can be used to receive and send digital signals to and from simple electronics from the Raspberry Pi.

101
votes
9answers
251k views

How do I supply power through the GPIO?

I have seen some examples of people powering their Raspberry Pis by wiring a DC "barrel plug" style power supply to the 5V and GND GPIO pins. What considerations should be taken when doing something ...
59
votes
5answers
116k views

What is the maximum current the GPIO pins can output?

What is the maximum amount of current that can be pulled from a single GPIO pin? Does the maximum current decrease if current is being pulled from multiple GPIO pins? From my research, I've found: ...
17
votes
2answers
27k views

Power a 5V relay from GPIO pins

I have a bank of relays (5) that I'm looking to run from my Pi. I'm using 5V TE Connectivity relays, powered by Sparkfun's high power relay kits, which use a NPN transistor to trigger the relay. So ...
1
vote
1answer
5k views

What are the Electrical Specifications of GPIO pins?

What are the Electrical Specifications of GPIO pins; current limits and voltage levels?
4
votes
1answer
3k views

How to use Arduino devices with Raspberry Pi?

I bought "RFID RC522" & "GY-NEO6MV2", and I need a useful guide for both of them in order to use them with Raspberry Pi 3 Model B. I also want to know if there is a guide or a course for using ...
94
votes
5answers
207k views

Can I use the GPIO for pulse width modulation (PWM)?

Can I use the GPIO as a pulse-width modulation output? If so, how would I go about doing it and how many concurrent, distinct PWM outputs can I have?
31
votes
6answers
57k views

Access GPIO pins without root. No access to /dev/mem. Try running as root!

I've made a python script using the RPi.GPIO library. I need to run it without root but I get this error when running it with "python ./script.py": No access to /dev/mem. Try running as root! I've ...
30
votes
1answer
91k views

What are the min/max voltage/current values the gpio pins can handle?

I want to start using the GPIO pins but I am worried about short circuits or using too much amperage and frying my raspi. What are the Min/Max Voltage and Current values rasppi can handle? What is the ...
6
votes
1answer
2k views

GPIO callbacks in any language

I know the linux kernel has a language agnostic GPIO interface through /sys/class/gpio which can be manipulated with echo, cat, etc. How can this be used to create event driven callbacks ...
24
votes
3answers
51k views

Can I get audio input through the GPIO

The Pi has a standard 3.5mm audio jack, but this cannot be used for audio input However, we've got a load of GPIO pins on various interfaces. Would it be possible to recieve analog audio into the Pi ...
20
votes
3answers
61k views

Control Hardware PWM frequency

I'm using the hardware PWM output with wiringpi. It provides the function pwmSetClock that should make it possible to change the frequency. (https://projects.drogon.net/raspberry-pi/wiringpi/functions/...
11
votes
2answers
29k views

Controlling many LEDs with few GPIO pins

I successfully completed my hardware "hello world" using this guide: http://www.raspberrypi-spy.co.uk/2012/06/control-led-using-gpio-output-pin/ Now I'd like to move on to bigger and brighter things,...
17
votes
3answers
22k views

Why are some GPIO pins HIGH when the Raspberry Pi boots up?

I have an easy circuit wired up, with an LED connected to pin 18 on the BOARD reference. I run a simple program to put pin 18 to HIGH, which turns the LED on, and then a couple of seconds later, I set ...
10
votes
1answer
9k views

Raspberry pi GPIO input pins give random values

I've been playing a lot with the Raspberry Pi lately. But I have a problem. When I set up an input pin to check whether electricity is sent to it or not, it gives me rather unstable answers. A few ...
22
votes
2answers
15k views

How can I control a 12V motor? [duplicate]

I would like to control (switch) some 12V DC motors using the GPIO pins. I do not have (or want to use) an expansion board. Nevertheless, I think this should be possible using a transistor switch (and ...
118
votes
1answer
286k views

What is the difference between BOARD and BCM for GPIO pin numbering?

When using the RPi.GPIO library in Python you have to call import RPi.GPIO as GPIO and then GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM) What is the difference between these two options?
14
votes
4answers
14k views

How can I use more GPIO ports on the Raspberry Pi?

I am currently planning a project for a course at school which involves using the Raspberry Pi - however I'm worried that I will not have enough GPIO connectors for the inputs and outputs that I will ...
5
votes
1answer
3k views

Do I need a current limiting resistor in series with a magnetic door sensor?

I'm building an alarm system and I'm using a magnetic door sensor, conected to ground and a pin of the gpio set up with an internal pull-up resistor. As far as I know, this means that the pin will be ...
6
votes
4answers
6k views

How can I control the red LED again

I just acquired the latest Pi-3. In the Pi B+ and Pi 2 it was possible to access both the red and green LED through /sys/class/leds/led0 and /sys/class/leds/led1. After setting up the Pi 3, I have ...
44
votes
6answers
23k views

How to measure temperature?

What can I connect to the RPi to measure temperature? I think devices connected to the I²C or SPI would make most sense. Here is a question about DHT-22 and other 1-wire devices. But at this stage it ...
28
votes
4answers
34k views

How can I use I2C to talk to sensors?

How can I talk to digital sensors over the I²C interface? Hardware: Which pins on the Raspberry Pi's GPIO can I use? Software: What I²C libraries are available?
34
votes
2answers
20k views

What is the power on state of the GPIOs?

What is the state of the GPIOs when power is applied? eg High, Low, Hi-Z? Also does any OS change the state of any GPIOs when it loads? Hopefully not.
28
votes
2answers
30k views

Why is a resistor needed for LEDs?

While looking for a basic task to get familiar with the Raspberry Pi and its GPIO pins, I decided that driving an LED sounded simple enough. While investigating how to go about this task I've noticed ...
9
votes
1answer
13k views

PiGPIO Library Example for Bit-Banging a UART

The PiGPIO library http://abyz.me.uk/rpi/pigpio/index.html mentions that one of it's features is "software serial links using any user gpio". I take this to mean that you can use it to generate a ...
15
votes
2answers
6k views

Pi as a USB client

I am looking for a way to have the Pi act as a USB client and masquerade as a flash drive. I have seen lots of suggestions, however most of them are old (1+ years) by now and vague/incomplete - I ...
13
votes
3answers
9k views

Maximum current on each GPIO pin for Raspberry Pi 3 Model B

Anyone knows what's the maximum input/output current for the individual GPIO pins? Perfectly fine if someone is able to point me to the Broadcom BCM2837 datasheet, which I for some reason, cannot ...
10
votes
5answers
13k views

How can I wire this SD card reader to RaspberryPi?

I need to add a second SD card reader to my Raspberry Pi for the project www.samplerbox.org (the RPi will be embedded in a box, so I need a user-SD-card reader). Here is what I would like to use: ...
11
votes
2answers
20k views

How to output audio signals through GPIO?

Is there any way to output audio signals through GPIO and is there any disadvantage with this way?
1
vote
1answer
899 views

I2S Recording combined with I2S Playback

I have a Raspberry Pi Zero and I am using the Adafruit I2S MEMS Microphone together with the ADAFRUIT I2S 3W CLASS D AMPLIFIER BREAKOUT - MAX98357A. I did follow the two respective tutorials and I ...
33
votes
1answer
59k views

Pros and Cons of a Pi Cluster?

I have seen a lot of posts asking how to build a "supercomputer" or cluster with Raspberry Pis, but I have found very little with the pros and cons of actually making a network of Pis. I am interested ...
29
votes
5answers
28k views

Circuit to safely power-down Pi

I want to use my Pi as an XBMC server in the car. The XBMC docs say that you should always use the shutdown command before disconnecting the power. I've been thinking that it should be possible to ...
29
votes
7answers
2k views

Libraries for interfacing with the GPIO

What libraries are available for interfacing with the GPIO?
25
votes
2answers
8k views

How can I use the GPIO pins as digital outputs?

I've read that the Raspberry Pi has a number of input and output pins. How can I switch them? (from Python?) What voltage logic? Do I need pull-up or pull-down resistors? Do I need to switch the pins ...
18
votes
9answers
33k views

Use Raspberry Pi to control PC's power switch

Can I use the Raspberry Pi's GPIO pins to make the Raspberry Pi act as a switch? I would like to shut down, boot up and reboot my computer via hardware remotely. My idea was to take the PS_ON# pin ...
15
votes
4answers
59k views

Receive FM Radio on Raspberry Pi

I want to feed the FM radio signals to raspberry pi. Having a basic understanding of electronics, I figured out that a FM receiver and an ADC is required. Now I need help on how to proceed with the ...
20
votes
4answers
28k views

What SPI frequencies does Raspberry Pi support?

What SPI frequencies does Raspberry Pi support? Additionally: Are they all supported by the bootc.net SPI driver? Are there any additinal things I should be cautious about when trying to ...
16
votes
6answers
40k views

Getting more than 26 GPIO pins

I would like to be able to output 75 digital out signals from the Raspberry Pi. However it has only 26 GPIO pins. Precise timing is not critical as long as it is within 1 second. I need to be able ...
9
votes
3answers
8k views

Creating halt/wake button?

I have rigged up a wake-from-halt button using pins 5 and 6. These two pins, when connected, will reset power and reboot from halt. I want to use this same button, if I can, to run a command that, ...
7
votes
3answers
8k views

RPi 2 and 3.95 TFT ili9488

I have bought a 3.95 inch TFTLCD for Raspberry Pi (ILI9488 from mcufriend) and I can't get it to work. I am just mildly experienced with Raspberry and Linux, but the way this type of screen was shown ...
22
votes
1answer
23k views

DS18B20 not listed in /sys/bus/w1/devices

I'm starting work on a fermentation monitor using the Adafruit temperature sensing tutorial, a RPi B+ running Raspbian, a 4.7 kOhm resistor and a DS18B20 to which I've soldered male breadboard pins. ...
10
votes
3answers
10k views

LIRC won't transmit (irsend: hardware does not support sending)

I’m trying to control an IR HVAC unit in my house with a Raspberry Pi 2 and an infrared shield (see here: http://bit.ly/29iC0lr). I followed the instructions on the IR shield product page with tips ...
10
votes
1answer
13k views

Does short-circuiting GPIO pins damage the Raspberry?

Does accidently connecting the wrong GPIO pins damage the Raspberry Pi or is there some protection like a fuse?
6
votes
3answers
10k views

How fast is GPIO+DMA? Multi I2S input

I want to connect multiple I2S ADCs to RaspberryPi and record multi-channel audio. I calculated that it requires copying GPIO input port to RAM at 3072kHz (or every 0.33µs). I want to do it using DMA. ...
2
votes
2answers
7k views

Raspberry Pi 3 model B “dtoverlay=gpio-shutdown”

To my /boot/config.txt on Raspberry Pi Model B I added: dtoverlay=gpio-shutdown,gpio_pin=3,active_low=1,gpio_pull=up Right now nothing happens when i shorten GPIO#3 with ground. What else needs to ...
1
vote
3answers
4k views

Power USB device over Raspberry Pi GPIO Pin

For an embedded system I need to be able to switch certain USB devices on a RPi on and off without physically disconnecting them. The whole setup will be in an enclosed casing. My idea now was to ...
12
votes
2answers
894 views

Should GPIO pins 13 and 14 be soldered together?

I just bought a new Model A+ board, and noticed that the GPIO pins 13 and 14 (board pins 21 and 23) are soldered together on the backside. This was not the case with my previous A+ board: see the two ...
10
votes
1answer
10k views

What are the ID EEPROM pins and what can they be used for?

I understand that it's a type of ROM, but is there more to it? How can it be used for?
5
votes
1answer
5k views

Is my Pi's GPIO damaged?

I am trying to test GPIO output on a Raspberry Pi, and I am wondering if it is broken. These setups work: 3v3 >> +LED terminal -LED terminal >> resistor >> GND (the LED is unusually dim here) 3v3 >>...
3
votes
2answers
2k views

Raspberry pi GPIO extension

I recently started using rasperry pi. I am trying to do some home automation and controlling toy car motors. I am able to control the motors and 2 plug points. I wanted to control more servo motors. ...
0
votes
1answer
4k views

Controlling a brushed motor ESC from the Raspberry Pi

I've tried solutions from similar problems, but none of them gave me any usable results. I'm trying to control those http://www.ebay.com/itm/311177661450 electronic speed controls (ESCs) with ...