This week's assignment was to communicate wirelessly with a Smart Circuit via a Graphical User Interface (GUI) by
-building a simple smart circuit that contains at least TWO action components that could be controlled wirelessly.
-using either the Android GUI or PC GUI to control the action components.
I want to make an ambulance serin.
It's a light and sound, the light is red and blue that switches in a sequence, and a buzzer.
I will use a smartphone app to control this serin as input.
Software: Fritzing
To simulate the circuit
Software: Arduino IDE
To write the code and upload it to the Arduino UNO
To Control the circuit wirelessly.
Materials:
Mini Breadboard
Arduino UNO
cables
220-ohm resistors
Jumpers
Buzzer sensor
RGB LED
Bluetooth Module
First, I tried to make the circuit and simulate it on tinker cad.
Wired the buzzer sensor and RGB led to the Arduino to digital pin and GNDs.
Wired the Bluetooth module TX as output (pin 0), RX as input (pin 1), gnd, and 5v.
I used the Arduino IDE to write the code and made it 3 parts for 3 modes.
I have set the Arduino to read the inputs and outputs from the App.
I had defined the RGB led pins and the buzzer sensor and the incoming data from the mobile app.
then, in void setup defined the RGB led and buzzer sensor as outputs and let serial begin at speed 9600.
In void loop, I made an if condition that if the incoming data = 1, set the RGB led to the red and the buzzer to tone 800.
If incoming data = 2, set RGB led to blue and the buzzer to tone 900.
If incoming data = 3, set RGB led to light red then blue and the buzzer to tone 800, 900 in sequence to show the serin of the ambulance.
1
2
I started to build the circuit on the breadboard and Arduino UNO.
Connect the buzzer sensor and the RGB led with the Arduino to digital pins A0, 3,6,5 respectively and GNDs, as output components.
Wired the Bluetooth module TX as output (pin 0), RX as input (pin 1), gnd, and 5v.
Final outcome
I asked Ibrahim about wiring the Bluetooth module with resistors and he suggested not using any resistor like in EOW activity.
When I got stuck I go to google and YouTube videos to get inspired by their ideas on how to make the buzzer sensor make the tone of an ambulance.
I think this assignment will help me a lot when I started my final project, it helped me understand how could insert lights and sirens and control them through a mobile app.
And. I want to add this feature to my RC car.
The coolest thing I have learned this week is how to use the Bluetooth module HC05that uses to connect a mobile app to the arduino.