I2C Raspberry Pi Arduino - Controlling Servo Motor

I2C Raspberry Pi Arduino - Controlling Servo Motor

INTRODUCTION

Besides digital and analog interface through I2C, we can utilize it to control a PWM (pulse width modulation). Raspberry Pi runs Raspbian OS – which is not a real time operating system (RTOS). It is a bit difficult to produce fix PWM especially to control servo angle. Combination between Raspberry Pi and Arduino, can help to solve this problem. In this tutorial, we will show you how to communicate between Raspberry Pi and Arduino through I2C communication, thus controlling a servo motor.

VIDEO

This video will show you how to control a servo motor through I2C communication between Raspberry Pi and Arduino.

 

HARDWARE PREPARATION

Item used in the video.

I2C Servo Pi Arduino Wiring
I2C Servo Pi Arduino Top

SAMPLE CODE

This is the sample code for Arduino and Raspberry Pi used in the video.

 

Thank You

References

  1. Controlling an Arduino from a Pi3 using I2C
  2. i2c python documentation
  3. Raspberry Pi SPI and I2C Tutorial
  4. Master Writer/Slave Receiver

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

Related Products