Ideation
This week's idea is to control things remotely via Bluetooth or something else.
I've always loved music, especially the little games that simulate the piano or guitar or something like that, so I thought why not make a small device that can be controlled via Bluetooth through an application on the phone
I will use Tinkercad to simulate the circuit before you send it to the breadboard
I will use the Arduino IDE to upload the code to the Arduino
Arduino blue-control App on the mobile phone to control the Buzzer
For the electrical circuit
Jumper Wires.
Arduino
Bluetooth module hc05
Buzzer to make a sound
Small breadboard: To connect the circuit.
Adaptor 9V :The source of electricity.
My idea is to control the alarm clock through the phone via Bluetooth to play certain notes to simulate children's games that play music.
I started by connecting the positive and negative of the Arduino to the vertical lines on the board.
Then connecting the TX to the RX of the Arduino and the RX to the TX of the Arduino.
I connected the Bluetooth positive and negative to the Arduino positive and the negative on the board.
Then I connected the Buzzer and put its negative leg on the same line as the negative leg of the Arduino and connected a wire from the pin I had identified to its positive leg.
Coding
I first started by defining the library that I would need for the Buzzer
Then I defined a variable that I would need to store inputs from the user
Then I defined some variables and set values for them that I would use to give commands to the buzzer to play a specific note.
As for the notes to make good sounding notes I went back to this tutorial and understood the code, then took the numbers I needed from it to play the notes.
I set the begin at (9600)
As for the set-up, I define the pin buzzer as an OUTPUT to controller using Arduino.
For the loop, I used while (Serial.abailable()) so if there is no user input the Arduino will print nothing.
Then I used the variable I created to store the readings from the user.
Then I started with the first condition, which is if the input is equal to 1, play the specified note.
I repeated the same thing with the rest of the conditions, changing the notes played.
In the end, I used Serial.println (userInput) to print the user input on the serial monitor.
Circuit connection
I pulled out all the components I would need.
I started connecting the positive and negative of the Arduino to the board.
Then I wrapped the wire around itself because it was long and I didn't want it to get in the way.
Then I connected the Buzzer and put its negative leg on the same line as the negative leg of the Arduino and connected a wire from the pin I had identified to its positive leg.
I put Bluetooth on the board and then I connected the Bluetooth positive and negative to the Arduino positive and the negative on the board.
Then connecting the TX to the RX of the Arduino and the RX to the TX of the Arduino.
And here is my final outcome
Working with my teammate Farah to do the task of the week helped me a lot.
The problem I faced this week was after uploading the code to the Arduino and after I connected the circuit to the board and to the Arduino, I connected it to the 5-volt adapter, but it did not work. At first, I thought there was a wrong connection or something, but there was no such thing. After thinking about it, I tried to connect it to the 9-volt adapter and it worked, so you should connect it to a 9-volt adapter and not a 5 volt one Because the Bluetooth module needs 5V to work
9-volt adapter
5_volt adapter
What I learned this week about controlling things remotely via Bluetooth or other, and it gave me new experience that I might need if I wanted to add remote control via Bluetooth
The best thing this week is making a robot arm and controlling it to catch fish.
I didn't design anything new, but I modified the design this week.