Arduino UNO-Based Servo Control System with Dual Pushbuttons and Rotary Potentiometer
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit consists of an Arduino UNO microcontroller, two pushbuttons, two resistors, a rotary potentiometer, and a micro servo. The circuit is designed to interface with the Arduino UNO to read inputs from the pushbuttons and potentiometer and control the micro servo.
Component List
Resistor
- Description: A resistor with a resistance of 10k Ohms.
- Pins: pin1, pin2
- Properties:
- Resistance: 10k Ohms
Pushbutton
- Description: A pushbutton with four pins.
- Pins: Pin 1 (in), Pin 2 (in), Pin 3 (out), Pin 4 (out)
Rotary Potentiometer
- Description: A rotary potentiometer with a resistance of 10k Ohms.
- Pins: leg1, wiper, leg2
- Properties:
- Resistance: 10k Ohms
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
Micro Servo 9G
- Description: A small servo motor.
- Pins: GND, +5V, PWM
Wiring Details
Resistor 1
- Pin 1: Connected to leg2 of the Rotary Potentiometer and 5V of the Arduino UNO.
- Pin 2: Connected to Pin 1 (in) of Pushbutton 1.
Resistor 2
- Pin 1: Connected to leg2 of the Rotary Potentiometer and 5V of the Arduino UNO.
- Pin 2: Connected to Pin 1 (in) of Pushbutton 2.
Pushbutton 1
- Pin 1 (in): Connected to pin2 of Resistor 1.
- Pin 2 (in): Connected to GND of the Arduino UNO.
- Pin 3 (out): Connected to D2 of the Arduino UNO.
- Pin 4 (out): Not connected.
Pushbutton 2
- Pin 1 (in): Connected to pin2 of Resistor 2.
- Pin 2 (in): Connected to GND of the Arduino UNO.
- Pin 3 (out): Connected to D3 of the Arduino UNO.
- Pin 4 (out): Not connected.
Rotary Potentiometer
- leg1: Connected to GND of the Arduino UNO.
- wiper: Connected to A0 of the Arduino UNO.
- leg2: Connected to pin1 of Resistor 1 and pin1 of Resistor 2, and 5V of the Arduino UNO.
Arduino UNO
- GND: Connected to leg1 of the Rotary Potentiometer, Pin 2 (in) of Pushbutton 1, Pin 2 (in) of Pushbutton 2, and GND of the Micro Servo 9G.
- 5V: Connected to leg2 of the Rotary Potentiometer, pin1 of Resistor 1, pin1 of Resistor 2, and +5V of the Micro Servo 9G.
- A0: Connected to wiper of the Rotary Potentiometer.
- D2: Connected to Pin 3 (out) of Pushbutton 1.
- D3: Connected to Pin 3 (out) of Pushbutton 2.
- D9: Connected to PWM of the Micro Servo 9G.
Micro Servo 9G
- GND: Connected to GND of the Arduino UNO.
- +5V: Connected to 5V of the Arduino UNO.
- PWM: Connected to D9 of the Arduino UNO.
Code Documentation
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup() function is used to initialize any settings or configurations, and the loop() function contains the main code that runs repeatedly. Currently, both functions are empty and need to be filled with the appropriate logic for the circuit's operation.