The Week of Wireless
That's what I call it … It seems that the weeks' journey is coming to an end. What a feeling full of happiness and loneliness!
Well, week 8 mainly focuses on:
Programming the Arduino Uno to make serial communication via USB.
Programming the Arduino Uno for wireless serial communication (via Bluetooth).
Using a simple phone user interface to control a smart circuit wirelessly (via Bluetooth).
Using a simple graphical user interface on a computer to control a smart circuit wirelessly (via Bluetooth)
Hence, after doing some searching on Google, I came up with an idea known to some of us called Musical Chairs. I was inspired by this project https://create.arduino.cc/projecthub/peejster/countdown-timer-375682?ref=tag&ref_id=bluetooth&offset=21, if anyone wants to dig deeper into the idea and how it might work, then maybe this link is useful!
The concept behind it is a fun game where some people race to sit on a number of chairs while running around and when the background music ends or at a certain signal from the referee, each player has to hurry up to sit on a single chair and there is a losing player who has no chair and so on.
What I thought of my assignment was a simple simulation of this game using electronics that mainly used components such as the Arduino Uno board, Bluetooth module (HC-05) and a mobile app called Arduino Bluetooth Control. Of course I need to be like the race referee who runs the music or the timer for the players and decides how the winner will be at the end of the game. So, I decided to use the LEDs and new functions/libraries from the Arduino IDE like voice recognition and text speech like when I listen from Arduino Bluetooth Control a question of set a timer from 5 to 50 seconds for ex. . Then it's my turn to answer with a specific number and wait until the last LED went off and she will be the losing player, and then the time for the bell would be the right time to ring the bell in a certain tone.
Sounds like a great idea? right! But unfortunately due to some challenges with programming I hope to be able to succeed in it.
Now, let us talk about the mainly assignment i worked on!
After trying the last assignment idea and the instructor's recommendation, I decided to implement an idea that may be similar to the first idea, as I used basic components such as:
RGB LED
LCD screen
Bluetooth module (HC-05)
Buzzer (Piezo)
Arduino Uno board
Arduino Bluetooth Control app
Stay informed until the latest events/ details of the week!
First of all, I used the Arduino Bluetooth Control mobile app to communicate with my Bluetooth module that i have this week. Also, I used an LCD screen to print messages on it and a puzzer to get different tones with each color/output from the RGB LED.
While the Arduino IDE will be used to host the TEXT CODE that will be written in it and other materials such as:
Jumper Wires
3 resistors(220 ohms) for RGB LED
Another three resistors of 1000 ohms each for the Bluetooth module connection to the breadboard and the Arduino Uno board.
Arduino IDE app
LCD Display
RGB LED
Buzzer (Piezo) 5v
Bluetooth module (HC-05)
Arduino Bluetooth Control app
To get the function of the assignment I am going to work on, I had to follow some mainly steps as below:
Prepared a list of the required components as mentioned before which were brought from my electronics kit.
Started writing text code using the Arduino IDE.
Plugged the wires and built the circuit regarding to the Arduino Uno pins i chose in the text code before.
Uploaded the code to the Arduino board using USB cable to connect the Arduino board to my Laptop. "The positive terminal of (HC-05) Bluetooth module must be cancelled while uploading the code". Let us not miss that anyway.
Checked every component i attached to the breadboard to make sure the wires was correct and everything is working properly.
Now, it's time to think about the puzzer tone. I want to add a special feature to the assignment with an enthusiastic sound tone, so I tried to search for sources that might be helpful and got this brilliant project https://create.arduino.cc/projecthub/adithyalokesh17/let-s-make-arduino-sing-with-a-buzzer-ee2e34. In fact, I was amazed at all these different tones in the project, but unfortunately I couldn't make a catchy tone exactly as I had imagined due to the puzzer which was not the ideal type for pure tone generation.
In the text code provided in the images, I started by deciding which components I would use and which Arduino pins they would go to.
Also, I defined a character with the name of the incoming data = 0, which means I gave a command not to start/do anything without my input/confirm access (pressing the numbers on the screen of the Arduino Bluetooth Control mobile app).
The next step was to program the LCD screen code using the screen library of examples as shown in previous pictures
To use a LCD screen i plugged it with 4 wires (male - female) of which there are two of them as VCC and GND or +ve and -ve terminals, while the last two are linked to pins A4 and A5 of Arduino Uno board.
the next stage expected for LCD screen was to set cursor (column, row) and lcd.print ("let's play"). Of course i repeated this for each output i had and named with a color name such as lcd.print ("Red color") as it shown in the text code provided.
What comes next is the definition of the outputs where RGB LED has three output colors connected to Arduino board at pins 3 ,5 and 6. Also the puzzer pin defined as output.
Now, the expected output or task function happens as follows:
While pressing a custom number throughout the Arduino Blu Control mobile app, it gives me a custom color according to HIGH & LOW of each color/ RGB analog pin.
Also, a custom ringtone is generated from my puzzer
In the end, the LCD screen prints a text of an expected emitting color i have
TEXT CODE
To create the Bluetooth module wiring I followed the forward image taken from a tutorial from this week's tutorial I watched during my weekly learning trip.
There are two methods of wiring that rely on the value of the resistors. I used resistors similar to the first picture.
(HC-05) Bluetooth Module Wires
Another type of wires
Wires Connection In TinkerCad Software
I uploaded a text code from the Arduino IDE to the Arduino Uno board through a USB cable, keeping in mind that the Bluetooth module is not turned on while the code is uploading. Then I opened the Arduino Bluetooth Control and started connecting to the HC-05 (the Bluetooth module) and pressed the buttons and sliders section as shown in the demo video.
Now, it's time to press the numbers 0-5 considering that each number has a color output from the RGB LED as shown in the text code provided. When zero is pressed, the color will be red, and if the number is five, the output color should be white as all the red, green and blue colors are mixed, etc..
I tried playing musical notes by pressing a random numbers. The tones wasn't clear enough but was almost satisfied.
Finally, all components worked properly and made a happy ending :D
Wires of Circuit
Demo of Assignment
I turned to my instructor for his observations and his recommendation was to use RGB LED instead of individual LEDs (One of the tasks of assigning technical requirements was that all action components are acceptable except for monochrome LEDs) and its recommended not to go into a difficult challenge that might take time and effort in order to achieve voice recognition and text speech as the main idea was in the past.
I tried to give a hand to more than one colleague on how to connect the Bluetooth module with the Arduino Uno board and the breadboard as shown in the next pic. This was increasing my self-knowledge and practice with the Bluetooth module. So, thanks to anyone trying to ask to learn and I am always humbly ready to help as much as I can. We are all beginners with different stages of knowledge.
HC-05 (Bluetooth module) Wires
Google search was as helpful as ever providing sources of inspiration for my assignment and the musical tone that could be made. I previously provided some links to resources I accessed during my research times which I think might be helpful to anyone interested with the same idea.
The Bluetooth module was a helpful gadget this week and will be even more useful when used in the final project to control the interactive desktop lamp through the mobile phone without having to come close to the lamp to turn it on. Keep informed!
Hackathon Day Says Welcome!
It was a new experience to go through and useful gadgets using new module like Bluetooth module (HC-05) and new tool such as Arduino Bluetooth Control.
Do you have patience and love to fish? Then this project might be useful to you!
It was a 3 phase challenge, the first phase being to write a text code for just one servo motor movement using the Bluetooth module (HC-05) and the Arduino Bluetooth Control mobile app. Hence test the wires connection and motion.
The next stage was to test two more servo motors, and now there are 3 motors that need to be programmed and run.
The final stage was modifying it into small components fabricated using a laser-cutting machine and a Prusa i3 (3D printing machine) to be ready to the final match which was the competition between the other team makers.
Abtal EL-Digital are flying in the sky.. say hello to my winning team in many rounds!
Plugging Wires
DEMO of the Competition