The idea for this week assignment is to control wirelessly using mobile App smart circuit that contains at least TWO action components.
I decided to Control RGB & Buzzer to give different OUTPUTS using Arduino Bluetooth Control App to perform different actions.
The idea is a trial to simulate my final project actions as RGB is a substitution for LED matrix & buzzer is a substitution for Speakers.
Arduino IDE: To Program the Arduino Board.
Arduino BT controller: To control Arduino board using Mobile and BT module.
Components:
Arduino Uno Board.
1 RGB LEDs.
11 Jumper Wires.
3 (1 OHM) resistors.
BT Module.
First I started simulating my Circuit on Tinkercad.
As Tinkercad don't support BT module. I decided to use Ultrasonic sensor instead to Demonstrate the circuit.
For my Smart Circuit I wanted it to perform the following actions:
If serial read 1 then turn RGB to white.
If serial read 2 then turn RGB to Red.
If serial read 3 then turn RGB to changing colors with delay 100 ms between each color.
If serial read 0 then turn RGB OFF.
And in all conditions turn Buzzer on for 50 ms as an alert
Using Arduino IDE, I transformed my code map to a real .iNO CODE
1ST page
2nd page
3rd page
4th page
Project in action
I found on the media channel Michael added a really cool feature for controlling the action components using voice commands from BT controller app and I found it really interesting and with searching I found the concept behind it is really easy. As for each saved voice command we give it a number so for example if you Said TURN LIGHTS ON the app will convert it to an order 1 and the OUTPUT will be the same as IF 1 Condition.
During testing, I found the IF CONDITION 3 only work for 1 time and don't run in a loop. So I have to figure out the problem to make my code run in a loop so the RGB will keep changing colors when in CONDITION 3.
After learning the logic behind controlling ON/OFF state and Colors of RGBs, I can implement this knowledge in my final project
The coolest thing I've learned this week is the magic of voice commands and how can I use it to control different components wirelessly using my mobile.
I learned how to use the PWM(pulse width modulation) in different actions like controlling the intensity of light using values from 0-255.