Take the 2-minute tour ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I am trying to simply send a digital output from the Raspberry Pi to trigger some code on an Arduino. I have setup the Pi with the digital output working fine (tested using LED) however, I cant seem to get the Arduino (Leonardo) to read this output. I mean, all the details about the Pull Up resistor and logic having to be low to be high is confusing me and I really dont want to use any other electronic components (ie transistors or switches, etc).

Is there a simple way of just reading the output and triggering the code on the Arduino?

share|improve this question

migrated from electronics.stackexchange.com Dec 23 at 2:32

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

    
Since you don't want to have any other electronics outside the Arduino apart from the Pi, this question would be better suited for the Arduino forums or the Arduino SE –  Funkyguy Dec 22 at 21:28

2 Answers 2

You have to verify, at least:

A. if the 3.3V of the RPi can be read as high on the Atmega, if so you can connect them without any resistor.

B. if not, you have to use a voltage adapter (yes, other components and many possible solutions), otherwise you RPi GPIO will be ruined if using a pullup on the 5V.

The pullup and pulldown, in this case, should be used when you are in A and the peripheral support the higher voltage. This is not the case.

share|improve this answer
    
No adapter or pullup is needed - an ATmega at 5v actually has a lower threshold for a "1" than the pi's 3.3v CPU does. –  Chris Stratton Dec 23 at 15:07

I don't have much experience about Arduino boards connected to the Pi, never tried anything other than Arduino Due, but I do have some experiences with ATmega328P directly attached to the Pi. The ATmega is clocked at 12MHz instead of 16 to guarantee a stable state at 3.3V supply voltage.

Physical connection takes 5 signal wires besides the 3.3V power rail, with the ATmega talking with the Pi over SPI as a slave device, using both slave select lines, one at the SS pin and the other at RESET pin. This allows communication over proper hardware interfaces while eliminates the need of a programmer or preprogrammed chips as the ATmega use its SPI interface as ICSP, this setup essentially keep ICSP properly wired to the Pi at all times. An additional pin can be used as a IRQ pin from the ATmega to the Pi.

About the protocol that part is up to yourself. There are endless possibilities and you can implement anything that fits your need and easy to use.

share|improve this answer
    
That's possible, yes, but seems a lot more than what the poster is trying to achieve. USB current limits on various pi models aside, one can also plug the Arduino into the pi's USB instead of a PC's. –  Chris Stratton Dec 23 at 15:10
    
I have built myself a Arduino-like shield for Pi based on this idea. And it uses fresh chips, no bootloader required. –  Maxthon Chan Dec 23 at 15:14
    
That's nice, but a lot more work and not really what the poster seems to be trying to do at this point. –  Chris Stratton Dec 23 at 15:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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