So I was inspired by the video of the week.
how the circuit works:
When I press on number one on the phone the RGB will give specific light and seven-segment will show number one and the buzzer will give tone by specific frequency and when pressed on number two on the phone the RGB will give specific light different from the light in case number one and the seven-segment will show number two and the buzzer will give tone by specific frequency different from the case of number one.
and so the number 6.
Arduino IDE
Used to compile the code written in the programming sketches and upload it directly to the Arduino Board.
Arduino Bluetooth
Used to control the circuit and components via mobile.
List of Components Used:
Arduino Uno.
Buzzer.
Cable.
Wires.
Resistor 1 k ohm.
Resistor k ohm.
Seven-Segment.
Bluetooth module.
The circuit diagram
Wiring of Bluetooth module
I connected the RX pin with two resistance voltage dividers (1k ohm and 2k ohm) because the RX needs 3.3 v only
I defined a variable with a type character to receive the data in it from the mobile application.
in the void setup, I made for loop to make the pins from pin 2 to pin 12 all of them OUTPUT, Then enabled the serial monitor.
In the void loop, I made the ARDUINO stop waiting for the value to be entered by the user.
If the user entered '1' do the following:
1-execute function one()
2-turn the RGB led with the values in code.
3-turn on the buzzer for 300ms by frequency 150hz.
If the user entered '2' do the following:
1-execute function two()
2-turn the RGB led with the values in code.
3-turn on the buzzer for 300ms by frequency 300hz.
If the user entered '3' do the following:
1-execute function one()
2-turn the RGB led with the values in code.
3-turn on the buzzer for 300ms by frequency 400hz.
If the user entered '4' do the following:
1-execute function four()
2-turn the RGB led with the values in code.
3-turn on the buzzer for 300ms by frequency 500hz.
If the user entered '5' do the following:
1-execute function five()
2-turn the RGB led with the values in code.
3-turn on the buzzer for 300ms by frequency 600hz.
If the user entered '6' do the following:
1-execute function six()
2-turn the RGB led with the values in code.
3-turn on the buzzer for 300ms by frequency 700hz.
function to turn on the seven-segment with the numbers from one to six.
I started to make the connections on the real breadboard according to the design on Tinker CAD
I connected the seven-segment in the common cathode display and connected the pins of the seven-segment from pin 2 to pin 8.
In the Bluetooth module connected the RX pin with two resistance voltage dividers (1k ohm and 2k ohm) because the RX needs 3.3 v only
I connected resistors (220 ohms) to the RGB pins to reduce the current and protect them from the burn.
finally connected the buzzer to pin 9
The circuit is working
I used an Avometer to know the value of the resistances.
I stuck with the code as I forgot how to code the BT module but I got back to the videos to see how it work and searched for easier ways to code it.
This link helped me solve the problem.