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.
653
questions
0
votes
1answer
25 views
Raspberry Pi DHT 11 sensor not working.I get None None
Have integrated Raspberry pi4 with a DHT sensor.
The data pin is connected to pin GPIO 26
Have tried connecting the VCC to both 3.3V and 5V
Have tried with both Adafruit_DHT.DHT11 and Adafruit_DHT....
0
votes
1answer
26 views
RPi.GPIO: multiple buttons one callback function, ignore buttons while callback is executing
I have 4 buttons connected to my Raspberry Pi that call the same function when pressed. I'm using GPIO.add_event_detect to connect the buttons to the callback function. When one button press executes ...
0
votes
1answer
26 views
gpiozero button to raise SystemExit / gpiozero clash with GPIO.cleanup()
TL;DR: Since this is a long question I have the following problems:
I'm looking for a good way to use gpiozero Button to raise SystemExit upon button press
I have an imported module to drive an E-Ink ...
0
votes
2answers
50 views
How can I query pull state of GPIO pin?
I am writing a script that should query if an input pin is configured as pull-up or pull-down using the RPi.GPIO package.
When configuring each output I can call
GPIO.setup(11, GPIO.IN, pull_up_down=...
0
votes
1answer
25 views
PIR motion sensor HW-416-B does not behave properly. No motion but input is triggered regardless
So, this motion sensor works when it is taped to my desktop computer...but when I move it to the wall, specifically a higher spot on the wall, it just keeps giving back an input signal. So here is a ...
1
vote
0answers
35 views
GPIO INPUT is always HIGH
I am working on a project with HC-SR04 Ultrasonic sensors. I am a beginner in raspberry-pi.
I have 3 sensors which are calculates the distance. But one of them has problem which is echo (input) pin ...
0
votes
0answers
13 views
How do I resolve import issues with multiple Python versions relative to PyCharm
I have searched everywhere for a beginner level understanding of how Raspbian/Ubuntu, etc. manages paths, which files I need to modify, how to use init.py, venv, etc. and it seems every time I install ...
0
votes
1answer
18 views
FruxePi Installation fails on RPI W
I've been trying to install FruxePi (https://github.com/fruxefarms/FruxePi), both 0.3 & 0.4 versions. But
To my understanding the setuptools / pi fails to install, but I can't imagine a way to ...
0
votes
2answers
47 views
RPi.GPIO: Check if a pin is being used
During development, I frequently encounter this warning, as expected. My threaded code frequently prematurely terminates during experimentation.
Steppers.py:26: RuntimeWarning: This channel is already ...
0
votes
1answer
39 views
RPi PWM issues - (re)start results in oscillating pin
I'm building a sauna controlling mechanism, controlled by the Pi, using PWM and solid-state relays.
Works fine, but after a while, the PWM breaks down.
At this moment, when I run the program and the ...
0
votes
2answers
46 views
How to create unfazed pwm signals?
I have two pins with the same frequency (10Hz) and same duty cycle (50%) assigned to two different leds. How can I make the two leds blink alternatively? How can I put a delay of 50% in one of the ...
0
votes
1answer
35 views
voltage issues with GPIO raspberry pi 2
Need some assistance here.
I am trying to setup some high voltage SSRs to my Raspi for an eventual lightshowpi project. Trying to start small first. I have a bunch of LEDs I have been playing around ...
0
votes
0answers
28 views
How to set event handler for a GPIO in Mathematica for Raspbian
I wish to program my Raspberry Pi using Mathematica (rather than Python). One basic functionality easily done with Python is to set event handlers which triggers a function when some event is ...
0
votes
1answer
45 views
Is it safe to use GPIO as GND for multiplexed 7-Segment display or should transistors be used?
I want to control a 4-digit multiplexed 7-Segment + Decimal Point Display (SH5461AS).
This diagram (which allegedly comes from the datasheet of this display) suggests to use 4 external transistors to ...
0
votes
1answer
284 views
Ubuntu 20.10 and GPIO
I have trouble installing RPi.GPIO library on Ubuntu 20.10. I run apt-get update and apt-get upgrade then apt-get install python python3 python3-pip python3-dev everything went ok. Then I run pip ...
0
votes
1answer
61 views
Raspberry Pi connected to Motor Controller- Getting error in code
*Hi, I am getting this code error:
*blink.py:25: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.*
GPIO.setup(ENA1,GPIO.OUT)
...
-1
votes
1answer
26 views
input pin not working
I connected the 3v3 power pin to a switch and then to an IO pin set to input. when I turned on the switch, it works fine and I detect an input, but when I turned off the switch, it was going back and ...
0
votes
3answers
104 views
My GPIO.event_detected code is unreliable
I made this short program to understand GPIO.event_detected() better, and ended up more confused than I started. Please help me understand my mistakes. Here is the code, and some test output of me ...
0
votes
0answers
24 views
MAX98357A Adafruit amplifier no output
I'm trying to connect the MAX98357A Adafruit board to a rpi Zero W.
I've followed their documentation for installing and testing it. The installation went ok with no errors but at the test i got no ...
0
votes
4answers
791 views
What is the proper way to debounce a GPIO input?
I have a project that involves using a Raspberry Pi to sense the state of a mechanical switch (actually, a relay, part of this light beam sensor). When the switch is closed, I want to sound a doorbell....
0
votes
2answers
58 views
No RPi. module found [duplicate]
Is it only possible to find the RPi. module when I'm connected with my Raspberry. I wanted to write the program first and then load it on to my Raspberry. But I get the Error that there is no RPi. ...
1
vote
0answers
35 views
regulating the speed of a motor connected to a TB-6612 FNG motor driver using the pwm output generated by the pca9685 multichannel servodriver
I understand that this type of usage is not typical for the pca9685. I am trying to use one of the pwm pins of the pca9685 to regulate the speed of a motor.
As for now the motor works regularly if ...
2
votes
0answers
66 views
Wiring 12V 5 pin relay (without a module/board) for usage with Raspberry Pi
I'm trying to setup an automated garden as a quarantine project for my mother and I can't really figure out how to properly wire a 12V 5-pin relay module as every tutorial online only shows the ones ...
1
vote
3answers
102 views
How exactly do i make a LED Blink? I tried every possible result
I am trying to make a LED blink on a Raspberry Pi Breadboard, but after everything I've tried, it doesn't work.
I have tried:
Changing wires and moving them around
Switching LED's to check if the ...
2
votes
1answer
102 views
Power multiple add-ons on one 5v pin
I have multiple add-ons connected to my Pi that currently use all of the 5v pins.
I want to run more add-ons to the Pi that need 5v power.
The 5v pins are connected using male to female GPIO jumper ...
-1
votes
1answer
38 views
Odd results when using RPi.GPIO's event_detected() function
I've recently been experimenting with RPi.GPIO's event_detected() function, to check if a button (connected to the gpio) has been presssed. However, for some reason events would randomly be detected. ...
-1
votes
1answer
36 views
Arduino to Pi reads high all the time [closed]
I'm trying to read a signal coming from an Arduino through a wire attached to pin 24 of the Pi. The problem is the Pi reads high all the time.
I tried to do a pull up using GPIO.setup(24,GPIO.IN, ...
0
votes
0answers
13 views
RPI Stops Reading Micro SD Card If I Plugin PI Fans before it and Vice-versa
facing issues with the heat sink casing that I bought it got 2 fans.
So, if I connect the fans before the boot RPI doesn't read the micro SD card and no green light. But, if I remove the fans ...
0
votes
1answer
43 views
Two unrelated GPIO scripts interfere with each other
I have two completely seperate python scripts involving the GPIO that runs on startup.
The issue i'm having is that when I call the turn fan on or off it sometimes triggers the halt script I have and ...
1
vote
0answers
2k views
speaker and mic with Raspberry pi 4
I'm making a project, a surveillance camera with audio. Live feed from my localhost webpage. the live camera part is now okay and working, my problem is the "intercom" part. I don't really ...
2
votes
1answer
715 views
GPIO inputs don't work on Raspberry 4 running Ubuntu
I have several RasPIs set up with Ubuntu Server 18.04 64Bit. One freshly setup up RasPIs 3B+ and two 4Bs. On all I can run the following minimum script without any error messages:
#!/usr/bin/env ...
0
votes
0answers
33 views
Can a threaded callback function modifying pins with interrupt detection in the main thread lead to an infinite loop?
I'm using RPi.GPIO and making a switch matrix which waits for rising or falling edges caused by switch toggles in the rows, triggering a scan of all the switches. I have one interrupt for each row, so ...
0
votes
1answer
105 views
How to clean up gpio pins properly?
I'm a newbie with Raspberry Pi as well in python and node red.
So my goal with my project is to make a DIY irrigation systemm. I have an RPi, which reads value from the soil moisture sensor and ...
-2
votes
1answer
111 views
How do I connect my 24 pin fpc to dip breakout board to my rpi zero w?
So I am working on a type of headset and I bought the adafruit 1.3 ips with 24 pin fpc connector and st7789 driver and I'm thinking of using a breakout board to do it. What I don't know is the pin out ...
0
votes
0answers
622 views
Powering capacitive soil moisture sensor from 5V Pin
I'm completely new to RPi, and I'd like to make a garden project, at first I would like to measure the soil moisture.
I purchased one of these sensors https://www.amazon.com/Analog-Capacitive-Moisture-...
0
votes
0answers
70 views
I2C, SPI and Python Libraries with Raspberry Pi 4b
I've been working with RPi.GPIO so far but I have had issues with PWM and edge detection, which are well known issues with RPi.GPIO, anyway, after some research I'm considering using a different ...
0
votes
2answers
523 views
PWM issues with pigpio and RPi.GPIO
I am using Pi Zero W with latest Raspberry Pi OS.
I have a backlight of an LCD that I am trying to control via PWM.
If I use RPi.GPIO I get flicker at anything other that 100% (or 0%) duty cycle. As ...
1
vote
0answers
79 views
PIR sensor always high with Raspberry Pi3 without breadboard
I have a HCSR501 PIR motion sensor, which has 3 pins (Vcc, Out, Gnd) that I've connected to 5V, GPIO 26, and Gnd respectively. Despite following all the steps in tutorials for interfacing the sensor, ...
0
votes
0answers
43 views
Using a port expander AND other GPIO pins
I'm working with a port expander for the pi to run four stepper motors from python. It was working great until I tried to also use a GPIO pin on the pi (not on the port expander) as an output. I was ...
0
votes
1answer
37 views
Not getting a full 3.3V instead getting like 0.7V on a GPIO pin
Okay so I ran the following code and I am seeing ~0.70V on the GPIO pin and not 3.3V. Why could that be?
#import the GPIO and time package
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
...
2
votes
2answers
579 views
Using PWM with RPi.GPIO in Python
Scenario: I want to control a PC fan using the Raspberry Pi. The 4-wire-fan (MGT9212UR-W25) has its own power supply (12V) and can be controled via PWM. I would like to control it with a Python script ...
0
votes
2answers
333 views
RPi.GPIO Cleanup() only specific pins?
Im using the Pi to control some relays, that in turn switch some light bulbs.
some code for clarification:
def do_work(job):
try:
duration = int(job.Duration)
gpioPort = int(job....
1
vote
1answer
57 views
Can Rpi GPIO pins be used to drive a DC motor? [closed]
I tried to GPIO pin to high and I cannot see output voltage. I try every solution but no one works for me.
import RPi.GPIO as g
g.setmode(g.BOARD)
g.setup(16, g.OUT)
g.output(16, g.HIGH)
I look GPIO ...
0
votes
2answers
76 views
using RPI 3.3v and 5v pins as reference for level shifter [closed]
As the title says, simply, can I use the 3.3v and 5v power pins on the GPIO connector as the reference voltages for a level shifter, or do I need some other reference?
0
votes
0answers
34 views
Raspberry Pi3 - Controlling 4 DC motors
I need to feed 4 DC motors of 5V on my Raspberry Pi 3 Model B using PWM (Pulse Width Modulation).
Currently, I have the next components: 2 NPM transistors, 1 L293D integrated circuit, resistors (220 ...
0
votes
1answer
78 views
PWM problem in a frequency less than 100Hz
I have attached a fan to pin #17 (through a transistor of course) and am writing a script to turn the fan on for a specified duration with a specified PWM duty.
#!/usr/bin/env python
import os
...
-1
votes
1answer
384 views
function to wait for any of the buttons press
I'm working on a project that use four buttons to navigate in a menu. The root options of the menu have nested options etc. The buttons don't have hardware de-bouncing.
My ultimate objective is to ...
0
votes
0answers
59 views
Using a GPIO pin as output and input
Good morning everyone,
i'm working in a project that involves having an state pin and button detection.
The escenario is the following:
when raspberry pi finish booting, a pin is pulled HIGH (this ...
0
votes
0answers
28 views
Remote GPIO on rpizero with Buster
I want to turn on a gpio output and receive input from a gpio input. This is all initiated from a webpage. I am making an ajax call to a php file which itself runs the python script.
It does not work....
1
vote
1answer
224 views
Run Python RPi.GPIO as sudo
I'm trying to use the RPi.GPIO Library in a python-script with root-privileges.
I essentially need to run it with sudo because other stuff in my script require root-privileges.
When i try the ...