Smartphone-Controlled Servo Motor Using Arduino UNO

Arduino 27-07-26
9 0

Tutorial plan

1- Objective of the project

2- Required Components

3- Circuit Connections of system

4- Arduino program

5- The mobile app for controlling the servo motor

 

Objective of the project

The objective of this project is to control the position of a servo motor wirelessly using a smartphone. The smartphone sends the desired angle via Bluetooth to the HC-06 Bluetooth module, which communicates with the Arduino UNO. The Arduino processes the received command and controls the servo motor so that it rotates to the requested angle.

How the System Works ?

1- The user selects the desired servo motor angle using a mobile application on the smartphone.

2- The smartphone sends the angle command via a Bluetooth connection.

3- The HC-06 Bluetooth module receives the command and transfers it to the Arduino UNO through serial communication.

4- The Arduino UNO reads and processes the received angle.

5- The Arduino generates the appropriate control signal for the servo motor.

6- The servo motor rotates and positions itself at the requested angle.

 

Required Components

1. Arduino UNO

Arduino Uno

The Arduino UNO is the central controller of the system. It receives the Bluetooth data from the HC-06 module, interprets the received commands, and generates the appropriate Pulse Width Modulation (PWM) control signals required by the servo motor. The Arduino executes the programmed instructions to accurately position the servo shaft.

2. HC-06 Bluetooth Module

module HC-06

The HC-06 is a Bluetooth serial communication module that establishes a wireless connection between the smartphone and the Arduino UNO. It receives commands sent from the mobile application and transmits them to the Arduino through UART (serial) communication. The HC-06 operates as a slave device and is easy to pair with Android smartphones.

3. Servo Motor

The servo motor is the output actuator of the system. It converts the PWM control signals generated by the Arduino into precise angular movements. Depending on the command received from the smartphone, the servo rotates to the desired position, typically within a range of 0° to 180°, making it suitable for robotic arms, smart locks, automated doors, and other positioning applications.

4. 5 V / 3.3 V Power Supply

The power supply provides the electrical energy required by the electronic components.

5. Jumper Wires

Jumper wires

Jumper wires are used to make the electrical connections between the Arduino UNO board, the GPIO expansion board, the HC-06 module and the servo motor.

6. Breadboard

The breadboard is a solderless prototyping board used to build and test electronic circuits quickly and easily.

 

Circuit Connections of system

 

1- Connecting the HC-06 module to the Arduino UNO board

Module HC-06 Arduino UNO
VCC 5V from the power supply module
GND GND
TXD D2
RXD D3

 

2- Connecting the servo motor to the Arduino UNO board

Servo motor Arduino UNO
Red wire (+) 5V
Brown wire (-) GND
Yellow wire (S) D4

Arduino program

This program enables wireless control of a servo motor using an Arduino UNO, an HC-06 Bluetooth module, and a smartphone application. The smartphone sends the desired servo angle via Bluetooth, and the Arduino receives the command and moves the servo motor accordingly. This type of system is commonly used in robotics, home automation, and remote-control applications.

The mobile app for controlling the servo motor

Download application

 

The mobile application was developed using MIT App Inventor to provide a simple and intuitive interface for remotely controlling a servo motor through Bluetooth communication. It enables users to connect an Android smartphone to an HC-06 Bluetooth module and adjust the servo motor's position in real time.

At the top of the application, the title "Controlling Servo Motor" clearly indicates the purpose of the program. Below the title, the "Choose HC-06" button allows the user to search for and connect to the paired HC-06 Bluetooth module. Once the Bluetooth connection is established, the smartphone can communicate wirelessly with the Arduino UNO.

The center of the application displays an image of a servo motor, providing a visual representation of the device being controlled. This makes the interface more user-friendly and helps users easily identify the actuator associated with the project.

Beneath the image, a label displays the current servo position in the format "Angle: 0°". This value is updated as the user changes the servo angle, allowing the user to monitor the selected position before or after sending the command.

At the bottom of the interface, a slider serves as the main control element. By moving the slider, the user selects the desired rotation angle of the servo motor, typically between 0° and 180°. Each time the slider position changes, the application converts the selected value into a text message and transmits it via Bluetooth to the HC-06 module. The message is terminated with a '#' character, which acts as an end-of-message delimiter. For example, if the slider is set to 90°, the application sends the command 90#.

The HC-06 module receives this Bluetooth message and forwards it to the Arduino UNO through serial communication. The Arduino interprets the received angle and generates the appropriate PWM signal to move the servo motor to the requested position. This communication process occurs almost instantly, allowing smooth and responsive real-time control.

Overall, the MIT App Inventor application provides an easy-to-use graphical interface that eliminates the need for physical buttons or wired connections. By combining Bluetooth communication with a slider-based control system, it offers an efficient and convenient solution for remotely positioning a servo motor in educational, robotic, and home automation applications.

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

Pictures of the articles

Robotic site created by Mohamed Ali Haj Salah - Teacher info