Rasperry pi with i2c arduino leonardo

arduinoi2craspberry pi

I'd like to connect a Raspberry Pi A+ with an Arduino leonardo. I'd like the rapsi to be able to upload HID sketches on the arduino.Then I'd like the arduino to run the sketch over the USB interface which is connected to a laptop for example.
Is it possible?

The i2c connection seems to be easy to make: only 3 wires to plug. However I'd like to know if a single power supply was possible? For example only the raspi or only the Leonardo. I planned to provide energy to my raspi and plug a single wire between the two +5V of the devices. I read it could work but it was not safe at all. Is there a simple and safe way to proceed ?

Best Answer

Yes, there is a safe and simple way to proceed.

The Arduino can be powered from a +5V source (connected to the 5V) pin. The schematic allows for both 5V from the Arduino's voltage regulator or 5V from an external source (like from USB) with protection for the LDO. So you can supply unregulated power to the RaspberryPi and use it's regulated 5V to power the Arduino.

If doing this, I'd suggest powering the RaspberryPi with a source > 5V. From what I've seen the RaspberryPi's voltage regulator can supply up to 1A of current. This will be shared between the RaspberryPi and the Arduino. So, you'd need to keep an eye on your design to ensure the overall current consumption stays below 1A.