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
1
vote
2answers
831 views

Can't access GPIO on Debian Buster & Pi4B

I'm running a Pi4 with Debian Buster (not Raspbian / RaspberryPi OS) and need to interact with the GPIO pins but am having problems doing so. I've created a gpio group and added the pi user to it ...
0
votes
0answers
67 views

Pi4B / GPIO / Rust problem

SBC: Raspberry Pi 4B (8GB) OS: Ubuntu 20.10 Groovy Crate tetsting: RPPAL Rust version: 1.48.0 Compile/run error tester1@pi4b:~/playground/rpi_gpio_01$ sudo target/debug/rpi_gpio_01 Blinking an LED on ...
1
vote
1answer
206 views

How can I write or read from a specific GPIO pin in from a kernel-module?

I'm using a Raspberry Pi 4 with standard 32 bit Raspbian. I'm trying to write a driver in c that writes AT commands to some GPIO pins and reads the response from other pins. For that I want to use the ...
0
votes
1answer
41 views

Should I use an external power supply for controlling 4 servos?

So I have for servos that I could connect to a breadboard and to raspberry pi GPIO 5V pin to power them. But I have read that That is not safe it can damage the pi. Is that true? instead of using ...
5
votes
2answers
875 views

What is the rationale behind GPIO pin numbering?

I was looking at the 40-pin pinout and I couldn't help noticing that there doesn't seem to be a logical order to the placement of the GPIO pins. Even allowing that there may be a technical reason for ...
0
votes
2answers
36 views

How to drive two 3v relays safely from Raspberry PI?

I use PI 4 to power two 3v relays. One is controlling 5v dc, another 12v dc. And about once a minute I am switching each relay signal state to On/Off So each relay is connected to 3v pin, ground pin ...
1
vote
2answers
673 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
2answers
41 views

Servo is jittery and moves back and forth when it should be still

(Sorry about formatting) I am trying to write an opencv program to track the color red. So far it works okay, but the servo is jittery and when the object is still and centre the servo moves back and ...
0
votes
0answers
30 views

Why I get "segmentation default" when add module to kernel?

I have build softuart.ko and add into kernel, but I got "segmentation fault" error when run insmod. I get code from https://github.com/themrleon/RpiSoft-UART. The detail message error I got ...
0
votes
1answer
126 views

Raspberry Pi Pycharm can't recognise GPIO

I'm new to Raspberry Pi and Python. I am trying to use Pycharm to code my GPIO just for a simple project to let the led blink. The code is working fine with Thonny IDE but when I move the same code to ...
0
votes
4answers
66 views

This channel is already in use, again: X-mas tree lights

Sorry, but I've looked at several threads and no one talks about my idea. I'm currently working with a switch, that will manage the Christmas-tree lights, to turn it on at 18:00 and off at 01:00 (e.g.)...
0
votes
2answers
1k views

GPIO not working on Raspberry PI 4 4GB

I have a RPi 4 running Raspbian with the Ubuntu Mate desktop environment, whenever I try to use the Wiring Pi library through a C script, to doesn't work at all. On using the gpio readall command I ...
0
votes
0answers
22 views

Motor controller for Raspberry Pi 3 has no effect on attached motors. (Drok XY-160D Board) [duplicate]

I believe this code is correct. I am working connected to the Pi through SSH and tried running it through the Mu shell. Motor controller is hooked up to a 12V power supply. If it helps, I noticed the ...
0
votes
0answers
34 views

One Raspberry pi GPIO can drive how many inputs of 74HC245 and 74ABT245?

Please help me understand these calculations. Don't know which parameter to look for to find out Fin in and Fan out of a buffer IC. Thank you
0
votes
2answers
128 views

Cannot connect to UART via USB

I am trying to connect to a raspberry pi zero (and a pi3) via uart and USB (USB to TTL YP-01) I am connected to pin 8, pin 10 and a ground. tx -> rx, rx -> tx I have tried everything on this url ...
1
vote
1answer
91 views

Control IR Port With GPIO

I'm working on a project that needs the ability to control an HDMI switch programmatically. There are going to be a lot of these boxes so price of the components used is very important. I've ...
3
votes
2answers
568 views

PWM frequency/profile for "official" pi fan?

I have a pi4 with the "official" fan case and I would like to write my own fan control code. I have looked online for a datasheet for the fan but haven't found it yet. I see on the case fan ...
1
vote
3answers
77 views

Components need too many GPIO pins

I am relatively new to electrical engineering so don't expect me to know much... I want to start a kind of proof-of-concept projcet. It should - when it is finished - run on a Raspberry Pi Zero (W). ...
-1
votes
1answer
49 views

Raspberry Pi checking and rebooting the main router if necessary [closed]

I have gotten tired of having to reboot my router a every other day. I think my router does not update when my ISP changes. Now I have a timer that cuts the powers to the router at 4 am. An more ...
1
vote
1answer
84 views

Using a GPIO to unlock an electronic lock [closed]

I want to build a safe that can only be opened via an HTTP POST request. In order to do this the safe will contain a Raspberry Pi Zero W that will host a simple server that listens to these requests ...
1
vote
4answers
203 views

DS18B20 Sensor - Can you manually write data to w1_slave?

I'm trying to manually edit the w1_slave file of a DS18B20 Sensor. Using nano to edit the file, when I manually change the temperature and go to save and exit, I get 'permission denied'. Is there ...
0
votes
0answers
26 views

Python Flash read data / enumeration

I read in the datasheet that my Flash can be read by doing: To perform a read operation, RST# and WE# must be deasserted while CE# and OE# are asserted. CE# is the device-select control. When ...
0
votes
1answer
173 views

Using GPIO to control 5v relay module not working

so this is my first time trying to use a Raspberry pi and I wanted to automate a motor using a 5v relay module. I'm using a Raspberry Pi Zero W. I am using a 5v 2amp power supply to power the ...
-1
votes
1answer
27 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
317 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
1answer
75 views

Reading current PWM output configuration

I use gpio #32 (wPi #26) as PWM output to control the speed of a fan based on temperature. The job starts at system startup with a dedicated account. I would like to display the current value that is ...
0
votes
1answer
27 views

Use GPIO port as toggleable ground - NodeJS

I need a way to spin a brushed motor in both directions with my Raspberry Pi 4. I don't have the right transistors. The only way I would be able to achive this is through a GPIO port that I could turn ...
1
vote
2answers
58 views

Can RPi 4B be used as a microcontroller for USB devices development?

Background I've made simple shortcut buttons to be used with Google Meet (componets on breadboard and the code in python): one button connected to some GPIO pin that makes a keystroke (ctrl + e) for ...
-1
votes
3answers
96 views

Use GPIO to power an USB device

I searched the forum but didn't get a clear answer. I have a "LED tinsel" powered by an USB plug. I tried connecting a 5V pin of my RasPi3 GPIO to the "+" pin of the USB plug, and ...
-1
votes
1answer
52 views

Is it possibel to send a CLI command from a input on the GPIO

Im a beginner in raspberry, and i would like to send a command on the CLI whenever a input is activated on a pin. Basically i want to push a button on a breakoutboard or similar, that sends a signal ...
1
vote
1answer
182 views

Is it possible to drive two PWM pins with opposite phase?

One well-known trick to make a piezo buzzer sound louder is to actively drive both sides of it with an opposite phase: when pin 1 is at 0V, pin 2 is at 3.3V and vice versa. This creates a voltage ...
0
votes
0answers
121 views

GPIO17 only works after calling 'GPIO.setup(17, GPIO.IN)'

I have a fresh installed RaspberryPi running Raspberry PI OS Lite (32-bit) from 2020-12-02 with a mounted OnOff-Shim. Starting the Raspberry via button works fine, but the shutdown sequence is not ...
0
votes
1answer
848 views

I wan to connect Case fan and display using GPIO pins

I want to connect a display and Case with a fan on my RPi4B. However, I am not able to do so successfully because they commonly need GROUND and +5V pins which are right now used my 3.5 inch TFT ...
1
vote
1answer
56 views

Python code for 2 buttons

this is a beginners question, I suppose. How can I write a python code that allows the use of 2 (or more) push buttons connected to the GPIO? Each button should start a different shell script. The ...
0
votes
1answer
74 views

GPIO: multi button input to trigger one output

First, total noob here. Apologies in advance if this has already been addressed, but I have not found anything that specifically answers my question, yet. I have some experience with structured text ...
1
vote
2answers
772 views

How can i cross-compile for Raspberry Pi Zero with WSL?

I am working on a project with the Raspberry Pi Zero and since I don't have a monitor to connect the Pi and don't want to use vi through ssh I thouhgt that cross compiling would be a decent solution. ...
1
vote
4answers
1k views

Using single 5V relay module (jqc-3ff-s-z) - Asking for help

I have a developer background missing the electronics background. I read some threads with great interest: Using single 5V relay (jqc-3ff-s-z) - safety advice required and 5V relay (jqc-3ff-s-z) I ...
1
vote
0answers
60 views

making a DC motor spin both ways

I week ago, I got my raspberry pi, connected it to a DC motor, and made the DC motor spin using python. now, I'm trying to get the motor spinning both ways. I have tried but failed. What is the best ...
0
votes
2answers
207 views

How to calculate pull-down resistor resistance

I have a 12V input which I am using a 100k and 20k resistor as R1 and R2 respectively as a voltage divider to feed into a Raspberry Pi GPIO pin. When the 12V signal is switched off, I would like to ...
0
votes
1answer
275 views

Get servo position using pigpio

I'm currently developping (improving) an Octoprint plugin that is used to control servo motors with the pigpio library. I always thought that I had to initialize the servos at the start of the code by ...
0
votes
4answers
3k 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....
3
votes
3answers
2k views

Can I control a 4-pin fan with a Raspberry Pi without adding more circuitry?

I'm interested in adding a fan to my Raspberry Pi 4, but I would like to be able to control when it is on/off programatically. However, what I see is that most of the fans suitable for Raspberry Pi ...
0
votes
1answer
106 views

Raspberry Pi Zero GPIO Pins not working from opposite side?

As a disclaimer, I'm new to digital electronics and somewhat new to soldering. I recently bought a standard GPIO header for my raspberry pi zero, but in order to use both the camera part of my case ...
0
votes
1answer
210 views

How can I control a 4026 counter chip from my raspberry pi?

I have a 4026 counter chip controlling a seven segment LED display. The current set up is every time I press a button it advances by one digit on the display. See circuit below. This circuit runs on ...
1
vote
1answer
121 views

Share Uart Pins

In my build i have a gsm module ( SIM800L ) connected to a RPI 0 W in this way: I would like to get also the current position of my device, for do so i was thinking to buy a Gps module ( NEO-6M STM32 ...
1
vote
2answers
121 views

Driving an 800mA doorbell from the 5V of a Model B+

I want to make following schematic to feed and detect a doorbell ring. I have measured the max current through the doorbell to be 800mA. The Pi is fed with a 2.5A Raspberry power supply. GPIO3 would ...
-1
votes
2answers
54 views

How can detect a very low voltage (0.2 V) with the Raspberry Pi? [closed]

I'm a beginner in electronic and I want to use a GPIO input to detect 200 mV. Is that possible ? I think that we can increase the voltage, decreasing the amperage. But I don't found a way to do it. ...
0
votes
0answers
41 views

Issues with an executable (C#) and sudo

first of all I am using Raspberry Pi 4 with Raspbian. I've made an executable in C # (Mono project) that uses the "unosquare/raspberryio" library for GPIO, SPI and I2C communication. If I ...
0
votes
1answer
25 views

How to pass GPIO status in a thread using def with args [closed]

import RPi.GPIO as GPIO import time import threading GPIO.setmode(GPIO.BOARD) GPIO.setup(11,GPIO.OUT) def fun1(a,b,c): mycount = 0 while my count < c ...
0
votes
1answer
112 views

working micro pushbutton gives no Input on GPIO RPi4

I use a simple python script (https://github.com/edus44/lakka-gpio-control/) for Lakka GPIO button input on a Raspberry Pi 4. The script works perfectly: If I short wire one of the GPIO Pins to GND ...

1
3 4
5
6 7
61