Securing The Future Bit By Bit

Tuesday, July 23, 2019

Servo motor interfacing with Raspberry pi 3

In this blog,I will explain you how to interface servo motor with Raspberry pi 3.



This project uses Python scripts run on a Raspberry Pi microcontroller to send GPIO PWM outputs to a servo motor to set its angle. If all that sounds confusing, don't worry, I'm about to explain it.

Components Required

1. Raspberry pi 3
2. Servo motor
3. Jumper wires

Circuit Diagram


Connections

Raspberry pi-----------------------------Servo motor
  VCC(pin2)-------------------------------Servo red wire
  GND(pin39)-----------------------------Servo black wire
  GPIO4(pin7)----------------------------Servo orange wire

A servo motor is a type of DC motor that, upon receiving a signal of a certain frequency, can rotate itself to any angle from 0-180 degrees. Its 90 degree position is generally referred to as 'neutral' position, because it can rotate equally in either direction from that point.

Procedure

Step1- Make connection as shown in above figure.
Step2- connect red wire of servo to pin2 of raspberry pi and black wire of servo to                    pin39 of raspberry pi and orange wire of servo to pin 7 of raspberry pi.
Step3- Download the code from given link.
Step4- Open the downloaded file in python software.
Step5- If you want change the GPIO pin just edit it with your own GPIO pin.
Step6- Run the program anf you will see servo start moving.

 Download the code from here

Media Gallary


Share:

0 comments:

Post a Comment

ElectrocoreDIY.com

Search This Blog

Blog Archive

Powered by Blogger.

Privacy Policy