In this experiment, we will learn to Control servo using Potentiometer.
- 1 x Arduino Uno ( You can use other boards also )
- 5 x Jumper Wires M-M
- 1 x Ultrasonic Sensor
- 1 x Breadboard
- 1 x Servo Motor
- 1 x 10k ohm potentiometer
- The principle of ultrasonic distance measurement is the same as that of RADAR.
The Ultrasonic module has two Transducers, one for Transmit & the other forare fixed on a single PCB with the control circuit so that it can be easily used in your Robo projects. Ultrasonic distance sensor provides precise, non-contact distance measurements from about 2 cm to 400cm. Ultrasound is a high-frequency sound of frequency 40 KHz (we can’t hear this frequency, but animals can).
- Take Breadboard.
- Fix the potentiometer onto the breadboard as the nob facing towards your side.
- Connect the +5V of Arduino to the vertical side at any point using the jumper wire and GND to another vertical side on the breadboard.
- Now take the servo motor and it has 3 wires normally red, brown and yellow.
- Now connect the Brown wire on the GND vertical line and Red to the +5V vertical line on the breadboard.
- Now connect the yellow wire to the digital pin 9 in the Arduino.
- Now for potentiometer connect the right side pin to the +5v on the vertical side and the left pin on the GND side on the breadboard.
- Now connect the middle pin of the potentiometer to the analog pin (A0) in Arduino.
- Thus the connection is ready.
- Connect Arduino to your Laptop/PC by USB Cable. ( we use A to B USB cable for Arduino which is also used in printers )
- Open Arduino IDE ( You can download it from here or you can use online platform Arduino Web editor )
- Type the code Below given.
- Check program and then upload it.