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.

16
votes
5answers
4k views

Do I need to use a ribbon cable for GPIO?

I haven't gotten my R-Pi yet, otherwise I would've just tried it, but do I need a ribbon cable to use GPIO or can I just connect a bunch of wires from the pins to a solder-less breadboard?
6
votes
1answer
2k views

Can I connect a buzzer to gpio without a transistor?

I have a buzzer with an internal resistance of 16.5 Ohms, which I have used with an Arduino and it worked fine, so I assume it is 5V. Can I connect a buzzer to the GPIO pins without a transistor, or ...
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 ...
4
votes
2answers
1k views

Outb in C to access GPIO

I have a basic understanding of the GPIO on the RPi. I want to adapt some of my previous software which interfaced my project board via the Parallel port via direct output to the PP address (0x378) ...
13
votes
2answers
9k views

What are the different clock sources for the general-purpose clocks?

I'm trying to generate a clean 11.289 MHz clock signal from the general-purpose clock, GPCLK0 on GPIO4. The suggested route is to use the 19.2 MHz crystal as the source, which seems to work ...
5
votes
2answers
9k views

Where is the GPIO header file (“linux/gpio.h”)?

I've been reading about the linux GPIO functions and tried to make a small example using the function gpio_is_valid, but the compile fails because it can't find linux/gpio.h. #include <iostream>...
7
votes
1answer
5k views

How do I bit bang I²C master?

I've installed RPi.GPIO. It doesn't support I²C yet, but can I use it to bit bang I²C? I would just need the Raspberry Pi to be the master.
7
votes
3answers
3k views

What is the nominal GPIO Pin Output current?

What is the RPi GPIO Pin output current? I assume it's more than 10mA since it can drive LEDs without any problem but what is the spec?
13
votes
5answers
15k views

Can I use a DHT22 as a temperature sensor for my Pi?

Is it possible to use a cheap temperature sensor such as the DHT-22 with the Raspberry Pi? I have found Arduino drivers for this and many similar things, and would be comfortable porting the code to ...
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.
22
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 ...
14
votes
2answers
12k views

What advantage does the Pi-Face addon board bring to the Raspberry Pi?

I have come across the Pi-Face addon board and am wondering what additional capabilities this unlocks for the Raspberry Pi. From the website: The 'added value' we want to provide is the hardware ...
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?
20
votes
4answers
29k 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 ...
19
votes
4answers
17k views

How can I control Lego motors?

I'd like to find a way to make my Raspberry Pi control some Lego motors, and as a bonus I'd like to make use of one or more optical sensors. Normally, Lego robotics make use of the Mindstorms "brick" ...
7
votes
3answers
4k views

Are there any expansion boards available for the GPIO?

Are there any expansion boards available for the Raspberry Pi for use with the GPIO?
11
votes
5answers
13k views

GPIO-UART-to-Arduino communication

I have been trying with no luck to get the Raspberry Pi talking to an Arduino. I am using a 3.3 V-to-5 V converter to swap voltages. I did put an LED on the UART TX pin, and it looks like it ...
24
votes
6answers
15k views

Can I use PATA cables for GPIO?

Raspberry's GPIO connector looks very similar to the old Parallel-ATA connectors. I do have several spare floppy/hdd PATA ribbon cables. Can I use these cables for GPIO? I know that GPIO has 26 pins, ...
12
votes
4answers
2k views

Is it possible to control a SRAM module via the GPIO pins?

I would like to attach a SRAM module to the RasPi. My idea is to store sensitive (encrypted) data on the SD card but keep the key on a SRAM module. It would have its own backup battery (or ...
9
votes
1answer
1k views

Is it possible to communicate with i2c devices via the GPIO? [duplicate]

Is it possible to communicate with i2c devices via the GPIO? Also, are there any existing drivers or libraries that make this possible from Python?
96
votes
5answers
210k 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?
10
votes
4answers
2k views

Is it possible to use the GPIO to program a PIC?

I'm referring to the PIC microcontrollers, specifically the 16f and 18f series - could the GPIO be used in this way? If so, how?
25
votes
9answers
25k views

How can I control an RC servo?

I'd like to control a small RC servo (5 V, 500 mA) from the GPIO pins via Python. Hardware What are the required electrical connections? Can I connect multiple servos to the Raspberry Pi?...
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 ...