Assignment Objective:
This week was the last one to explore new electronic components, this time we got more familiar with HC05 Bluetooth module, and how we could use it to control (serial communication) the Arduino board with the mobile through a GUI interface
Idea:
As I'm a number one football fan, I thought about making a wireless scoring board that is controlled by mobile GUI interface via Bluetooth, and it will be equipped with a wireless whistle, so that it is for referees who want to be cooler :D
Electronics:
1- Arduino UNO
2- Small breadboard
3- Bluetooth module HC05
4- Jumper wires
5- 16x2 LCD display (connected to i2c module)
6- 1k Ohm and 560 Ohm resistors
7- Buzzer
Software:
1- TinkerCad and Microsoft power point (for drawing the wiring diagram)
2- Arduino IDE (for writing the C++ code to the Arduino board)
3- "Arduino Bluetooth control" application (provide a simple GUI interface to send serial data through Bluetooth connection )
"Arduino Bluetooth control" application
HC05 Bluetooth module
I2c module that is integrated with the LCD display
Action components:
1- the main part of the scoring board is the LCD display (with I2c module attached to it, to easily connect it to the Arduino board)
2- the buzzer to give the whistle function
Circuit design:
1- for the buzzer, we connect the anode leg to any analog output pin and the cathode leg to the ground
2- for the LCD display, we connect the LCD with the I2c module as shown in the figure, then connecting the I2c to the Arduino as following:
GND to ground
VCC to VC
SDA to A4
SCL to A5
3- for the Bluetooth module, there are 4 pins that we are concerned about in this week:
VCC and GND, which normally connect to the pins matching them on the Arduino
TXD pin, which transmit data from the module to the Arduino, is connected to the RXD pin on the Arduino
RXD, which receive data from the Arduino to the module, is connected to the TXD on the Arduino (as this pin on the Bluetooth module can receive maximum of 3.6 Volts and the Arduino produce 5 Volts, it is important to connect it with a current divider circuit as shown in the figure)
I2c connection to LCD
Circuit diagram
Writing the code:
1- importing the "LiquidCrystal_I2C" library to control the LCD display with the I2 module connection
2- initialize an instance of the lcd class to begin controlling the LCD different features
3- declaring integers team1 and team2 to store the teams results
4- declaring integer buzzer to store the buzzer pin number
5- inside the setup function:
declaring the buzzer pin as an output pin
initializing the serial communication to begin receiving data through it
turning the LCD display on, and printing team 1 and team 2 on it for recording their scores lately
6- inside the loop function:
initializing the buzzer output value to zero, so it doesn't produce any voice unless a specific serial data is sent to the loop
reading the serial data in a variable of type character
testing the read value from the serial communication and perform different actions according to its value
Setting up the GUI interface
In the mobile application, we set up each button to send a specific character that make changes to the action component according to the code, then we connected the mobile with the HC05 module
Wiring and testing the device functionality
This week we had a Hackathon at the "end of the week" session, so the teamwork was the motto of this week. In a team of three, we had contributed to build a simple robotic arm that is controlled via Bluetooth communication. For me, I had contributed in writing the code for controlling the arm, and my teammates had contributed in integrating the arm parts and wiring the electronic components to the Arduino.
At the Hackathon we got stuck at integrating the robotic arm part with the servo motors, and Amany - the instructor- had helped us in integrating it properly
Despite that my final project doesn't contains wireless communication, I'm now thinking about adding a wireless controlling mode to the final project as a "nice to have" feature, to make it works with different options of communication
The robotic arm for sure!
Title of Media
Edit this menu via the Pages tab
Show me