Using Arduino GPIO directly from Raspberry PI (RPI.GPIO)

January 6, 2024, 17:43

moajouz

So I was searching for the fastest method to send a 5v signal from the raspberry pi to other components and I saw the serial communication on arduino, this have a lot of problems from me, I just want to directly send the 5v signal and I came across this image. the website didn't have anymore in depth information, but comparing it to other information I got from chatgpt I think we could directly control the arduino pins by setting the pins ias output in the setpu, and having the same pins number as output in the raspberry. did anyone ever try it? as I think that I might have understood something wrong, I also don't trust chatgpt for codes except for him to find missed semi-colones or other typos

moajouz

anyone tried it before or have faster solution that does not require serial comm?

moajouz

I already setup the serial comm and tried it but still searching for something faster

rootd

what is your model of rpi

moajouz

pi 4B using ubuntu 22.04

rootd

so, as i understand you want to connect a cable and get 5v from it?

Pantner

If you want to have the PI communicate with something that uses 5V logic you need to use something like this https://www.sparkfun.com/products/12009

Pantner

If all you want to do is "turn on" ome of the Pi's pins to run a 5V LED, then you want to use a mosfet or transistor like a switch to do it.

moajouz

yeah the problem is that the transistor is slow for my application

moajouz

I just got the idea to use 2 arduino pins 1 as output 2 as input then put output = input lol

Pantner

what do you mean slow? what sort of speed do you need? Arduinos are 5V logic which means you need a level converter like i linked.