Top Ad unit 728 × 90

Raspberry Pi Control Servo Moto with Source Code

Sample to show you how to simple control Servo moto:

The angle of rotation of the servo motor:
  Usually, when receiving the pulse width is 1ms, the servo will turn to 0 degree angle and pulse width 2ms after receiving it will turn to the corner angle 180. The remaining 2 linearly with this milestone. In fact two landmark 1ms, 2ms 0 degrees and 180 degrees are usually composed of errors due to each engine so we need to experiment on the engine to determine the 2 landmark. In the case of motor used, that is musty 0,4ms 2, 0 degrees and 2,4ms, 180 degrees

Wiring Connection:
As seen on the picture will have external power supply (4 * AAA battery, 1.2V) for servo motor without using Raspberry Pi from the line is to prevent too large and damaging Pi. However, you also have to note one thing is connected to GND of the source of the Raspberry Pi servo and GND (pin 6) as shown. Thus, the new servo can understand PWM from Pi

Video: Ongoing...[Will update on youtube channel: funPi]
Source Code:

import RPi.GPIO as GPIO
import time
while True:
      time.sleep(1) # Dừng 1 giây để motor quay đến vị trí
Raspberry Pi Control Servo Moto with Source Code Reviewed by Unknown on December 19, 2016 Rating: 5

No comments:

All Rights Reserved by JackyLe © 2018 © 2017
Edit bởi: Jacky Le | Youtube Channel: JACKY LE

Send email form


Email *

Message *

Powered by Blogger.