I decided to choose two action components to create this circuit, I chose DC fan & buzzer to go with.
Software used:
Arduino IDE to upload the code to the Arduino
MIT app inventor to create mobile app interface.
Components:
Arduino Uno
Bluetooth module
5v relay
DC fan
Buzzer
Jumpers
Breadboard
9v Adaptor
Action components: Buzzer & DC fan (referred to by DC motor)
In this circuit Buzzer is connected to pin (2), and relay controlling DC fan is connected to pin (3), thus these two pins are controlled by the Arduino using serial communication via mobile app & Bluetooth.
I started to mount each component to the bread board. I connected a common ground from Arduino to breadboard, And connected the ground of the Buzzer, Bluetooth & Relay to it.
The DC fan is connected to the Arduino and the power source using a 5V relay.
For the Bluetooth module, the GND & VCC are connected to the common ones from Arduino, and TXD & RXD are connected to similar pins on Arduino.
The Code is very simple, it defines 3 variables, 2 integers for the pins of the buzzer and fan, and one character for the serial communication through Bluetooth.
The code structure consists of 4 if loops, each loop takes a character sent via serial communication to make specific task.
1 : turns buzzer on
0 : turns buzzer off
2 : turns fan on
3 : turns fan off
Now it's time to make serial communication through Bluetooth and mobile app (BT Bluetooth )
First: the user interface of 5 buttons
1-bluetooth: to open Bluetooth menu and connect to HC-05 Bluetooth module.
2-Buzzer ON (button 1): it turns the buzzer on by sending text (1) as we defined in the Arduino code.
3-Buzzer OFF (button 2): it turns the buzzer off by sending text (0) as we defined in Arduino the code.
4-Buzzer ON (button 3): it turns the fan on by sending text (2) as we defined in the Arduino code.
5-Buzzer ON (button 4): it turns the fan off by sending text (3) as we defined in the Arduino code.
I started to mount each component to the bread board. I connected a common ground from Arduino to breadboard, And connected the ground of the Buzzer, Bluetooth & Relay to it.
The DC fan is connected to the Arduino and the power source using a 5V relay.
For the Bluetooth module, the GND & VCC are connected to the common ones from Arduino, and TXD & RXD are connected to similar pins on Arduino.
A valuable advice I found online that we start by making simple serial communication before making the actual mobile app, and starting from there we can build on the code and translate it into a user interface .
It help me to know how to connect Bluetooth module and how to deal with it.