Go Down

Topic: arduino to rpi gpio logic level mismatch (Read 377 times) previous topic - next topic

schwaa

Hi all

Apologies if this is documented else where (I'm sure it must be buti can't find a definitive answer). This is probably basic and obvious - I'm on  a learning journey!

I need to use arduino digital pin output as trigger switch on rpi.

In an installation situation where arduino pin will only be output and rpi pin will only be active high input is it sufficient protection to just put a resistor and diode in series? i e:

Rpi gpio 3v3 input-- [330R] --diode>|-- Ard pin 5v output

So digtaIWrite LOW  will pull rpi pin to ground but HIGH will keep rpi pin high without harming gpio.Does that make sense? ! I don't want to damage the rpi!

thanks for your help!
josh


MarkT

Are you enabling internal pull-ups on the RPi pin?  They are extremely weak I note.

I'd suggest a 4k7 pullup to 3.3V for the GPIO pin on the Pi, 1k + 1N4148 or schottky
diode in series to the Arduino pin.  1k limits the current to 3mA, which is much safer,
without compromising speed much.  4k7 pullup will give much better noise immunity
than the internal pull-ups on the Pi.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up