Questions tagged [rpi.gpio]

rpi.gpio refers to the package name of a Python module for accessing the Raspberry Pi's GPIO pins. The module allows GPIO pins to be initialised, turned on, and turned off. It uses a functional programming style.

Filter by
Sorted by
Tagged with
2
votes
2answers
366 views

Safe power supply through GPIO pins

I'm designing a HAT and need to supply power to PI zero W and PI 3B+ through the GPIO headers[2&4]. The supply would regulated at 5V 4A (Would be sharing the same power supply with a Thermal ...
0
votes
1answer
93 views

enable software i2c on raspberry pi gpio

I am trying to interface more than one sensor with Raspberry Pi Zero W, which communicate using i2c interface. So far I am able to connect sensor to dedicated i2c and read the data. Want to know ...
0
votes
0answers
151 views

GPIO number vs Pin number. Which to use?

I am writing a code for an ultrasonic distance sensor. The code worked fine when i used the gpio numbering system for the wires connecting to the gpios and sensor. As soon as i connected the sensor to ...
0
votes
1answer
65 views

How can I use the RPI3 to generate a sawtooth with frequency around 20kHz?

I am trying to generate a sawtooth waveform from the GPIO, the frequency is high, 20 Khz. is pigpio library my best option?
1
vote
1answer
424 views

Runtime Warning: This channel is already in use

I am writing a code for Ultrasonic distance sensor. I have wired all the things perfectly and written the code for it but somehow it gives a runtime error of the channel already being in use. Below is ...
0
votes
0answers
87 views

Multiple raspberry pi's 3 synchronized image navigation

We have 7 raspberry pi's 3, each connected to the internet and an display. On each screen / raspberry pi is geeqie (image viewer_ running with an image slideshow. The goal is to have all raspberry pi'...
0
votes
0answers
58 views

raspberry pi and ltc 2873 cufd (RS 232 and RS 485)

I have a raspberry pi compute module 3 on an I/O board in which gpio 12 is contolling the mode in ltc 2873. If it is ground it will be working in the RS 232 mode. so if I have to write something into ...
0
votes
1answer
59 views

Help needed with GPIO and a remote controlled gate relay switch

I am very confused and hoping someone can point me in the right direction. What I would like to achieve is converting an external relay switch (from a normal everyday gate receiver) into a signal ...
-1
votes
3answers
164 views

How can i Get 5 Volt output with GPIO

I am using Raspberry Pi 3 B+ and I want to run a 5 volt DC motor with RPi.GPIO, I have written a code: import RPi.GPIO as GPIO from pip._vendor.distlib.compat import raw_input u = raw_input('how ...
0
votes
0answers
89 views

Multiple GPIO.add_event_detect callbacks results in incorrect expected output

I am currently working with a differential drive robot which has two wheel encoders connected to GPIO Pins 5 and 23. I managed to obtain velocity information based on the pulse time information ...
0
votes
0answers
17 views

Frequencies available for wavechaining using PIGPIO library

I am working with the PIGPIO library to run stepper motors. I am using wavechains to the STEP pin of the driver. I need help regarding the possible pulse frequencies available for wavechaining. I ...
0
votes
1answer
46 views

Wiring on RPI3 when connecting two peripherals - microcontrollers simultaneously

I am currently having an ADC(MCP3008) connected to a rpi3, using the following wiring map, in order to read data from analog sensors. MCP3008 -> RPI3 VDD -> 3.3V VREF -> 3.3V ...
1
vote
0answers
133 views

Raspberry pi 3 - GPIO output stays at 1.8V

I've set-up a GPIO port to output. With an external multi-meter, I've noticed that the potential stays at 1.8V in respect to the ground. I've checked in respect with the same ground, and the 3V3 and ...
0
votes
4answers
489 views

How can I make my LED flashing while executing the rest of the code?

How can I make my LED flashing while executing the rest of the code? I want to make some LEDs flash while my program executes the rest of the code.
1
vote
0answers
898 views

Simple intercom with rPi

I saw someone had a question a couple of years ago about connecting his intercom (which used a phone line) to a rPi and none of the answers were realistic. I also would like to do some simple project ...
1
vote
2answers
210 views

Servo motors not working as expected with Raspberry pi 3

I am developing a robot with raspberry pi model b along with three servo motors. I have two functions which are defined for obtain robot behaviours. In the first function my servos are working well. ...
0
votes
3answers
63 views

Relay board failing when connected to RPi3 5V pins

I'm using my pi to power several relays. A total of ~20 relays (a 8-relay board and three 4-relay boards) I'm also running home-assistant Yesterday i noticed that when i try to power them all up, ...
1
vote
1answer
123 views

same GPIO input signal on multiple raspberri's from one source

Im having 7 raspberri pi's 3 connected to 7 screens, running an python 2.7 app to download different images from google drive, every raspberry has different images. Geeqie is displaying those images ...
1
vote
1answer
47 views

Make Raspberry Pi to work as AP and Station to receive wireless temperature sensor values

Hi after reading the manual of Xbee device, I am able to use XBee device with raspberry pi. But how to make raspberry pi to work as an access point as well as the station at the same time? using ...
2
votes
3answers
1k views

gpiozero Button.when_pressed

I'm learning python and gpio using the examples here: https://gpiozero.readthedocs.io/en/stable/recipes.html I wanted to extend the code to more than one button and pass a parameter to a function (...
1
vote
1answer
162 views

Controlling Raspberry pi3 Wirelessly with HTML (Lighttpd)

I've been working on a Obstacle avoidance robot using Ultrasonic and IR sensors. The scope of my project is to execute my program over the air. Control the robot's movement using mouse or touch ...
0
votes
2answers
28 views

Program not able to open file at start up but when running from command line, runs as expected

using a library from https://github.com/BLavery/LIBtft144 this line of code doesn't seem to run when I run the program from a systemd. I also tried calling it from a crontab call of my .py program. ...
0
votes
0answers
290 views

Python script wait for button press before starting/stopping a separate python script

I've written a python script (shown below) which starts and stops another separate python script (datalogger) once a button is pressed. The datalogger script records logic levels (0 or 1) and stores ...
0
votes
1answer
181 views

How can I attach a BTS7960 43A motor controller circuit and control it from a keyboard wirelessly through the Raspberry pi [closed]

I need to attach a BTS7960 43A motor control circuit to the Raspberry Pi. Could anyone please tell me the connections and provide me with a link to a python code to drive motors forward and reverse ...
0
votes
0answers
38 views

Python script (datalogger) produces different data when run from a separate script (button) to when it is run as itself [duplicate]

I've created a datalogger script that continuously records every rise and fall in a square wave signal (connected to pin 26 on a Pi 3B+) to a CSV file. The data recorded in the CSV is either a 0 or 1, ...
1
vote
1answer
194 views

Raspberry Pi 3 GPIO pins always active

Wiring setup for Rpi: I have an rpi 3, and I've recently started experimenting with the GPIO side of things. I'm new to electronics in general, although I do computer programming regularly. I have a ...
0
votes
1answer
107 views

How to add a fan if no gpio pins available

new to all this but great fun. I have a raspberry pi3 and i did have a fan connected to it. I just added a power supply battery. i also added a IR remote and power button which sits onto of the gpio ...
0
votes
1answer
3k views

How to start and stop python script using button

I've written some python code that should start and stop another python script (Datalogger) when a button is pressed. So when the Pi is booted up I'm wanting the button script to run and then once I ...
1
vote
0answers
162 views

How do I pause a python program and then wait if no signal is received to a GPIO pin?

I'm developing a datalogger using a Raspberry Pi 3B+. I have 2 separate square wave signals connected to two separate GPIO pins and some code to record and store the date and time of each transition ...
0
votes
2answers
112 views

Restore UART pins 8 & 10 after GPIO.cleanup() without reboot

A Raspberry Pi 3B+ is talking to an STM32 chip via UART over pins 8 (TXD) & 10 (RXD). When I take control of those pins using GPIO.setup(8, GPIO.OUTPUT); GPIO.output(8, GPIO.LOW); and later ...
2
votes
2answers
1k views

How to stop python script that was started with crontab reboot

I have a python script that continuously saves data to a CSV file and is started as soon as the Pi starts up using crontab reboot. Does anyone know how I stop the script from within the Raspberry Pi ...
0
votes
1answer
56 views

How do I stop CSV file being overwritten when rebooting Raspberry Pi 3B+

I have some code (shown below) which turns the Raspberry Pi into a datalogger. I use GPIO.add_event_detect to detect the date and time that a square wave signal changes state. This data is then saved ...
0
votes
1answer
1k views

RuntimeError: Failed to add edge detection. GPIO.BOTH Raspberry Pi datalogger

I am coding a datalogger using a Raspberry Pi and am starting to test my code but now keep getting an error saying 'RuntimeError: Failed to add edge detection'. Here is my code: import RPi.GPIO as ...
1
vote
1answer
153 views

Datalogging square wave signal using GPIO.BOTH

I'm currently making a datalogger using a Raspberry Pi which will record the real time and date of each falling and rising edge (GPIO BOTH) of a square wave signal (going through one input port). The ...
-1
votes
1answer
107 views

Modifying input of HID via GPIO of PI (unless there is a better way?)

Basically I want to control the input of a USB HID via one or more other HIDs. I know there are commercial options available to do this however they are closed source and expensive. I'd like to get ...
0
votes
1answer
307 views

How can I control a 12V solenoid door lock - Pi Zero

I have a solenoid door lock that requires 3 different voltages to operate - Unlocked Idle: Requires low voltage (6V) that'll hold the solenoid seated - Locked: No power (0V) - Unlock: 50-100ms ...
3
votes
1answer
1k views

UART RX stops reading data after working correctly

I'm trying to read an continuous stream of data from my device (laser altimeter). The device is connected to the UART Rx pin of raspberry Pi 3B+. Everything works fine with this python code: import ...
1
vote
1answer
33 views

GPIO.input(24) is coming back True when it shouldn't be (false button presses)

I have a button in a working circuit. Within sys/class/gpio/gpio24, value changes properly (it becomes 1 when pressed down, 0 otherwise). When I use GPIO.setup(24, GPIO.IN) within python, GPIO.input(...
0
votes
1answer
69 views

Why Raspbian jessie version 8 won't allow communication through GPIO serial pins?

I am running Raspbian Jessie 8 on Raspberry 3 and I followed the answer to the question Why my program won't communicate through ttyAMA0 on Raspbian(jessie)? But I still can't get my program to ...
2
votes
1answer
191 views

LED not blinking

Raspberry Pi Zero Wireless I have a Pi Zero connected to a breadboard using the GPIO Extension Board and ribbon cable. I have followed several of the basic blinking LED tutorials. One jump cable is ...
1
vote
0answers
773 views

RPi.GPIO - Properly Wiring and Setting Up Pins for Button Inputs

Edit: Breadboard, schematic, and code updated. I accidentally fried my Pi by shorting it out through the GPIO pins, so I figured it would be a good idea to ask for some help before trying my current ...
-1
votes
1answer
44 views

python basic problem in developing raspberry pi 3 GPIO skill

this is a part of a code for picroft skill: def handle_command_intent(self, message): if message.data["command"].upper() == "BLINK": self.speak_dialog("ledblink") the "data" and "...
0
votes
2answers
90 views

Writing to GPS HAT on Raspberry Pi Zero W Never Returns Anything

I have attached a GPS HAT to a Raspberry Pi Zero W running RASPBIAN STRETCH WITH DESKTOP. When I SSH in to run a simple Python script that writes to the HAT serial port, nothing happens and I am not ...
1
vote
1answer
286 views

Problem counting pulses

I want to count pulses and find the frequency. Here is the picture of pulses from the oscilloscope: Obviously, frequency is around 1/2.3 ms = 420 Hz. First I tried this program: import RPi.GPIO as ...
0
votes
2answers
231 views

Raspberry Pi Detects I2C Device Sometimes

I have my MPU-92/65 connected to my Raspberry Pi and it's sometimes detected but not always. $ i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -...
1
vote
1answer
48 views

Controlling electromagnets in clock display

I have an electromechanical 7-segment clock display with each segment controlled by an electromagnet. A segment is 'on' depending on the polarity of the last pulse to its electromagnet. Can anyone ...
1
vote
1answer
261 views

Use Raspberry Pi GPIO to sync multiple video players. Possible?

Is it possible to use GPIO to sync multiple RasPi video players? As shown in the picture below, I need to sync 16 RasPi video players. The master RasPi will trigger the video players (start, stop, ...
1
vote
0answers
27 views

How to create installer files in Raspberry pi

I have created a program in Raspberry pi and I am running it using the command python myprogram.py . Is it possible to create the installer file of this program? that means after installing this ...
3
votes
2answers
6k views

How fast can GPIO pins toggle?

I'm currently using Python's RPi.GPIO module to toggle some pins, and I want to know how quickly it can do this. I need the pins to be toggled on the schedule of a ~50 mhz FPGA clock, which I'm ...
0
votes
1answer
1k views

ImportError: No module named 'RPi'

I am trying to make a humidity sensor using this code import RPi.GPIO as GPIO import dht11 import time import datetime # initialize GPIO GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.cleanup()...