This project allows you to control the position of a servo motor based on the rotation of a 10k potentiometer. The servo motor's movement will range from 0° to 180°, corresponding to the potentiometer's minimum and maximum positions.
Parts Required
- Arduino Nano
(Microcontroller for processing the potentiometer input and controlling the servo motor) - Servo Motor
(A small motor with a gear mechanism that can rotate to specific angles) - 10k Potentiometer
(For adjusting the servo position) - Breadboard
(For circuit assembly) - Connecting Wires
(To connect components) - Power Supply
(5V USB or external power supply for the Arduino Nano)
Circuit Diagram
Here's how to connect the components:
Potentiometer Connections:
- Middle pin: Connect to A0 (analog pin) on the Arduino Nano.
- One side pin: Connect to 5V.
- Other side pin: Connect to GND.
Servo Motor Connections:
- Signal (Orange): Connect to D9 on the Arduino Nano.
- VCC (Red): Connect to 5V.
- GND (Brown): Connect to GND.
Circuit Diagram
Video Link: - Click Here For Video
How To Control a Servo Motor with a Potentiometer DIY Project using Arduino NANO & Servo Motor by WTC Zone simple Circuit: -
Arduino IDE Program
Code for Controlling a Servo Motor with a Potentiometer DIY Project using Arduino NANO & Servo Motor by WTC Zone
#include <Servo.h>
Servo myServo;
const int potPin = A0;
const int servoPin = 9;
int potValue = 0;
int angle = 0;
void setup() {
myServo.attach(servoPin);
Serial.begin(9600);
}
void loop() {
potValue = analogRead(potPin);
angle = map(potValue, 0, 1023, 0, 180);
myServo.write(angle);
Serial.println(angle);
delay(15);
}
Share, Support, and Subscribe!!! 1. PRO KAM EXPLAINED 2. Knowledge KAM 3. PRO KAM Follow us on 1. Facebook 2. Instagram 3. Pinterest 4. Blogspot 5 Twitter If you have any other ideas to make me design, you can describe them in the comment section and if I can, I will make a designing video on it. So I am waiting #prokam #wtc #Arduino #ideas #projects #diy #how #to #ArduinoProjects #UltrasonicSensor #HeightMeasurement #TechDIY #WeTechCreators #wtczo
0 Comments