USB Serial Communication Between Arduino and Raspberry Pi

USB Serial Communication Between Arduino and Raspberry Pi

Introduction

Communication between 2 controllers is quite helpful. It can unlock more possibilities and also be able to do task simultaneously. Previously, I have shared how to do communication between Raspberry Pi and Arduino using I2C communication. Now, instead of using I2C, I will show you how to do it through USB cable and using serial communication. This setup also possible to program Arduino board using Raspberry Pi.

Video

This video will show you how to do serial communication between Arduino and Raspberry Pi through USB cable.

 

Hardware Preparation

This is the list of items used in the video.

Sample Program

This is the sample code used in the video for Arduino (top) and Raspberry Pi (bottom).

 

Thank You

References:

  1. Python Serial library - PySerial
  2. Library to control GPIO on Raspberry Pi - gpiozero

Thanks for reading this tutorial. If you have any technical inquiry, please post at Cytron Technical Forum.

Related Products