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.

Filter by
Sorted by
Tagged with
102
votes
9answers
265k 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 ...
61
votes
5answers
124k 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: ...
21
votes
2answers
30k 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
6k 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 ...
97
votes
5answers
214k 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?
33
votes
6answers
65k 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 ...
35
votes
1answer
103k 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 ...
21
votes
3answers
67k 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/...
6
votes
1answer
3k 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
53k 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 ...
12
votes
2answers
30k 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,...
18
votes
3answers
24k 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 ...
12
votes
1answer
10k 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 ...
23
votes
2answers
16k 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 ...
130
votes
1answer
316k 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?
5
votes
1answer
4k 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
7k 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 ...
3
votes
2answers
154 views

Run the program in the laptop and use the raspberry gpios, PWM to control servos

I'm working with face tracking and I want to activate some servomotors depending the motion of my face. For facetracking I'm using, an usb cam, opencv and dlib. Now results the raspberry can't run my ...
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 ...
29
votes
5answers
29k 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
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?
35
votes
2answers
21k 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.
30
votes
2answers
32k 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 ...
11
votes
2answers
14k 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 ...
16
votes
2answers
7k 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 ...
11
votes
5answers
14k 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: ...
22
votes
1answer
24k 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. ...
12
votes
2answers
22k 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?
4
votes
2answers
11k 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
1answer
3k 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 ...
9
votes
1answer
12k 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?
2
votes
2answers
344 views

How to check if SPI is enabled and functional on Raspi 3b+?

I have run raspi-config and enabled SPI and also verified that /boot/config.txt contains the line: dtparam=spi=on However, when I run lsmod | grep spi I get the following: spidev ...
1
vote
2answers
131 views

Connecting 32 magnetic sensors

I would like to build an organ pedal board and use Raspberry Pi as signal processor. The pedal board will have 32 inputs, one for each key. I am planning to use magnetic sensors (like A3144), which, ...
33
votes
1answer
62k 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 ...
30
votes
8answers
3k views

Libraries for interfacing with the GPIO

What libraries are available for interfacing with the GPIO?
26
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 ...
20
votes
9answers
35k 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
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 ...
22
votes
4answers
31k 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
7answers
43k 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 ...
10
votes
3answers
9k 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, ...
8
votes
5answers
12k views

How can I turn an GPIO to its alternate function?

I want to use the altenate function of GPIO 4 namely the GPCLK0 function. How can one set a GPIO to its alternate function? Many alternate functions are summarized here: elinux-wiki The best would ...
6
votes
3answers
9k 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 ...
11
votes
3answers
12k 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 ...
8
votes
2answers
2k views

How to detect what kind of HAT or GPIO board is plugged in - if any?

I am setting up some Raspberry Pis for use in demos to colleagues, in order to show off capabilities of the Pi itself, and of some of the add-on boards that are available. I would really like to be ...
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
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 ...
-2
votes
2answers
6k views

UART interrupt in Raspberry PI with c or c++

I want use GSM module with raspberry pi i can send data bur for receiving data i want to use a interrupt function.pulling is valuable for me.
12
votes
2answers
913 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 ...