Introduction: Easily Control Servo Motor Using Arduino and PCA9685 16 Channel PWM Module

Picture of Easily Control Servo Motor Using Arduino and PCA9685 16 Channel PWM Module

Servo motor is one of the most widely used actuators in the field of science and robotics. They used in a large number of applications which are critical in position control. We cannot use DC motor to control a tail of aircraft because controlling a DC motor for accurate positioning is not only difficult but almost impossible.

This tutorial will show you how to control servo motor using arduino nano and an easy to use Servo motor driver.
The PCA9685 is a 16 Channel 12 Bit PWM I2C-bus controlled Servo motor Driver. The Driver can very easily connected to your arduino, Raspberry Pie and easily programmed to control single or multiple servo motors and make your own RC plane, car, ship, quadrapod, hexapod or anything you want.

Step 1: All You Need Is

Picture of All You Need Is

Arduino Nano
Or any arduino board which will be the controlling centre of our project

Voltage Regulator Module
For providing controlled and stable DC source for the working of servo motors as well as internal chips.

PCA9685 16 Channel 12 Bit PWM I2C-bus controlled Servo motor Driver
The PCA9685 is a 16 Channel 12 Bit PWM I2C-bus controlled Servo motor Driver. The Driver can very easily connected to your arduino, Raspberry Pie and easily programmed to control single or multiple servo motors and make your own RC plane, car, ship, quadrapod, hexapod or anything you want.

Servo Motor
Servomotor is a rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity and acceleration. It consists of a suitable motor coupled to a sensor for position feedback.

Step 2: The Regulator

Picture of The Regulator

Here, I used an easy to use voltage regulator circuit for hobbyist. This can be used in arduino, Raspberry Pi projects. Easy and Efficient Voltage Adjustment.

The video embedded on this Step will show you how to setup your own voltage regulator.

There are two pins on the driver board for power; VCC and V+. It is important that, for the working of the IC inside the motor driver, 5V power supply is required. This 5 V can be provided from arduinos 5 V pin as I did. Arduinos 5 V should be connected to VCC only and not V+. V+ is used to power the motor. It will take more current than VCC.

Setting Up the Regulator - Follow the Link to setup your own Regulator in 5 minutes

Step 3: Connections

Picture of Connections

After setting up the regulator, Follow the above schematics and connect the arduino board and Driver board

The SDA and SCL will be different for different arduino board. Just do a quick google search for the correct pins. I have mentioned some below.

Uno, Ethernet -----A4 (SDA), A5 (SCL)
Mega256020 ----- (SDA), 21 (SCL)
Leonardo ----- 2 (SDA), 3 (SCL)
Due ----- 20 (SDA), 21 (SCL), SDA1, SCL1

Step 4: The Code

Picture of The Code

Do all the connections and make sure to double check it.

Download and install adafruit library from here and launch arduino IDE

Below is a simple code for controlling a single Servo

Step 5: Let It Spin

Once the code is uploaded, if all the connections are correct, it should start the motor.

Now its time for you to start the game. Let me know you views on the comment.

Comments

kumarmkm (author)2017-08-14

Great job , i did it.