Posts: 4
Joined: Tue Mar 31, 2020 9:08 pm

Raspberry Pi, Arduino Nano, MPU6050

Tue Mar 31, 2020 9:12 pm

Hi, I wanna know if there is a way to connect RPi to Arduino Nano without using USB, yet allowing me to upload code from RPi to Arduino and also being able to connect Arduino Nano with MPU6050 via I2C.

Posts: 250
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Raspberry Pi, Arduino Nano, MPU6050

Wed Apr 01, 2020 9:25 am

The Pi has two UARTs which can be used for serial communications. See https://www.raspberrypi.org/documentati ... on/uart.md. The Arduino can also do serial communications through USB and also via the RX and TX pins. However, the Pi uses 3.3V logic and the Arduino varies by board type. The Nano uses 5V I think. You will need a logic level converter between them. Your connections will be Pi RX to Ard TX via converter, Pi TX to Ard RX via converter and Pi Gnd to Ard Gnd directly. You will also need to set the communication parameters (baud rate, stop bits, parity, etc) the same at each end.

There are a number of Arduino libraries to use an MPU6050. The Jeff Rowberg library was the main one for a long time, but there are others (FreeIMU, Electronic Cats, etc). These are often based on Jeff's original code.

Return to “Automation, sensing and robotics”