PROJECT 10 – SERIAL COMMUNICATION CONTROL RC SERVO

Wondering how to control the RC servo motor through your PC/laptop? In this project, we are going to explore on how to control two RC servo's position through the serial monitor of Arduino programmer. By sending the position from 0 to 180 will determine the servo position.

PROJECT 10

SERIAL COMMUNICATION CONTROL RC SERVO

Back to Project 9                                                                                                       Go to Project 11
Wondering how to control the RC servo motor through your PC/laptop? In this project, we are going to explore on how to control two RC servo’s position through the serial monitor of Arduino programmer. By sending the position from 0 to 180 will determine the servo position.

———————————————————————————————————————————————————COMPONENT NEEDED

———————————————————————————————————————————————————-
RC SERVO MOTOR
JUMPER WIRE

———————————————————————————————————————————————————-

CONNECTION

———————————————————————————————————————————————————- In this project, there are 2 RC servo motor signal wire (YELLOW) connected to Arduino Duemilanove digital pin-2 and pin-3. RED wire are connected to +5V while BLACK wire connected to ground(GND).

———————————————————————————————————————————————————-

CODE OVERVIEW

———————————————————————————————————————————————————- int value; Assign the value as integer to store the value of servo position from 0 to 180. unsigned int old_value; Store the last value of the servo position. servo1.write(90); Initialize and move the servo1 to 90 degree. old_value = 90; Set and store the position of servo to old_value. If (value > 180) value = 180; Check if the value is larger than 180. if yes then set it to maximum 180. else if (value < 0) value = 0; Check if the value is less than 0. if yes then set it to minimum 0. if(value < old_value) Check if the current value of servo position is less then the old_value or last value. old_value = value; Assign the current value to old_value as the memory for the microcontroller to determine servo position.
Back to Project 9                                                                                                       Go to Project 11
———————————————————————————————————————————————————-

ATTACHMENT

1. P10 User Manual.pdf 2. Project_10_code.zip

BUY

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorail

Dot Matrix Clock With NTP Server Using ESP32
Safe Box Using I2C LCD and 4×4 Keypad On Arduino.
Send Sensor’s Data to ThingSpeak Using Raspberry Pi
Getting Started with Raspberry Pi 4B-1GB Beginner Set
5 Major Upgrades on Raspberry Pi 4 Model B
Scroll to Top