This week idea is based on connecting the project via Bluetooth for control using a mobile phone or laptop. So, I thought about using components that I haven't used in any previous assignments, such as a fan and a temperature sensor.
The assignment idea is:
The temperature sensor reads the temperature.
When it reaches a certain level, the fan turns ON.
When the temperature drops below the threshold, the fan turns OFF.
A buzzer sounds when the fan turns ON or OFF.
FOR Simulation Circuit
To simulate the circuit and ensure it works with the correct connections.
Electronics Tools
Breadboard
Dc Fan
Jumpers Wires
Arduino Uno
Slide Switch
Buzzer
Resisotrs
Md-BT-18
Gui on Phone
Arduino BleuControl
Design Circuit on Tinkercad:
Circuit Components:
DHT11 (Lm35 in tinkercad)
Dc Fan
Buzzer
Circuit Input:
DHT11 sensor
Circuit Actions:
Fan On
Fun Off with buzzer sound
Steps Taken:
Connected the Ground and 5V between Arduino and breadboard
Connected the DHT11 with Pin 2
Connected Buzzer with Pin 5
Connected Dc Fan with Pin3
Build Circuit on actual Arduino and Breadboarding
I connected the circuit on a real Arduino and breadboard, following the wiring from TinkerCAD without any difficulties. Then, I connected the Bluetooth module and finally plugged it into my laptop to ensure everything was working properly.
Code
First, I displayed the DHT11 library and code in Arduino, then copied it to add the rest of the code Then, I defined the variables and set each pin as input or output according to my wiring. After that, I wrote the code:
The DHT11 sensor measures the temperature continuously.
If the temperature reaches 25°C, press '1' in the Bluetooth app to turn ON the fan.
If the temperature drops to 20°C, the buzzer will beep for a second.
After the buzzer sounds, press '2' in the Bluetooth app to turn OFF the fan.
The system repeats this process every 1 second.
Code
Title of Media
When I first connected the Bluetooth module, it wasn’t connecting from the mobile phone and kept showing "Couldn't connect". Then I remembered that I had faced this issue before, and it was because the RXD pin of the Bluetooth module receives a voltage lower than 5V. So, I connected a voltage divider using two 1kΩ resistors, and it worked.
voltage divider Wiring
RXD Use 3.3v
Title of Media