Bukit Mertajam, Penang

PROJECT 10 – SERIAL COMMUNICATION CONTROL RC SERVO

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-3RED 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

[vc_cta h2=”” style=”outline” color=”white” add_button=”left” btn_title=”Male to Male Jumper Wire” btn_color=”orange” btn_i_icon_fontawesome=”fa fa-opencart” btn_css_animation=”appear” css_animation=”appear” btn_link=”url:http%3A%2F%2Fwww.cytron.com.my%2Fp-wr-jw-mm65||” btn_add_icon=”true”][/vc_cta]
[vc_cta h2=”” style=”outline” color=”white” add_button=”left” btn_title=”Arduino Uno Rev3-Main Board” btn_color=”orange” btn_i_icon_fontawesome=”fa fa-opencart” btn_css_animation=”appear” css_animation=”appear” btn_link=”url:http%3A%2F%2FArduino%20Uno%20Rev3-Main%20Board||” btn_add_icon=”true”][/vc_cta]
[vc_cta h2=”” style=”outline” color=”white” add_button=”left” btn_title=”RC Servo Motor (Plastic Gear)” btn_color=”orange” btn_i_icon_fontawesome=”fa fa-opencart” btn_css_animation=”appear” css_animation=”appear” btn_link=”url:http%3A%2F%2Fwww.cytron.com.my%2Fp-hd-3001hb||” btn_add_icon=”true”][/vc_cta]

Related Posts

Leave a comment

Get 7 Tips for Developing Electronic Projects
We respect your privacy.
Loading...