Let's get started with this innovative Arduino tutorial where you will learn how to make a wireless electronic notice board using an Arduino, 16x2 LCD and HC-05 Bluetooth module. To make this project follow the instructions step by step. This will allow us to send any message almost instantly and without delay simply by Bluetooth communication using our smartphone, which is better and more secure than the old conventional method of posting notices on notice boards.
This proposed technology can be used in a number of environments, such as hospitals, canteens, conference rooms, offices, and public areas.
Components Required:
- Arduino Board
- 16x2 LCD
- HC-05 Bluetooth Module
- Connecting wires
- 1k Resistor
- 2.2k Resistor
- 10k potentiometer
- 560 ohm resistor
- USB cable
- Power supply
What is the HC-05 Module?
The HC-05 Bluetooth Module is a simple Bluetooth SPP (Serial Port Protocol) module that allows for the setup of a transparent wireless serial link. This module can be used in a master or slave configuration.
Bluetooth serial modules allow all serial-enabled devices to communicate wirelessly.It has 6 pins,
- Key/EN: It's used to get the Bluetooth module to respond to AT commands. This module will operate in command mode if the Key/EN pin is set to HIGH. Otherwise, it's in data mode by chance. In command mode, the HC-05's default baud rate is 38400bps, and in data mode, it's 9600bps.
- Data mode: Data transfer between devices.
- Command mode: It makes use of AT commands to adjust the HC-05's settings. The module serial (USART) port is used to send these commands.
- VCC: Connect 5 V or 3.3 V to this Pin.
- GND: Ground Pin of module.
- TXD: Transmit Serial data (wirelessly received data by Bluetooth module transmitted out serially on TXD pin)
- RXD: Receive data serially (received data will be transmitted wirelessly by Bluetooth module).
- State: It tells whether the module is connected or not.
Features of HC-05 Bluetooth Module
- The HC-05 has a red LED that shows whether the Bluetooth link is active or not. This red LED blinks continuously in a periodic pattern before connecting to the HC-05 module. Its blinking slows down to two seconds when it connects to another Bluetooth system.
- This module operates at 3.3 volts. Since the module has a 5 to 3.3 V regulator on board, we can also add a 5V supply voltage.
- Since the HC-05 Bluetooth module has a 3.3 V RX/TX level and the microcontroller can sense 3.3 V levels, there is no need to change the HC-05 module's transmit level. However, we must switch the transmit voltage level from the microcontroller to the HC-05 module's RX.
Command Mode
- When we want to change settings of HC-05 Bluetooth module like change password for connection, baud rate, Bluetooth device’s name etc.
- To do this, HC-05 has AT commands.
- To use HC-05 Bluetooth module in AT command mode, connect “Key” pin to High (VCC).
- Default Baud rate of HC-05 in command mode is 38400bps.
- Following are some AT commands generally used to change the setting of Bluetooth modules.
- To send these commands, we have to connect the HC-05 Bluetooth module to the PC via serial to USB converter and transmit these commands through the serial terminal of the PC.
Command |
Description |
Response |
AT |
Checking communication |
OK |
AT+PSWD=XXXX |
Set Password e.g. AT+PSWD=4567 |
OK |
AT+NAME=XXXX |
Set Bluetooth Device Name e.g. AT+NAME=MyHC-05 |
OK |
AT+UART=Baud rate, stop bit, parity bit |
Change Baud rate e.g. AT+UART=9600,1,0 |
OK |
AT+VERSION? |
Respond version no. of Bluetooth module |
+Version: XX OK e.g. +Version: 2.0 20130107 OK |
AT+ORGL |
Send detail of setting done by manufacturer |
Parameters: device type, module mode, serial parameter, passkey,etc. |
How to Interface 16x2 LCD with Arduino Uno ?
LCD modules are a critical component in many Arduino-based embedded systems. As a result, understanding how to attach an LCD module to an Arduino is crucial when designing embedded systems. Here you will learn how to connect an Arduino to a 16x2 LCD display.
The JHD162A is a 16x2 LCD module based on Hitachi's HD44780 driver. The JHD162A has 16 pins and can be used in 4-bit or 8-bit mode (using only four data lines) or (using all 8 data lines) respectively. In this case, the LCD module is set to 4-bit mode.
Before going into the details of the project, let’s have a look at the JHD162A LCD module. The schematic of a JHD162A LCD pin diagram is given below.
Pinout:
- Pin1(Vss): Ground pin of the LCD module.
- Pin2(Vcc): Power to LCD module (+5V supply is given to this pin)
- Pin3(VEE): Contrast adjustment pin. This is done by connecting the ends of a 10K potentiometer to +5V and ground and then connecting the slider pin to the VEE pin. The voltage at the VEE pin defines the contrast. The normal setting is between 0.4 and 0.9V.
- Pin4(RS): Register select pin. The JHD162A has two registers namely command register and data register. Logic HIGH at RS pin selects data register and logic LOW at RS pin selects command register. If we make the RS pin HIGH and feed an input to the data lines (DB0 to DB7), this input will be treated as data to display on the LCD screen. If we make the RS pin LOW and feed an input to the data lines, then this will be treated as a command ( a command to be written to LCD controller – like positioning cursor or clear screen or scroll).
- Pin5(R/W): Read/Write modes. This pin is used for selecting between read and write modes. Logic HIGH at this pin activates read mode and logic LOW at this pin activates write mode.
- Pin6(E): This pin is meant for enabling the LCD module. A HIGH to LOW signal at this pin will enable the module.
- Pin7(DB0) to Pin14(DB7): These are data pins. The commands and data are fed to the LCD module through these pins.
- Pin15(Backlight +): Anode of the backlight LED. When operated on 5V, a 560-ohm resistor should be connected in series to this pin. In Arduino-based projects, the backlight LED can be powered from the 3.3V source on the Arduino board.
- Pin16(Backlight -): Cathode of the backlight LED.
Circuit Diagram
Arduino Code
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); /// REGISTER SELECT PIN,ENABLE PIN,D4 PIN,D5 PIN, D6 PIN, D7 PIN
char str;
void setup() {
lcd.begin(16,2);
Serial.begin(9600);
}
int i=0;
void loop() {
while(Serial.available())
{
str = Serial.read();
if(str=='*')
{
lcd.setCursor(0, i);
}
else if(str=='-')
{
lcd.clear();
delay(10);
}
else if(str=='#')
{
i=abs(i-1);
}
else if(str=='%')
{
while(str!='!')
{
str=Serial.read();
lcd.scrollDisplayLeft();
delay(1000);
}
}
else
{
lcd.print(str);
delay(200);
}
}
}