so I'm working on communication between arduino and RPi via GPIO pin. It's basically connecting them by using a cable jumper. So I have a 2 channel relay shield attached to my arduino, and I've been wondered how do I connect them to RPi. I need help for this problem, any advice would be appriciated. I'll post the GPIO pin below. Thankyou 2 relay channel shield

RPi GPIO pin

closed as unclear what you're asking by Milliways, MatsK, user31481, gre_gor, Code Gorilla Nov 14 '17 at 10:22

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Do you really need the arduino? you can attach the relays to the rPi directly. – ratchet freak Nov 10 '17 at 13:18
  • 1
    @ratchetfreak Thankyou for your answer, yes I do need the arduino, the relay is attached on my arduino, you can attach the relay to RPi by using the cable jumper, but I don't really know how it work – dbz Nov 10 '17 at 13:21
  • Why not just use the serial cable? Have you considered using the Raspberry Pi to program the Arduino then for communications also? That's what I do for my solar plant modults. – SDsolar Nov 12 '17 at 0:26

I assume you are using Arduino UNO. Pi's digital logic is at 3.3 V and that of Arduino Uno is at 5 V. Anyway to send data from Pi to UNO, you can connect the pins directly. UNO can recognise both the logic levels of Pi's output. But to receive data from UNO to Pi, make sure you build a voltage divider using resistors, that brings 5V output from UNO's pin to 3.3 V. Also the grounds of both Pi and UNO should be connected to each other.

  • Thanks, I really appreciate it. The thing is I've attached relay channel shield on top of my arduino. So i just connect them like RPi pin 1 to Arduino GND 5v Like that? – dbz Nov 10 '17 at 13:32
  • why are you using relay shield? – Mitu Raj Nov 10 '17 at 13:43
  • @tbh Using relay shiled so i can attach another device called xbee(cc2530) for wireless transmission – dbz Nov 10 '17 at 13:52
  • 2
    What on earth does a realy shield have to do with connecting an xBee? I think you are a little confused about what you actually want to do and are suffering from a severe case of xy-problem. – Majenko Nov 10 '17 at 14:09
  • 1
    @MITURAJ thankyou , i really appreciate that, also thanks for your time for spending in here – dbz Nov 10 '17 at 14:54

What you are asking really makes no sense at all.

You are starting from the mid-point of your project and wondering how to communicate using bare GPIOs without really knowing what it is you want to communicate and what you want to do with that data - or at least you haven't made any of that clear to us.

It is unclear what you want to do with the shield from the Pi. Do you want to control the relays on it by sending instructions from the Pi? Do you want the Pi to send and receive data through the XBee? Either way the Arduino is pretty redundant in the system and in fact gets in the way more than is useful.

If it's just relays you want then it would be far simpler to wire cheap relay modules direct to the GPIOs of the Pi - then you don't have to worry about "how to communicate" - you just turn the relays on and off.

If you want to communicate with the XBee there are far simpler shields available that will plug directly into a Pi. Indeed, there are some good shields around for the Pi ("Hats" I think they call them) which give you an Arduino footprint and an XBee socket together.

The Arduino is completely pointless in this system. And anyway, if you wanted to make the two systems communicate there are far easier ways than with bare GPIO pins. Serial, for a start. The simplest ever method is to just plug the Arduino into the Pi's USB. That way it gets power and data all in one go. Just like using it with a computer.

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