This week I’m building a Bluetooth-controlled cooling fan using an Arduino Uno, a relay module, and a 5 V DC fan. A smartphone sends simple commands over Bluetooth (through an HC-05 module), and the Arduino switches the fan on or off by energizing the relay. I also added a passive buzzer that can play a short “welcome” melody when the system powers up or when a special Bluetooth command is sent.
Software
Arduino IDE
Arduino Bluetooth Control
Wokwi is an online Electronics simulator.
Electronics
Design the circuit using Wokwi
The circuit has two action components—the parts that actually do something when the Arduino sends a command via the BT application:
1) 5 V DC Fan (controlled through a relay module) and it spins to provide airflow when the relay is energized.
2) Buzzer, and it produces audible tones or a short melody for the welcome tone.
The Bluetooth module sends single-character commands to the Arduino:
'1' – Turn fan ON (power on the relay).
'0' – Turn fan OFF (power off the relay).
'W' – Play welcome melody on the buzzer.
Programming Arduino
I developed the code on the Arduino IDE and tested the components
Code Explanation
The circuit’s logic is:
A relay module switches the 5 V fan’s power.
A passive buzzer provides audio feedback for a welcome tone.
An HC-05 Bluetooth module receives commands from a smartphone.
The Arduino runs the following sequence:
Using a SoftwareSerial port on pins 10 (RX) and 11 (TX), it constantly listens for characters sent over Bluetooth.
When the character '1' arrives, an if statement energizes the relay (digitalWrite(fanPin, HIGH)), turning the fan on.
When the character '0' arrives, another if de-energizes the relay, stopping the fan.
If the character 'W' is received, the function playWelcome() plays a three-note melody on the buzzer using tone() commands and short delays.
Through these steps, the Arduino responds in real time to wireless input: it can spin the fan for cooling or play a friendly chime, demonstrating clear control of two different action components.
After uyploading the code to the Arduion UNO board, I connected the BT module to the mobile phone and tested the logic through the terminal.
The final product! [VIDEO]
Arduino Uno has only one hardware serial port (pins 0 and 1). Those pins are also used for USB programming and the Serial Monitor. Connecting the HC-05 directly there means you must disconnect the RX and TX wires before uploading new code, or the upload can fail.
I discovered this the hard way: the first time I tried, I forgot to unplug the RX and TX lines and the sketch wouldn’t upload. However, I kept wondering why tell I found a solution in the next section.
Through online documentation and forum posts I learned that the Arduino Uno has only one hardware serial port (pins 0 and 1). Those pins are also used for USB programming and the Serial Monitor. Connecting the HC-05 directly there would mean disconnecting it every time I upload new code.
The guides explained that the SoftwareSerial library solves this by creating a second, “virtual” serial port on any digital pins. That’s why so many examples choose pins 10 (RX) and 11 (TX): the Bluetooth module’s TX connects to Arduino 10, and its RX connects to Arduino 11, leaving the hardware RX/TX free for USB communication.
This week I learned how to integrate different action components—a relay-driven fan and a passive buzzer—while controlling them wirelessly through a Bluetooth module and Arduino code. These skills are directly useful for my final project because it will also require coordinating multiple outputs. Understanding how to wire and program separate action components, manage power for each, and trigger them with different commands gives me the foundation to add more devices such as lights, motors, or sensors later on.
Title of Media