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
0
votes
1answer
41 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
28 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
33 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
26 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) ...
0
votes
2answers
34 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
26 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
32 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
24 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
28 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
35 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 ...
0
votes
1answer
64 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
40 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
23 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
38 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 ...
2
votes
1answer
26 views

How do I diagnose suspected power issues?

I have a Pi 3 project that has quite a few things attached. 4 DHT-22s powered from the 5v rail (5m cable length, so I needed the 5v for the voltage loss). Wired in like this 2 Magnetic door reed ...
0
votes
0answers
17 views

Threading with GPIO and Push Buttons

I'm trying to loop some code in the main function of the program, while running a thread in the background that's listening for a button press through GPIO. I can see that the thread is running, ...
2
votes
1answer
28 views

Using event detection to immediately interrupt a function and callback to

I have made a script (below) which which controls a LED through two functions, blink_fast() and blink_slow(). My goal is to control the "mode" of the LED by using a physical push-button wired to GPIO. ...
1
vote
2answers
66 views

Communication between 2 raspberry pi's

I am trying to communicate between 2 raspberry pi's (3B and 3B+), through Gpio's (not uart, just as input output). So I am making a gpio on one Pi as Input and on the other Pi as output. So can I ...
0
votes
0answers
178 views

pyaudio - Alsa warnings on Raspberry pi

I am trying to send data through 3.5mm jack. In that process, Everytime i'm getting these warnings import pyaudio p = pyaudio.PyAudio() The following warnings are: Expression '...
1
vote
1answer
24 views

Setting a GPIO port for an accurate time duration with Python

I am trying to set a GPIO port to LOW for n seconds and set it to HIGH afterwards. The problem is that it's not at all accurate. It varies between a small number of seconds to 2*n or even more. ...
1
vote
1answer
36 views

Is there a limit to reading from sensors using Raspberry PI and Python?

According to this datasheet this sensor puts out signals < 10ms. When using RPi.GPIO and the add_event_detect callbacks, is there a chance that I will miss information because of the processing ...
1
vote
1answer
36 views

PWM not reaching desired frequency after checking on oscilloscope

I am attempting to setup a PWM signal on Pin 12 (GPIO #18) using a Raspberry Pi 3. I am capable of sending a PWM signal, however it is quite off from the target frequency. I have an o-scope that I ...
0
votes
0answers
26 views

Flashing of LED

This is my first post here so HELLO and sorry if I'm posting in the wrong place. I had assigned a time limit of 40s for led blinking. Can I pause the blinking of this led and make another led to blink ...
2
votes
1answer
602 views

How can Rpi SPI python read the MFRC522 NFC module?

Trying to read my RFID MFRC522 using a Mifare blue tag and it is not working. Wondering if i could get any help on this as when i put the tag to read it doesn't show up as quick? using: https://...
0
votes
1answer
33 views

no output from 8 channel relay when i run the python script below

# import GPIO and datetime import RPi.GPIO as GPIO import datetime # set GPIO numbering mode and define output pins GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(37,GPIO.OUT) #Relay 1 ...
0
votes
0answers
65 views

Raspberry Pi connect to external RFID Module FDX-B/Animals

I have purchased an RFID reader which is supposed to be able to read implants that are in animals RFID https://www.ebay.com/itm/134-2K-AGV-RFID-Animal-Tag-Card-Reader-Module-TTL-FDX-B-ISO11784-85-...
1
vote
1answer
90 views

Pi Zero W and Light Sensor with LDR

I have a Raspberry PI Zero W and Light Sensor like on the photo: I connected it to Raspberry Pi as follow: GND to GND VCC to 5V SIG to GPIO-3 Using the following code below I am able to detect if ...
1
vote
0answers
38 views

Multiplexer and Python problem on Pi

So I've got a 16-to-1 multiplexer I'm using on the raspberry pi. Right now I've only got one motion sensor attached to it (on channel 15) to test it before i attach and fill up all 16 channels on it ...
0
votes
0answers
18 views

Ifconfig, interrupt device and enc28J60 spi1

Good morning I have configured and connected an enc28j60 card to the spi1 port of my raspberry pi3 and I have found the error in the photo that does not make the ethernet port work. I ask you for help ...
0
votes
0answers
23 views

Interrupt Servo once movement has initiated

I'm new to python and RPis. I'm building my own robot to learn. I manage to control my little robot and move it around, as well as moving the pan camera with my keyboard. While I was searching for a ...
1
vote
1answer
393 views

Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)

I've got an LED on bcm 18 and a servo motor on bcm 8. My code appears here. from gpiozero import LED import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(8,GPIO.OUT) servo = GPIO....
0
votes
0answers
24 views

Why does EmulationStation block GPIO event loop?

I am working on a custom startup script for the Kintaro super kuma 9000 (link is down ATM) case for my raspberry pi 3B+ Here is the minimal example: import RPi.GPIO as GPIO import os import time ...
2
votes
1answer
115 views

Rpi python GPIO PWM control L298 and PCA9685 motor HAT

I need to find out which GPIO pin on the raspberry pi will be connected to which module when I fit the Adeept Motor Hat v2.0 on the 40 GPIO pins. I am attaching the image and the schematic of the ...
0
votes
1answer
333 views

Rpi python GPIO PWM control L298N motor direction and speed problem

I am unable to understand parts of the code #!/usr/bin/python3 # File name : motor.py # Description : Control Motors # Website : www.adeept.com # E-mail : support@adeept.com # Author ...
0
votes
1answer
343 views

Rpi python using L298 motor driver and PCA9685 servo controller to change speed and diretion of robot car

I am unable to understand the code provided with the raspberry pi robo kit I got. I need help in understanding the code as I am new to raspberry. Thanks! #!/usr/bin/python3 # File name : ...
0
votes
0answers
23 views

Rpi 3b Simon Says Button Help

I'm just starting out with my pi and wanted a little project so I decided I'd try and create the game "Simon Says". I rigged up 4 buttons and 4 LEDs on a breadboard, etc. The aim of the game (for ...
2
votes
2answers
45 views

SPI Not working when chip select is connected to ground, works fine when connected to CE 0,1 or 2

I am working on MFRC522 sensors. However I need more than 3 SPI Devices. The 3 works fine except when I want to connect chip select to GPIO, It does not work. I tried a single spi device by connecting ...
2
votes
4answers
80 views

Why is my relay switching on automatically when I start my program?

I'm building a little automated hydroponics system using a raspberry pi zero, a 5 volt relay, a pump and a soil moisture sensor from adafruit. So far everything is working, I can pull the pin to high ...
4
votes
2answers
118 views

Python file called by PHP script in apache server unable to get RPi.GPIO

I've been trying to use a site on my local network to activate the GPIO pins on my Raspberry Pi 4. I installed apache and wrote a quick PHP script which executes a python file in /var/www/html.I have ...
1
vote
0answers
22 views

Can we use pin 3 and 5 for rtc clock module and for detecting input from push button while both are connected?

I have my project where all the GPIO pins of raspberry pi have been utilized. Now I want to add an rtc clock module to the RaspberryPi. Pin 3 and 5 are already connected to the push button in input ...
1
vote
0answers
33 views

Can i transfer files between two rapberry pi's using Aux cable?

As a part of project, i have to transfer any file from one pi to another pi through Aux cable.
1
vote
0answers
548 views

raspberry pi GPIO input value changing randomly

We attached a wire to pin 40 and another one to 3V3 supply. Also attached an LED+resistor between 5 volt and pin number 38. When the wires do not touch each other, the LED constantly emits and all the ...
1
vote
0answers
42 views

Raspberry pi 0's GPIO not working (no output)

So I used to use a Raspberry Pi 3B to control my LED strip. It was, of course, an overkill but a fun project. I now want to do the same but with a Raspberry Pi Zero w. I got one, soldered the GPIO ...
1
vote
1answer
90 views

Can Rpi receive serial/UART data through GPIO pin?

Can I receive data which is transmitted through UART port from a transmitter side raspberry pi on a receiver side Raspberry pi's GPIO pin??
1
vote
1answer
183 views

writing into fifo file and reading it

1.Transmitter side code: A)Recording audio into fifo file(no need to create fifo file separately arecord command will create fifo file): import os os.system('arecord -D plughw:1,0 -d 0 --rate=19200 ...
0
votes
0answers
29 views

What happens if a GPIO “in” pin is accidentally configured as “out”?

I have a 433MHz receiver connected to a GIPO pin (which is configure as "IN"). I was wondering what happens if the GPIO is accidentally configured as "OUT" during reboot, shutdown, or when another ...
1
vote
1answer
31 views

I run thonny and have no module name RPI error

I run Thonny on a pi zero.(i am a beginner) want to activate gpio i get an error" import rpi.gpio as pigo, modulenotfounderror: no module name 'rpi'. i have update library. still not working.
2
votes
1answer
108 views

Voice transmission through UART

I want to transmit real time voice signal recorded by usb MIC through uart using Raspberry pi 3b. But by using USB MIC it is not possible for me to transmit voice to uart directly without storing it. ...
1
vote
2answers
104 views

Whenever I restart my Raspberry pi 4, GPIO pin number 3 goes high and low very fast (bug in pi?)

I just switched from Raspberry Pi 3 to 4, which I use to control some devices. I just discovered that whenever Raspberry pi 4 boots, it changes the pi state of GPIO pin number 3 very fast from low to ...
0
votes
0answers
20 views

Is it possible to consistently apply voltage to two or more devices?

I want to connect two or more of the following actuators to my raspberry pi: https://www.ebay.com/itm/Nano-Magnetic-Actuator-diy-micro-plane-model-servo-micro-actuator-0-5g-/183745663278 However, ...

1
2 3 4 5
13