Doing the Weekly assignment about Communicating wirelessly with a Smart Circuit via a Graphical User Interface (GUI) on your phone or PC.
I was inspired by this project on youtube smart home
My idea for this week was to upgrade week 7 as it was about rotating the joint when the LDR sensor senses the light which is related to my final project
The upgrade is to control a lamp light and rotate the servo wirelessly.
Arduino Bluetooth Control " Andriod Phone for mobile Connection GUI. "
relay module
Arduino Uno
Relay module to control the 9v lamp
Resistor 1Kohm to limit the current
servo motor
breadboard
jumper male-male
Lamp
crocodiles
relay module
First, I wanted to simulate and check it's functionality of the design in tinker cad but I didn't find the component
So I started to connect the circuit to the breadboard directly
connecting the relay module GND by following the wiring diagram that was in HANDS -ON activity in week 7
then connecting the lamp to the relay module by pin NO and to the beard board
for the Bluetooth module, I connected it on the breadboard, connected the GND and the 5V to the Arduino, and Pins TXD to RX, and Pin RX to two resistors then to TX in Arduino
finally connected the power adapter to the breadboard
simulation on fritzing
define the servo (#include <Servo.h>) and their Arduino pins
choose the pin mode for led ( output)
Activated the serial monitor and gave a rate of (9600) to use it for the Bluetooth module.
At First, I followed the sequence in the video (Wireless serial communication (Controlling an LED Via BT Terminal App and Bluetooth Module) `)
make a while that allows to Bluetooth module to receive data while it was sending
I made char "a " to store data sent by mobile connecting on it.
THEN the cases
if a= 1 then turn on the lamp
if a = 0 then turn off the lamp
The cases
if a= 1 then rotate servo with angle 90
if a = 0 then rotate servo with angle 0
I started to download the code on Arduino
In order to allow me to control and send data to the Bluetooth module and the Bluetooth module sent this data to Arduino. I downloaded the software "Arduino Bluetooth Controller"
connect all components with each other and check their functionality
The Arduino cable wasn't working so I changed it with another one
The problem was that I wanted to simulate and check functionality of the design in tinker cad but I didn't find the component
The solution is to use fritzing software for the graphical wiring of the circuit and searched for the missing components online to make a typical circuit to the actual one
It was difficult for me to control the circuit from the phone using "Arduino Bluetooth Controller" as it was my first time but I paired Successfully at the end
The manual mechanism of my final project
How the mechanism manually works using "Arduino Bluetooth Controller"
The coolest thing was making the mechanism of my final project work and simulate in on fusion 360