This week assignment was about Communicating wirelessly with a Smart Circuit via a Graphical User Interface (GUI) on android phone .
I made it with two outputs:
fan
servo to open and close the doors
my inspo;
https://www.youtube.com/watch?v=zRcRMdh7F-c
But i made some edits to it to make it more simple.
I used TinkerCad to draw my circuit.
Arduino APP to make my code and transfer it to Arduino UNO board.
Arduino BlueControl APP to control the circuit wirelessly using bluetooth module.
components;
Relay
12v cooling fan
bluetooth module
servo motor
1K ohms resistor
560 ohms resistor
jumpers
arduino uno
USB cable
-at first i make a search for every component to know all about the connections of the circuit and the code of the arduino
for the cooling fan
https://arduinogetstarted.com/tutorials/arduino-controls-fan
About RELAY;
A relay is a programmable electrical switch, which can be controlled by Arduino or any micro-controller. it is used to programmatically control on/off the devices, which use the high voltage and/or high current.
Then i started creating the code on Arduino UNO
CONNECTIONS:
For the cooling fan;
-I connected the positive pin of it to the COM pin of the relay, and the negative pin of it to the ground.
-Then i connected the VCC of the breadboard to the NO pin of the relay.
-i used the yellow wire to connect the the IN pin of the relay to A5 pin of Arduino UNO, the red wire to connect VR pin of the relay to the VCC of the breadboard, the black wire to connect he GND pin of the relay to the GND of the breadboard.
For servo;
-I connected thee SIGNAL pin of the servo to pin 9 of Arduino UNO, the red wire to connect POWER pin of the servo to the VCC of the breadboard, the black wire to connect he GROUND pin of the servo to the GND of the breadboard.
For Bluetooth module;
-I connected the VCC pin of the bluetooth module to the VCC of the breadboard.
-The GND of the bluetooth module to the ground of the breadboard, then i connected the ground to 1K ohms resistor, which was connected to 560 ohms resistor and the RXD pin of the relay to it using then i connected this resistor to pin 1 of the Arduino UNO.
-I connected the TXD pin of the bluetooth module to pin 0 of the Arduino UNO.
For Arduino UNO;
-I connected the 5V power of Arduino UNO to the VCC of the breadboard and the GND of it to the ground of the breadboard.
MAKING THE CIRCUIT PHYSICALLY;
i made the same connection of tinkercad physically.
Connecting the bluetooth module as it was connected in the end of week videos.
using 1K ohms and 560ohms resistors to decrease the voltage so that the Bluetooth module could work without problems cause the arduino uno worked with 5V power and the blutooth module with 3.3V power.
connecting the cooling fan with the relay as i made above on tinkercad website.
connecting the servo to the circuit as i made above on tinkercad website.
press 1 to open the door if you make 3 clicks it will be completely opened
press 2 to close the door if you make 3 clicks it will be completely closed
press 3 to make the cooling fan on through the relay.
press 4 to make the cooling fan off through the relay.
When i uploaded the code to the arduino uno it didn't work, and there was an error, at first i thought that the problem was with my connections so i asked nadine and she told me that she faced the same problem and she advised me to take off the two jumpers which were connected to RXD and TXD pins and finally it worked.
I wanted to use Lamp with the fan instead of the servo but i only had one relay.
also i wanted to simulate the circuit on tinkercad but i didn't find the relay and the bluetooth module, so i used paint APP to edit it.
before
after
i will be able to make the arduino code on Arduino then upload it to the Arduino UNO.