Arduino Project

Arduino Servo Motor Control with Potentiometer V3

Course Introduction

This project creates a servo angle controller using an Arduino, a rotary encoder, a push button, and three LEDs.

Users rotate the encoder to adjust the servo angle and press the button to toggle step sizes (1°, 5°, 10°). The LED color indicates the current step size: red = 1°, yellow = 5°, blue = 10°.

Note

If this is your first time working with an Arduino project, we recommend downloading and reviewing the basic materials first.

1.1 Install Arduino IDE(Important)
1.2 Introduction of Arduino IDE

Required Components

In this project, we need the following components:

SN

COMPONENT INTRODUCTION

QUANTITY

PURCHASE LINK

1

Arduino UNO R4 Minima/Arduino UNO R4 WIFI

1

2

USB Type-C cable

1

×

3

Breadboard

1

BUY

4

Wires

Several

5

Digital Servo Motor

1

6

Rotary Encoder Module

1

7

LED

3

8

1kΩ resistor

3

Wiring

3.webp__PID:00e8d3a2-b49f-4c16-a036-7aff2ee5b8ac

Common Connections:

Digital Servo Motor
Connect to breadboard’s positive power bus.
Connect to breadboard’s negative power bus.
Connect to 3 on the Arduino.

rotary encoder
CLK:
Connect to 12 on the Arduino.
DT: Connect to 11 on the Arduino.
SW: Connect to 10 on the Arduino.
GND: Connect to breadboard’s negative power bus.
VCC: Connect to breadboard’s red power bus.

LED
Blue
Connect the LEDs anode to a 1kΩ resistor then to the negative power bus on the breadboard, and the LEDs cathode to 7 on the Arduino.
Yellow Connect the LEDs anode to a 1kΩ resistor then to the negative power bus on the breadboard, and the LEDs cathode to 6 on the Arduino.
Red Connect the LEDs anode to a 1kΩ resistor then to the negative power bus on the breadboard, and the LEDs cathode to 5 on the Arduino.

Writing the Code

Note
You can copy this code into Arduino IDE.
Don’t forget to select the board(Arduino UNO R4 Minima/WIFI) and the correct port before clicking the Upload button.