The Idea is to create smart circuit contains Fan and Buzzer and control them viva mobile Bluetooth.
this idea can used as do smart ventilation system to control by Bluetooth also use a buzzer as alarm system in case of emergency.
I used different Thing as below:-
A- Tinkercad to do simulation for the blender components.
B- Bread board, wires, Fan 5V, Buzzer, arduino UNO board, Bluetooth module.
C- BT Terminal App.
The process of simulating come as below:-
Open tinkercad website.
Log in the account.
Choose create circuits.
Add Arduino UNO board ,breadboard and Buzzer , Fan to the work space.
Assemble all components together as the picture attached.
Write the code.
Run the simulation to stand on the result.
Write from 1 to 4 on Serial monitor to stand on the result of change.
The implementation process come as STEPS:-
first prepare the components on the work area as below:
Buzzer.
5V fan.
Arduino Uno board.
wire to connect all components together in the breadboard.
USB to Arduino connector to get the power.
Bluetooth Model.
Second create the circle :
connect positive and ground from Arduino board to bread board.
connect the Buzzer positive on digital pin 7 and the ground on the bread board.
connect fan positive on digital pin 8 and ground on the board.
connect Bluetooth model on the positive and ground and( TX & RX as ( opposite position)).
Upload the code to the Arduino board.
Connect the mobile App BT Terminal to the Bluetooth model.
Note: you shall disconnect the Bluetooth model TX & RX from Arduino board before uploading code from Arduino software to Arduino board because they are using the same serial port which will not transfer data from software to board.
char recData = '0';
#define FAN 8
#define BUZ 7
void setup() {
Serial.begin(9600);
pinMode(FAN, OUTPUT);
pinMode(BUZ, OUTPUT);
}
void loop() {
while (Serial.available() == 0)
;
recData = Serial.read();
Serial.println(recData);
if (recData == '1') {
digitalWrite(FAN, HIGH);
digitalWrite(BUZ, LOW);
} else if (recData == '2') {
digitalWrite(BUZ, HIGH);
digitalWrite(FAN, LOW);
} else if (recData == '3') {
digitalWrite(FAN, HIGH);
digitalWrite(BUZ, HIGH);
} else {
digitalWrite(FAN, LOW);
digitalWrite(BUZ, LOW);
}
}
The code show as below:-
Identify FAN & BUZ pin number.
read from serial.
If condition
A- Press on 1 mean run the fan.
B- Press on 2 Mean run the Buzzer.
C- Press on 3 mean run both of Fan & Buzzer.
D- Press on 4 Mean Stop both Fan & Buzzer.
The challenge was problem when I try to connect the Bluetooth model to the mobile, so I can't find the Bluetooth name, I though it is not working but after do brainstorming to stand on the problem I found the i shall do pairing between the Mobile and Bluetooth model before using the APP BT terminal.
This skill would help me to connect the final project device with the Bluetooth so I can control it and how to use Bluetooth module.