Controlling an Arduino from a Pi3 using I2C

Demonstration of the I2C protocol. A simple example of turning the Arduino's internal LED on from a Raspberry Pi using I2C

Feb 2, 2018

39094 views

6 respects

Components and supplies

1

Raspberry Pi 3 Model B

1

Arduino UNO

Project description

Code

Python code

python

This is the controller code

Arduino sketch

c_cpp

Python code

python

This is the controller code

Downloadable files

i2c_bb_CpSIoWgNh0.png

i2c_bb_CpSIoWgNh0.png

i2c_bb_CpSIoWgNh0.png

i2c_bb_CpSIoWgNh0.png

Comments

Only logged in users can leave comments

Anonymous user

2 years ago

Did you consider the 3v3 versus 5v issue? In theory connecting a Raspberry Pi to an Arduino Uno as you have could destroy the Pi. See https://www.robotshop.com/letsmakerobots/running-both-5v-and-33v-devices-i2c and many other sources.

Anonymous user

4 years ago

Hi first i followed the picture for the connection and then i got an error so i tried the connection in de text "Connect the Arduino to the Pi according to the schematic. The shematic is a little unclear, so note that the red wire connects to Pi physical pin 6, and the ground to pin 2." and my arduino blew up. Its the other way around the red wire connects to Pi physical pin 2, and the ground to pin 6. Hope i saved some arduinos!

Anonymous user

7 years ago

Did you consider the 3v3 versus 5v issue? In theory connecting a Raspberry Pi to an Arduino Uno as you have could destroy the Pi. See https://www.robotshop.com/letsmakerobots/running-both-5v-and-33v-devices-i2c and many other sources.