Arduino UNO Bluetooth-Controlled Servo Motor System

Arduino UNO Bluetooth Servo Motor Control | HC-05 + SG90 Project | MakeMindz

Fun & Interactive Projects

Arduino UNO Bluetooth-Controlled Servo Motor System

Control a servo motor wirelessly from your smartphone using an HC-05 Bluetooth module. Perfect for robotics beginners, STEM learners, and anyone building smart automation projects.

🎓 Beginner Friendly 📡 Bluetooth / HC-05 ⚙️ SG90 Servo Motor

Components Required

Gather these parts before starting. The HC-05 and HC-06 are interchangeable; both will work with this project.

🟦
Arduino UNO
Microcontroller board
📡
HC-05 / HC-06
Bluetooth serial module
⚙️
SG90 / MG996R
Servo motor (PWM)
🔌
Jumper Wires
Male-to-male / female
🔋
External PSU
Optional for MG996R
📱
Smartphone
With BT terminal app

How It Works

The project uses serial communication over Bluetooth to pass angle values from a smartphone to the Arduino, which then drives the servo motor to that exact position using PWM signals.

  1. The HC-05 Bluetooth module pairs with your smartphone.
  2. You send an angle (e.g. 90) via a Bluetooth terminal app.
  3. The Arduino reads the value through its hardware serial port (D0/D1).
  4. The Servo.write(angle) function rotates the motor to that position.

Circuit Diagram

Arduino UNO + HC-05 + SG90 Servo — Connection Overview

ARDUINO UNO D0 (RX) D1 (TX) 5V GND D9 (PWM) 5V GND USB-B HC-05 Bluetooth Module TX RX VCC GND 📶 SG90 SERVO Servo Motor Signal VCC (Red) GND (Brn) Wire Colour Key TX → RX (Data) RX ← TX (Data) 5V Power GND Signal (PWM) BT APP Bluetooth Pairing

Wiring Connections

HC-05 Bluetooth Module → Arduino UNO

HC-05 PinArduino PinWire ColourNote
VCC5VRedPower supply
GNDGNDBlackCommon ground
TXD0 (RX)GreenHC-05 transmits → Arduino receives
RXD1 (TX)YellowArduino transmits → HC-05 receives

SG90 Servo Motor → Arduino UNO

Servo WireArduino PinWire ColourNote
SignalD9 (PWM)OrangePWM control signal
Power5VRedUse external PSU for MG996R
GroundGNDBrown/BlackCommon ground

Arduino Code

Upload this sketch using Arduino IDE. Disconnect the HC-05 TX/RX wires from D0/D1 before uploading, then reconnect after flashing.

Arduino C++ — Servo Bluetooth Control
/*
  Arduino UNO Bluetooth-Controlled Servo Motor System
  MakeMindz.com | makemindz.com/2026/02/arduino-uno-bluetooth-controlled-servo.html

  HC-05 connected to D0 (RX) and D1 (TX)
  SG90 Servo signal wire connected to D9
  Send angle values 0–180 via Bluetooth terminal app
*/

#include <Servo.h>

Servo myServo;

const int servoPin    = 9;   // PWM pin for servo signal
const int bluetoothRx = 0;   // Arduino RX ← HC-05 TX
const int bluetoothTx = 1;   // Arduino TX → HC-05 RX

void setup() {
  Serial.begin(9600);          // Match HC-05 baud rate
  myServo.attach(servoPin);    // Attach servo to D9
  myServo.write(90);          // Start at 90° (centre)
}

void loop() {
  if (Serial.available() > 0) {        // Data received?
    int angle = Serial.parseInt();       // Parse integer angle
    if (angle >= 0 && angle <= 180) {  // Valid range check
      myServo.write(angle);             // Move servo
    }
  }
}

Step-by-Step Instructions

1

Install Arduino IDE & Servo Library

Download Arduino IDE from arduino.cc. The Servo.h library is included by default — no extra installation needed.

2

Wire the HC-05 Bluetooth Module

Connect HC-05 VCC → 5V, GND → GND, TX → D0, RX → D1 as shown in the wiring table above. Use a voltage divider (1kΩ + 2kΩ) on the RX line if your HC-05 is 3.3V only.

⚠️ Important: Disconnect D0/D1 wires before uploading code or the upload will fail.

3

Connect the SG90 Servo Motor

Plug the servo's orange/yellow signal wire to D9, red wire to 5V, and brown/black wire to GND. For the MG996R, use an external 5–6V power supply to avoid Arduino brownout.

4

Upload the Sketch

Open Arduino IDE, paste the code above, select Board: Arduino UNO and the correct COM port, then click Upload. Reconnect D0/D1 after uploading completes.

5

Pair HC-05 with Your Smartphone

Power the Arduino. On your phone, go to Bluetooth settings and pair with HC-05. The default pairing PIN is 1234 (or 0000).

💡 Tip: Use the "Serial Bluetooth Terminal" app (Android) or "Bluetooth Screen" (iOS) for sending commands.

6

Send Angle Commands

Open the Bluetooth terminal app, connect to HC-05, and type an angle between 0 and 180 followed by Enter. Watch the servo rotate to that exact position in real time!

🎯 Try: Send 0, then 90, then 180 to sweep the full range.

Simulation Links

Run in Cirkit Designer

Simulate this full circuit online — no hardware needed. Wire the components, paste the sketch, and test Bluetooth angle commands virtually.

🔌

Wokwi Online Simulator

Alternatively, use Wokwi for a browser-based Arduino + HC-05 + Servo simulation with live Serial Monitor.

▶ Open Wokwi

Learning Outcomes & Applications

🎓 What You'll Learn

  • Bluetooth serial communication
  • Serial data parsing with Arduino
  • Servo PWM motor control
  • Mobile-based automation
  • Embedded C++ programming

🚀 Real-World Applications

  • Wireless robotic arm
  • Remote camera positioning
  • Smart door lock
  • DIY home automation
  • STEM robotics education

Related MakeMindz Projects

MakeMindz.com — Arduino, ESP32 & Robotics Projects for Makers

Home  |  Original Post

Comments

try for free