This week's project idea is inspired by Arduino games, I wanted to design and write a simple game code that used the LCD and the buzzer, as I haven't focused on using it or working with it yet. And control it through the mobile phone and Bluetooth module
Software:
wokwi.com: To design the electrical circuit.
Arduino IDE: to write and upload the code to the Arduino Board.
Arduino Bluetooth control app: to control and play with Arduino through a Bluetooth module.
Components:
Arduino UNO to control all the components.
USB Cable to connect Arduino Board with Laptop.
LCD 16×2 with I2C module to show the results.
Buzzer to make different tones on the results
Bluetooth Module HC-05 to control and play with Arduino through a mobile application
Breadboard to connect the components.
9V Power-supply
Jumper wires
At first, I learned how to use the LCD I2C module, using the lesson available on the portal and YouTube, then I connected it and tested it and learned how to write the code to operate it.
After that I started designing the electronic circuit, and unfortunately, I couldn't design it completely in one place, so I relied on wokwi.com to design the main circuit, and I relied on a ready-made diagram showing how to connect Bluetooth module, based on what I learned through the lessons on the portal and our experiences with the instructors ...
Then I started writing the code and trying it again and again through the serial monitor, and after I reached the correct writing on the screen, I found that the sound of the buzzer was very annoying, and that was a key to learning something new about the buzzer component, which is the tone function. I found that in the previously attached code And I didn't understand it directly, so I searched on YouTube to understand this function and then applied it to the code and it worked.
I added the tone function to the code and tested it, then I started working on writing the entire code in its final form.
I started assembling the circuit with the following steps:
I connected the positive and negative from the breadboard to the Arduino
I connected the LCD with the I2C module VCC & GND pins to the breadboard, SDA to A4 analog pin, and SCL to A5 analog pin.
I connected the Buzzer to the breadboard and connect the anode to pin number 7.
I connected the Bluetooth Module VCC & GND to the breadboard RX,TX pins to TX,RX pins on Arduino.
I connected the DC- Gearmotor to the L298N driver module based on the attached circuit diagram, and the module to the Arduino board using the digital pins 3,4 and 6
I uploaded the code from Arduino IDE to the board using the USB Cable. Note: We have to unplug RX,TX pins before uploading.
I connected the 9V adaptor to the board.
I Start paring the Bluetooth module with mobile to start playing.
Test Full circuit. and finally, it works.
This week Anas & Ahmed Abdelfattah helped me with videos that contain methods for rotating shapes 360 degrees, and this will help me find design solutions for the final project.
I helped Amr find out more details about the gummed paper tape, as it is used to give a fine look to the cardboard Prototype.
I faced another problem while designing the circuit, as I did not find the components available on tinkercad.com or wokwi.com, and I asked on Slack and my peers helped me to find some solutions
I faced a problem when uploading the code to the Arduino board, and I found that Rawan had the same problem, and she was asking on Slack, and it turned out that the problem was with the Bluetooth connection, as the RX,TX must be disconnected before uploading the code.
For the first time I use the LCD screen module in a project, and this was very useful because it will be easier for me to use it in the final project, as the level of intensity of the light will be displayed and controlled through it.
It was a very exciting experience to work on making a robot art and writing code for it, even if it was in a simplified way...