Have you ever wanted to display custom messages on an LCD screen from anywhere in the world? With the Bolt IoT WiFi module and an Arduino, you can send text to a 16x2 LCD display remotely via the Bolt Cloud.
This project demonstrates how to interface a serial LCD display with the Bolt WiFi module using UART communication. You can type a message on the Bolt Cloud dashboard and have it appear on the LCD display connected to your Arduino in real time.
| Component | Quantity |
|---|---|
| Bolt WiFi Module | 1 |
| Arduino Uno R3 | 1 |
| 16x2 LCD Display | 1 |
| 10K Potentiometer | 1 |
| 220 Ohm Resistor | 1 |
| Breadboard | 1 |
| Jumper Wires | As Required |
Wire the 16x2 LCD display to the Arduino as follows:
| LCD Pin | Arduino Pin |
|---|---|
| VSS | GND |
| VDD | 5V |
| V0 (Contrast) | Potentiometer Wiper |
| RS | Digital Pin 12 |
| RW | GND |
| E (Enable) | Digital Pin 11 |
| D4 | Digital Pin 5 |
| D5 | Digital Pin 4 |
| D6 | Digital Pin 3 |
| D7 | Digital Pin 2 |
| A (Anode) | 5V via 220 Ohm Resistor |
| K (Cathode) | GND |
Connect the potentiometer to adjust the contrast of the LCD display. The wiper pin goes to V0 on the LCD, with the other two pins connected to 5V and GND.
Connect the Bolt WiFi module to the Arduino for UART communication:
| Bolt WiFi Module | Arduino |
|---|---|
| TX | RX (Pin 0) |
| RX | TX (Pin 1) |
| GND | GND |
| 5V | 5V |
Note: Disconnect the TX/RX wires when uploading code to the Arduino, as they share the same serial lines used for programming.
Open the Arduino IDE and upload the following code to the Arduino Uno:
#include <LiquidCrystal.h>
#include <BoltIoT-Arduino-Helper.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
lcd.begin(16, 2);
lcd.print("Bolt IoT LCD");
boltiot.begin(Serial);
boltiot.setCommandString("display", displayMessage);
Serial.begin(9600);
}
String displayMessage(String message) {
lcd.clear();
lcd.setCursor(0, 0);
if (message.length() > 16) {
lcd.print(message.substring(0, 16));
lcd.setCursor(0, 1);
lcd.print(message.substring(16));
} else {
lcd.print(message);
}
return "Message displayed";
}
void loop() {
boltiot.handleCommand();
}
Log in to cloud.boltiot.com and create a new product. Set the product type to Output and the connection type to UART since the Bolt communicates with the Arduino over serial.
Link your Bolt device to the product and click Configure to add the following HTML/JS code to the product code section:
<!DOCTYPE html>
<html>
<head>
<title>Serial LCD Display</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<h2>IoT LCD Display Controller</h2>
<input type="text" id="message" placeholder="Enter message" maxlength="32">
<button onclick="sendMessage()">Send to LCD</button>
<p id="status"></p>
<script>
var API_KEY = ""; // Your API key
var DEVICE_ID = ""; // Your device ID
function sendMessage() {
var msg = document.getElementById("message").value;
$.get("https://cloud.boltiot.com/remote/" + API_KEY + "/serialBegin?baud=9600&deviceName=" + DEVICE_ID);
$.ajax({
url: "https://cloud.boltiot.com/remote/" + API_KEY + "/serialWR",
data: { "data": "display " + msg, "deviceName": DEVICE_ID },
success: function(r) {
document.getElementById("status").innerHTML = r.success == 1 ? r.value : "Device offline";
}
});
}
</script>
</body>
</html>
Replace the API_KEY and DEVICE_ID with your own credentials from the Bolt Cloud dashboard. Save the product.
Power on the Arduino and make sure the Bolt WiFi module is connected to your WiFi network. Open the product view on the Bolt Cloud dashboard, type a message into the text field, and click "Send to LCD". The message should appear on the LCD display within a few seconds.
Messages up to 32 characters long are supported -- the first 16 characters appear on the first line of the LCD and the remaining characters wrap to the second line.
You now have a fully functional IoT-enabled LCD display that you can control from anywhere in the world through the Bolt Cloud. This project can be extended to display sensor data, notifications, or any other information you want to show remotely.
Want to build more such IoT and ML projects? Want to learn IoT and ML from basics? Check out the Bolt IoT and ML training. This online video training is excellent for those who want to start with IoT and ML because it teaches you to build projects from the basics.
Get the latest IoT tutorials, projects, and updates delivered to your inbox.