2

I'm trying to send a signal from Raspberry Pi GPIO to Arduino. I made a sketch that basically reads the state of the digital read, but the reading are very unstable. I understand that there is a floated voltage and the obvious solution is to configure the pullup resistor and connect the input to ground, but my goal is to read the incoming signal. I'm using Arduino Mega 2560 and Raspberry Pi 2B.

I hope this info is enough!

8
  • Please show your schematic.
    – Majenko
    Nov 17 '15 at 20:48
  • 1
    It is just GPIO 5 conected to A3 of Arduino Mega. Nov 17 '15 at 23:44
  • 1
    If GPIO5 is the only thing connected and the Arduino/Rpi are on seperate power supplies then you are certainly missing a common ground reference if you want them to talk directly.
    – crasic
    Nov 18 '15 at 4:45
  • 1
    Connect the grounds together.
    – Majenko
    Nov 18 '15 at 8:32
  • 1
    Thank you! I know this was a silly question, buy I really apreciate your help! Have a nice day! Nov 18 '15 at 17:50
2

As Majenko commented, you need to not only connect the data wires together but also the ground wire (from the Arduino to the Pi).

... the reading are very unstable ...

Without a consistent "ground reference" the readings would indeed be unstable.

2
  • Occasionally you run into situations where connecting grounds causes problems in which case a dual supply buffer or isolator can be used
    – crasic
    Feb 19 '16 at 7:23
  • @crasic that's a very interesting point (maybe not in this case, but) you might want to elaborate it in your own answer or by editing Nick's answer. In what cases should it be used, why and how?
    – Paul
    Mar 30 '16 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.