The assignment of this week is to Communicate wirelessly with a Smart Circuit via a Graphical User Interface (GUI) on your phone or PC.
I decided to make a traffic lights and a traffic gate that could be controlled by the Bluetooth module
I used some tinker cad online simulator program to form the circuit.
I used some tools to form the circuit as :
Arduino uno
Jumper wires
RGB led
Servo motor
Bluetooth module
Bread board
Resistors ( 220 ohm- 1k ohm)
I used Arduino cc to program to write the code
I used Arduino Bluetooth control program to control the components
RGB led
Jumper wires
Servo motor
Bread board
Arduino uno
Resistors (220&1K ohm)
Bluetooth module
Tinker cad
Arduino cc
Arduino Bluetooth control program
I used tinker cad to draw the circuit but I didn't find the Bluetooth module so I insert it to the program.
https://www.tinkercad.com/things/3pHTd7uhJUh-w8/editel
I connected :
The RX of the Bluetooth module to the TX of the Arduino.
The TX of the Bluetooth module to the RX of the Arduino.
The red led to the pin number 2.
The green led to the pin number 3.
The servo signal to the pin number 4
I used a voltage divided circuit (that contains 1 K & 2K ohm) to decrease the voltage to avoid the damage of the Bluetooth module.
I wrote the code on the Arduino cc .
I defined:
-The red led on pin2 as an output.
-The green led on the pin 3 as an output.
-The servo on pin 4
I included the library of the servo motor.
I printed the inserted number on the serial monitor so when:
-I inserted 1 on the mobile the red light turns on and after 2 seconds it turns off.
-I inserted 2 on the mobile the green light turns on and the servo rotates 90 degree to open the traffic gate and after 2 seconds as the car moves the green light turns off and servo returns back to its original place so close the gate.
-I inserted any number nothing will happen.
I paired the mobile phone with the Bluetooth module HC_05
I opened the mobile app and connect it to the Bluetooth module.
I removes the TX & RX to upload the code then I connected them again.
The project was not working at the beginning when I asked my Friends they advice me that:
I have to remove the TX & RX before loading the code.
Pair the Bluetooth module at the beginning with the mobile app.
I can use the Bluetooth module to control my project to control my robot.
We worked in group and used the Bluetooth module to control three servo motor and playing a competition game together at the end of the session.
competition