This week’s assignment was to build an electronic circuit with at least two outputs controlled by a Bluetooth module. I designed a small system that controls a fan, a lamp, and a servo motor, all operated from a mobile phone.
I care about this idea because it makes everyday life more convenient, like managing the room’s ventilation, lighting, and curtains remotely. My inspiration came from imagining how useful it would be to control these devices right after coming home from work.
Picture 1
Picture 2
For Practical Implementation :
Breadboard
Adpter 5v
Jumper wires
Arduino
Bluetooth Module HC-05
Servo Motor
Fan
Lamp
RGB led
Avometre
Electrinic circuit in Fritzing :
To design and prepare my project I used Fritzing, which allows creating and simulating electronic circuits before building them in real life. Here are the main stages I followed:
Steps to build the circuit on Fritzing :
I logged into Fritzing and selected the electronic circuits section
From the component search bar, I selected the following parts:
Arduino Uno,
breadboard,
Lamp,
fan,
servo motor,
and bluetooth module.
Picture 1
Picture 2
The project includes three main components that perform actions:
Fan, connected through a relay to the Arduino, it represents the room’s ventilation system.
Lamp, also connected via a relay to the Arduino, it simulates the room’s lighting.
Servo Motor, directly controlled by the Arduino, it simulates the automatic opening and closing of the curtains.
Arduino Bluetooth Controller :
Coding With Arduino IDE :
Including Libraries and Defining Pins: I started by calling the necessary libraries, such as the servo motor. Then, I defined variables to represent the Arduino pins for each input and output component.
Initializing Components: Next, I initialized the outputs and actions components. I used myservo.attach() to activate the servo motor, Serial.begin() to enable serial communication.
Using Conditions with If Statements: I then programmed the conditions that control the actions components. For example, if the user select 1, the servo motor will turn 90 degre, and if he select 0 the servo will turn -90 degre. If the user select 2, the lamp will turn on, and if he select 3, the lamp will turn off. Finally if the user select 4, the fan will turn on, and if he select 5,the lamp turn off.
THE CONSTRUCTION STEPS :
1-Power Setup : I connected the Arduino to the breadboard, linking the 5V pin to the positive rail and the GND pin to the negative rail. Then, I connected two power adapters to supply the fan and lamp.
Picture 1
Picture 2
2-Fan Connection : The fan was connected to the Arduino and power supply through a relay module. The relay ensured safe switching, with the control pin linked to Arduino digital pin 11.
Picture 1
Picture 2
Picture 3
3-Lamp Connection : Similarly, the lamp was connected using another relay. One terminal was connected to the adapter, the other through the relay, with the control pin linked to Arduino digital pin 10.
Picture 1
Picture 2
4-Servo Motor Connection : The servo motor, which operates at 5V, was connected directly to the breadboard’s power rails. Its control signal was linked to Arduino digital pin 9.
Picture 1
5-Bluetooth Module Setup : Finally, I added the Bluetooth module. The VCC and GND pins were connected to the breadboard’s power rails, while the TX and RX pins were connected to the Arduino’s RX and TX pins. (Important: the TX/RX connections must be removed before uploading the code.)
Picture 1
Picture 2
The final Result :
One of the main challenges I faced during this project was related to the output voltage configuration of the relays. I used two relays to power both the lamp and the fan, but during the first tests, neither of them turned on because the current was too high and the relays were not switching properly. After some troubleshooting, I remembered a video shared by Mai in our group, which explained that the small yellow jumper on the relay module must be connected to the 5V pins for the relay to operate correctly. Once I applied this solution, the relays worked as expected and both the lamp and the fan were successfully powered.