Remote-controlled RGB mood light
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Shop by category
Shop all componentsThe ST7735 is a common small colour TFT controller driven over SPI. The Waveshare 1.8-inch module is 128x160 pixels and runs on 3.3 V logic, which suits the ESP32. The ESP32 joins Wi-Fi, syncs its clock with an NTP time server set to India time, and redraws the digits once a second, only clearing the part of the screen that changes.
Tick anything you already have and the total updates.
Waveshare 1.8-inch 128x160 LCD
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB.
clock.inoVerify & upload in Electrolark#include <WiFi.h>
#include <time.h>
#include <Adafruit_ST7735.h>
Adafruit_ST7735 tft(5, 2, 4); // CS, DC, RST on hardware SPI
const char* SSID = "your-wifi";
const char* PASS = "your-password";
void setup() {
tft.initR(INITR_BLACKTAB);
tft.setRotation(1); // 160 x 128 landscape
tft.fillScreen(ST77XX_BLACK);
tft.setTextColor(ST77XX_WHITE); tft.setCursor(4, 4); tft.print("Connecting...");
WiFi.begin(SSID, PASS);
while (WiFi.status() != WL_CONNECTED) delay(300);
configTime(19800, 0, "pool.ntp.org"); // India is UTC + 5:30
tft.fillScreen(ST77XX_BLACK);
}
void loop() {
struct tm t;
if (!getLocalTime(&t)) return;
char hm[6], ss[3], date[20];
strftime(hm, sizeof hm, "%H:%M", &t);
strftime(ss, sizeof ss, "%S", &t);
strftime(date, sizeof date, "%a %d %b %Y", &t);
tft.setTextColor(ST77XX_CYAN, ST77XX_BLACK); tft.setTextSize(4); tft.setCursor(8, 30); tft.print(hm);
tft.setTextColor(ST77XX_YELLOW, ST77XX_BLACK); tft.setTextSize(2); tft.setCursor(124, 44); tft.print(ss);
tft.setTextColor(ST77XX_WHITE, ST77XX_BLACK); tft.setTextSize(1); tft.setCursor(30, 90); tft.print(date);
delay(1000);
}
Check CS, DC and RST, and that MOSI is GPIO23 and SCK is GPIO18.
Try the other INITR_ tab values; ST7735 panels differ.
Check the 19800 second offset in configTime.
No, the ESP32 keeps time after the first sync and re-syncs now and then.
Yes, fetch a weather API over Wi-Fi and draw it under the date.
The Nano has no Wi-Fi and 5 V logic; use an ESP32 for this project.
4 parts: ESP32-WROOM-32 38-Pin Development Board, Waveshare 128x160 General 1.8 Inch LCD Display Module, Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 1 hour. The build on this page has 5 steps.
No. This page has the complete, tested code (clock.ino).
About ₹1,310 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Wiring an SPI TFT to an ESP32; Getting time from NTP; Redrawing only what changes to avoid flicker.
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Press to roll: the pips tumble and slow down before landing on a number.
Wait for the light, hit the button: how many milliseconds can you beat?
A bright 4-digit clock that keeps time through power cuts.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.