This week assignment is to Communicate wirelessly with a Smart Circuit via a Graphical User Interface (GUI) on your phone or PC.
the idea of this week is a little related to the idea of week 7 since it is also an alarm system works wirelessly with a Smart Circuit via a Graphical User Interface (GUI) on my phone.
this circuit is about an buzzer as an alarm and fan to get the smoke out when there is fire.
Software:
-Arduino IDE to upload the code.
-Arduino Bluetooth Control for Bluetooth module.
-Circuito.io for wiring diagram.
Materials:
-Arduino UNO
-MINI Breadboard
-Jumper wires.
-Buzzer.
-HC-05 Bluetooth Module.
-9v power adapter.
-Fan
-Relay module.
components
relay module wiring
Bluetooth module wiring
Workflow:
Connected the fan with relay module as follows:
1.NO "normally open" with positive of power supply.
2.COM "general" with positive of Fan.
3.IN "signal" with pin of Arduino.
4.GND with ground of power supply.
5.VCC "+5V" with 5V pin of Arduino.
connected the buzzer as follows:
1. positve of buzzer with digital Arduino pins .
2.negative of buzzer with ground of power supply.
connected the Bluetooth module as shown at "Bluetooth module wiring " picture.
1. Vcc pin with 5v of Arduino.
2.gnd pin with main ground of the circuit.
3.Tx pin with RX Arduinio pin.
4.Rx pin with TX Arduinio pin.
i connected all components at the bread board as shown at the picture:
-fan connected with relay module to control it with Arduino and be powered by the power source with suitable voltage.
-Bluetooth module connected with Arduino also Arduino is the power source of it.
-buzzer connected with pin at Arduino and other with ground.
then i started to code each part separate.
code description:
-when power is on and Bluetooth module is on i connect the Bluetooth module with the "Arduino bluecontrol app".
-I coded the fan and the buzzer as following:
-when i press number 1 at the Arduino BluControl app the fan works, and when i press number 2 the buzzer works.
and if the pressed number was not fan or buzzer the fan and the buzzer is off.
cicuit
i faced two problems at this task :
first one is related with the relay module wiring where the power supply wires were not correct so take some time to realize the problem, to solve this problem i check the conductivity of each wire and rewired each component, at the end i figured the problem.
second one was related to the code and it was a silly one and also i take sometime to notice it. the problem was that i forgot the dash before and after the input number from the serial data '1' and '2' at "incoming data" integer..
code
relay module
using the relay module and solving the problems i faced with it sure will help me at my final project where the relay module is a part of my final project.
using Bluetooth module is such a cool thing.
Bluetooth module