Introduction:
As a robotics and electronics coach, I love making fun and educational projects that students can enjoy while learning. Recently, I have created a Wi-Fi-connected LCD face animation project using the NodeMCU (ESP8266) and a 16x2 LCD display with an I2C module. When it powers on, the system shows a friendly startup message like “Initializing WiFi...” and then displays a cute animated smiley face once connected. This project is perfect for school demos, workshops, or your personal collection of IoT creations! I hope you like this article.
Components Required:
-
NodeMCU ESP8266 board
-
16x2 with I2C LCD Display
-
Male-female Jumper wires
-
Breadboard (optional)
-
USB cable for programming
Circuit Connections:
NodeMCU Pin | LCD I2C Pin |
---|---|
3.3V | VCC |
GND | GND |
D1 (GPIO5) | SDA |
D2 (GPIO4) | SCL |
(Note: Always use I2C LCD module to simplify connections.)
How it Works:
-
When the NodeMCU powers up, it shows "Initializing WiFi..." on the LCD.
-
The NodeMCU attempts to connect to your WiFi network.
-
Once successfully connected, it displays "WiFi Connected!" for a few seconds.
-
Finally, a cute animated face appears on the LCD, making your project come alive!
Code Explanation:
-
Wire.h and LiquidCrystal_I2C.h libraries are used to control the LCD.
-
The ESP8266WiFi.h library is used to manage WiFi connections.
-
Custom character arrays (
byte
type) are created to design eyes and a smiling mouth. -
The
lcd.createChar()
function loads these custom characters into the LCD. -
After WiFi connects, the animated face is displayed by placing these characters at the right LCD positions.
Applications:
-
Smart IoT Display Projects
-
Decorative Projects with LCD
-
Fun STEM Education Activities
-
First Step into WiFi-based IoT
Project Code:
(Already shared above, you can post it directly or add “Get full code here!” with a download link.)
//Esp32 based line follower robot:
#include
#include
#include
// LCD at I2C address 0x27
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Your WiFi credentials
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";
// Face characters
byte name1x7[] = { B00000, B00000, B00000, B11000, B11000, B01110, B00111, B00011 };
byte name0x5[] = { B00001, B00011, B00111, B00110, B00110, B00111, B00011, B00001 };
byte name0x6[] = { B10000, B11000, B11100, B01100, B01100, B11100, B11000, B10000 };
byte name0x9[] = { B00001, B00011, B00111, B00110, B00110, B00111, B00011, B00001 };
byte name0x10[] = { B10000, B11000, B11100, B01100, B01100, B11100, B11000, B10000 };
byte name1x8[] = { B00000, B00000, B00000, B00011, B00011, B01110, B11100, B11000 };
void setup() {
Wire.begin(D2, D1); // NodeMCU I2C pins: SDA = D2, SCL = D1
lcd.init();
lcd.backlight();
// Step 1: Show Initializing WiFi
lcd.setCursor(0, 0);
lcd.print("Initializing WiFi");
delay(1000);
WiFi.begin(ssid, password);
// Step 2: Wait for connection
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Connecting...");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
lcd.print(".");
}
// Step 3: Connected
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("WiFi Connected!");
delay(2000);
// Step 4: Display happy face
lcd.clear();
lcd.createChar(0, name1x7);
lcd.setCursor(7, 1);
lcd.write(byte(0));
lcd.createChar(1, name0x5);
lcd.setCursor(5, 0);
lcd.write(byte(1));
lcd.createChar(2, name0x6);
lcd.setCursor(6, 0);
lcd.write(byte(2));
lcd.createChar(3, name0x9);
lcd.setCursor(9, 0);
lcd.write(byte(3));
lcd.createChar(4, name0x10);
lcd.setCursor(10, 0);
lcd.write(byte(4));
lcd.createChar(5, name1x8);
lcd.setCursor(8, 1);
lcd.write(byte(5));
}
void loop() {
// You can add more animations here if you want (optional)
}
📼Here is a demo video:
🎯 What You’ll Learn
-
How to interface I2C LCD with ESP8266
-
How to create and display custom characters
-
How to connect WiFi and show status
-
Basic animation and display logic
📱 Best Use Cases
-
STEM Workshops
-
School Exhibitions
-
Fun IoT Projects
-
Maker Fairs
Conclusion:
✨ Imagine a future where even your devices greet you with a happy face every morning! ✨
#NodeMCU #ESP8266Projects #LCDAnimation #DIYIoT #ArduinoProjects #ElectronicsFun #SmileyFace #STEMProjects
0 Comments