ESP32 Robot Eyes on an OLED: Animated Eyes with RoboEyes
ESP32 robot eyes on an OLED: use RoboEyes with a 0.96-inch SSD1306 for blinking, moods, TTP223 touch reactions, twin-OLED eyes and an Arduino Uno version.
ESP32 robot eyes on an OLED are the easiest way to give a project some personality: two eyes on a tiny 0.96-inch screen that blink, glance around, smile and get annoyed. With an ESP32, an SSD1306 OLED and four wires you can build a little desk companion, a face for a robot car or a gift that giggles when you touch it. You don't have to draw the eyes yourself either: the RoboEyes library handles blinking, gaze and mood changes for you with smooth animation.
In this guide you'll first see how the eyes are drawn and how the library works, then the wiring table and the first sketch. After that we put every mood and gaze direction in one table and build a robot with a TTP223 touch sensor that smiles when you tap it, gets angry when you hold your finger on it and falls asleep when left alone. We explain why the animation sometimes stutters in terms of frame rate and I2C speed, give each eye its own screen with two OLEDs, and run the same project on an Arduino Uno.

How do robot eyes work? The RoboEyes library
In RoboEyes each eye is a filled rectangle with rounded corners. A blink is that rectangle's height shrinking to 1 pixel over a few frames and opening again. Moods come from triangles drawn over the eye in the background colour: an eye with its top corners cut away outwards looks tired, one whose inner corners drop looks angry, and one with a curved cut along the bottom looks happy. When the gaze changes, the eyes don't jump to the new spot; on every frame the library closes half of the gap between the current value and the target. This simple tweening makes the movement fast at first and slow at the end, which looks alive. It all runs inside update() without delay(), so loop() still has time to read sensors or talk over Wi-Fi.
| Part | Qty | Note |
|---|---|---|
| ESP32 DevKit | 1 | An Arduino Uno works too (one screen) |
| 0.96" I2C OLED (SSD1306, 128×64) | 1–2 | For the twin-eye version the second screen must be at address 0x3D |
| TTP223 touch sensor module | 1 | For touch reactions |
| Breadboard and jumper wires | 1 set | Female-to-male wires make life easier |
| 18650 cell and TP4056 charger module (optional) | 1 | For a wireless, portable robot |
Wiring: OLED and TTP223
| Connection | ESP32 | Arduino Uno |
|---|---|---|
| OLED VCC | 3V3 | 5V |
| OLED GND | GND | GND |
| OLED SDA | GPIO 21 | A4 |
| OLED SCL | GPIO 22 | A5 |
| TTP223 VCC | 3V3 | 5V |
| TTP223 GND | GND | GND |
| TTP223 I/O | GPIO 26 | D2 |
| 2nd OLED (twin eyes) | Same SDA and SCL lines, address 0x3D | Not recommended, not enough RAM |
Installing the libraries
- In the Arduino IDE, open the Library Manager, search for FluxGarage RoboEyes and install it; accept the Adafruit GFX library when it's offered as a dependency.
- In the same window, search for Adafruit SSD1306 and install it; when it asks about dependencies choose Install all so Adafruit BusIO is installed too.
- Under Tools > Board, pick ESP32 Dev Module for an ESP32 or Arduino Uno for an Uno.
- If you like, open File > Examples > FluxGarage RoboEyes > i2c_SSD1306_Basics for a quick check that the screen works.
First sketch: eyes that blink and look around
The code below starts I2C on GPIO 21 and 22 of the ESP32, opens the OLED at address 0x3C and switches on two automatic behaviours: blinking at random intervals and looking in random directions. Eye size, corner radius and the gap between the eyes are on separate lines, so you can shape your robot's face by changing the numbers.
1// ESP32 + 0,96" OLED: göz kırpan ve etrafına bakan robot gözleri / blinking robot eyes that look around
2#include <Wire.h>
3#include <Adafruit_GFX.h>
4#include <Adafruit_SSD1306.h>
5#include <FluxGarage_RoboEyes.h>
6
7Adafruit_SSD1306 display(128, 64, &Wire, -1); // 128x64, reset pini yok / no reset pin
8RoboEyes<Adafruit_SSD1306> roboEyes(display); // gözler bu ekrana çizilir / eyes are drawn on this display
9
10void setup() {
11 Serial.begin(115200);
12 Wire.begin(21, 22); // SDA = GPIO 21, SCL = GPIO 22
13 if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // adres 0x3C ya da 0x3D / address 0x3C or 0x3D
14 Serial.println(F("OLED bulunamadi / OLED not found"));
15 for (;;);
16 }
17 roboEyes.begin(128, 64, 60); // genişlik, yükseklik, en fazla 60 kare/s / max 60 fps
18 roboEyes.setWidth(36, 36); // göz genişliği (piksel) / eye width (px)
19 roboEyes.setHeight(36, 36); // göz yüksekliği / eye height
20 roboEyes.setBorderradius(8, 8); // köşe yuvarlaklığı / corner radius
21 roboEyes.setSpacebetween(10); // gözler arası boşluk / gap between the eyes
22 roboEyes.setAutoblinker(ON, 3, 2); // 3 s + 0-2 s rastgele aralıkla kırp / blink every 3 s + 0-2 s
23 roboEyes.setIdleMode(ON, 2, 2); // 2 s + 0-2 s'de bir başka yöne bak / look elsewhere every 2 s + 0-2 s
24}
25
26void loop() {
27 roboEyes.update(); // buraya asla delay() koyma / never put delay() here
28}The 60 in begin() is the maximum number of frames per second. setAutoblinker(ON, 3, 2) blinks at least every 3 seconds plus a random 0–2 seconds; people blink 15–20 times a minute, roughly every 3–4 seconds, so this looks very natural. setIdleMode(ON, 2, 2) turns the eyes towards a random point on the screen every 2–4 seconds. With two 36×36-pixel eyes and a 10-pixel gap the face is 82 pixels wide, which leaves the eyes 46 pixels of horizontal and 28 pixels of vertical travel on the 128×64 screen. Raise the radius to 18 for cute round eyes, or drop it to 2 for sharp-cornered robot eyes.
Moods, gaze directions and animations
| Command | What it does |
|---|---|
| setMood(DEFAULT) | Normal, open eyes |
| setMood(TIRED) | Upper eyelids droop outwards: tired, sleepy |
| setMood(ANGRY) | Inner corners drop: angry |
| setMood(HAPPY) | Bottom edge cut in a curve: smiling eyes |
| setPosition(N, NE, E, SE, S, SW, W, NW) | Turns the eyes to one of 8 directions; DEFAULT returns them to the centre |
| blink() and blink(left, right) | Blinks both eyes or just one (a wink) |
| close() and open() | Closes or opens the eyes (sleep) |
| anim_laugh() | Eyes shake up and down briefly: laughing |
| anim_confused() | Eyes shake left and right briefly: confused |
| setCuriosity(ON) | The eye on the side it's looking at grows: curious |
| setSweat(ON) | Sweat drops run down the forehead: flustered |
| setHFlicker(ON, 2) and setVFlicker(ON, 2) | Eyes tremble horizontally or vertically: scared, cold |
| setCyclops(ON) | Draws a single, large eye |
Combine these commands for much richer expressions. For curiosity, turn the eyes to E or W with setCuriosity(ON) enabled; for fear, use setHFlicker(ON, 2) together with setSweat(ON); for sleep, call setMood(TIRED) first and close() a few seconds later. Mood changes animate smoothly just like blinks, so when you switch from HAPPY to ANGRY the eyelids slide into their new position on screen.
A robot that reacts to a TTP223 touch sensor

The handiest part for letting the robot know it's being touched is the TTP223 capacitive touch sensor. It doesn't click like a mechanical button and it senses through thin plastic or cardboard, so you can hide it inside the robot's head. In the code below a short tap makes the robot happy and laugh, while a touch longer than a second makes it angry and confused. If nobody touches it for 20 seconds it looks sleepy, after 40 seconds it closes its eyes and sleeps, and a new touch wakes it up.
1// ESP32 robot gözleri + TTP223: dokununca sevinir, uzun dokununca kızar, yalnız kalınca uyur
2// ESP32 robot eyes + TTP223: happy on a touch, angry on a long touch, falls asleep when left alone
3#include <Wire.h>
4#include <Adafruit_GFX.h>
5#include <Adafruit_SSD1306.h>
6#include <FluxGarage_RoboEyes.h>
7
8const int TOUCH_PIN = 26; // TTP223 I/O (fabrika ayarı: dokununca HIGH) / factory default: HIGH while touched
9const unsigned long LONG_TOUCH = 1000; // uzun dokunuş sınırı (ms) / long-touch limit (ms)
10const unsigned long MOOD_TIME = 3000; // bir duygunun süresi / how long a mood lasts
11const unsigned long TIRED_AFTER = 20000; // 20 s dokunulmazsa uykulu / sleepy after 20 s alone
12const unsigned long SLEEP_AFTER = 40000; // 40 s sonra gözleri kapat / close the eyes after 40 s
13
14Adafruit_SSD1306 display(128, 64, &Wire, -1);
15RoboEyes<Adafruit_SSD1306> roboEyes(display);
16
17bool touching = false; // parmak şu an pedde mi? / finger on the pad right now?
18bool longDone = false; // bu dokunuşta kızgınlık gösterildi mi? / angry shown for this touch?
19bool sleeping = false;
20bool moodActive = false;
21unsigned long touchStart = 0;
22unsigned long lastTouch = 0;
23unsigned long moodStart = 0;
24
25void showMood(unsigned char mood) { // duyguyu başlat ve süreyi tut / start a mood and time it
26 roboEyes.setMood(mood);
27 moodActive = true;
28 moodStart = millis();
29}
30
31void wakeUp() { // uyuyorsa uyandır / wake up if asleep
32 if (!sleeping) return;
33 sleeping = false;
34 roboEyes.setMood(DEFAULT);
35 roboEyes.open();
36 roboEyes.setAutoblinker(ON, 3, 2);
37 roboEyes.setIdleMode(ON, 2, 2);
38}
39
40void setup() {
41 pinMode(TOUCH_PIN, INPUT);
42 Wire.begin(21, 22);
43 if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) for (;;);
44 roboEyes.begin(128, 64, 60);
45 roboEyes.setAutoblinker(ON, 3, 2);
46 roboEyes.setIdleMode(ON, 2, 2);
47 lastTouch = millis();
48}
49
50void loop() {
51 roboEyes.update();
52 unsigned long now = millis();
53 bool touched = digitalRead(TOUCH_PIN) == HIGH;
54
55 if (touched && !touching) { // dokunuş başladı / touch started
56 touching = true;
57 longDone = false;
58 touchStart = now;
59 wakeUp();
60 }
61 if (touched && !longDone && now - touchStart > LONG_TOUCH) { // uzun dokunuş: kızgın / long touch: angry
62 longDone = true;
63 showMood(ANGRY);
64 roboEyes.anim_confused();
65 }
66 if (!touched && touching) { // parmak kalktı / finger lifted
67 touching = false;
68 lastTouch = now;
69 if (!longDone) { // kısa dokunuş: mutlu / short touch: happy
70 showMood(HAPPY);
71 roboEyes.anim_laugh();
72 }
73 }
74
75 if (moodActive && now - moodStart > MOOD_TIME) { // duygu bitti / mood is over
76 moodActive = false;
77 roboEyes.setMood(DEFAULT);
78 }
79 if (!sleeping && !touching && !moodActive) {
80 if (now - lastTouch > SLEEP_AFTER) { // uyku: gözleri kapat / sleep: close the eyes
81 sleeping = true;
82 roboEyes.setAutoblinker(OFF);
83 roboEyes.setIdleMode(OFF);
84 roboEyes.setPosition(DEFAULT);
85 roboEyes.close();
86 } else if (now - lastTouch > TIRED_AFTER) {
87 roboEyes.setMood(TIRED); // uykulu göz kapakları / sleepy eyelids
88 }
89 }
90}The logic is a small state machine: millis() records when the touch starts and ends, and the decision is made when the finger lifts. That separates short and long touches and makes sure one touch is never counted twice. With no delay() anywhere, the eyes keep blinking smoothly even while they react. The TTP223's A and B jumpers should be left open, as they are from the factory; jumpers and sensitivity are covered in detail in the TTP223 touch sensor guide. If you'd rather not add a part, you can use the ESP32's own touch pins; see ESP32 touch pins.
Animation timing: frame rate and I2C speed
How smooth the eyes look depends more on the display bus than on the processor. A 128×64 OLED frame is 1024 bytes, and every frame sends all of them over I2C. Each I2C byte takes 9 bits including the acknowledge bit, so one frame, with address and command bytes, comes to about 10,000 bits. The Adafruit SSD1306 library raises the bus to 400 kHz during transfers by default, which works out to about 25 ms per frame, or at most 35–40 frames per second.
| Situation | Frame time | Result |
|---|---|---|
| I2C at 100 kHz | About 100 ms | 10 fps at most; movement visibly stutters |
| I2C at 400 kHz (Adafruit default) | About 25 ms | 35–40 fps; smooth animation |
| Asking for 60 fps with begin(..., 60) | 16 ms target | Capped by the display, no harm done; the eyes are drawn as fast as possible |
| Two OLEDs on one bus | About 50 ms | Around 20 fps per eye; a 30 fps setting is enough |
| delay(100) inside loop() | 100 ms or more | The eyes freeze; blinks and glances become jerky |
When you add your own code, the only rule is that loop() must get back to roboEyes.update() quickly on every pass. If you want to read a sensor every 100 ms, compare times with millis() instead of calling delay(100); the technique is explained in millis() vs delay(). Running Wi-Fi or a slow HTTP request on the ESP32's second core also keeps the eyes from ever stuttering.
Twin eyes with two OLEDs: a screen for each eye
To make the eyes bigger and more striking, give each one its own 0.96-inch OLED. The two screens share the same SDA and SCL lines but need different addresses: move the small resistor on the back of one screen from the 0x78 position to 0x7A and its address becomes 0x3D. Each screen uses RoboEyes' single-eye (cyclops) mode. Automatic blinking and idle movement stay off, because two separate objects would pick their own random timings, blink independently and look cross-eyed; instead, the code sends each blink and glance to both eyes at the same moment.
1// ESP32 + iki OLED: her ekranda bir göz, ikisi aynı anda kırpar ve bakar
2// ESP32 + two OLEDs: one eye per screen, blinking and looking in sync
3#include <Wire.h>
4#include <Adafruit_GFX.h>
5#include <Adafruit_SSD1306.h>
6#include <FluxGarage_RoboEyes.h>
7
8Adafruit_SSD1306 leftDisplay(128, 64, &Wire, -1); // adres 0x3C / address 0x3C
9Adafruit_SSD1306 rightDisplay(128, 64, &Wire, -1); // adres 0x3D (arkadaki direnç taşındı) / 0x3D (back resistor moved)
10RoboEyes<Adafruit_SSD1306> leftEye(leftDisplay);
11RoboEyes<Adafruit_SSD1306> rightEye(rightDisplay);
12
13const unsigned char LOOKS[] = {DEFAULT, N, NE, E, SE, S, SW, W, NW}; // merkez + 8 yön / centre + 8 directions
14unsigned long lastBlink = 0, blinkWait = 3000;
15unsigned long lastLook = 0, lookWait = 2000;
16
17// Bir göz ekranını hazırla / prepare one eye screen
18void setupEye(RoboEyes<Adafruit_SSD1306> &eye) {
19 eye.begin(128, 64, 30); // iki ekran aynı hatta: 30 kare/s yeter / two screens on one bus: 30 fps is enough
20 eye.setCyclops(ON); // ekranda tek, büyük göz / one big eye per screen
21 eye.setWidth(70, 0);
22 eye.setHeight(48, 0);
23 eye.setBorderradius(16, 0);
24 eye.setPosition(DEFAULT);
25}
26
27void setup() {
28 Wire.begin(21, 22);
29 if (!leftDisplay.begin(SSD1306_SWITCHCAPVCC, 0x3C)) for (;;);
30 if (!rightDisplay.begin(SSD1306_SWITCHCAPVCC, 0x3D)) for (;;);
31 setupEye(leftEye);
32 setupEye(rightEye);
33 randomSeed(esp_random()); // donanım rastgele sayı üreteci / hardware random number generator
34}
35
36void loop() {
37 leftEye.update();
38 rightEye.update();
39 unsigned long now = millis();
40 if (now - lastBlink > blinkWait) { // iki göz birlikte kırpar / both eyes blink together
41 leftEye.blink();
42 rightEye.blink();
43 lastBlink = now;
44 blinkWait = random(2500, 6000);
45 }
46 if (now - lastLook > lookWait) { // ikisi de aynı yöne bakar / both look the same way
47 unsigned char dir = LOOKS[random(9)];
48 leftEye.setPosition(dir);
49 rightEye.setPosition(dir);
50 lastLook = now;
51 lookWait = random(1500, 4000);
52 }
53}Mount the two screens about 1–2 cm apart in a cardboard or 3D-printed face. A 70×48-pixel eye fills most of the screen yet still leaves 58 pixels of side-to-side and 16 pixels of up-and-down travel. Each screen needs a 1 KB buffer, so this version relies on the ESP32's generous memory. For faster refresh you can put the second screen on the ESP32's second I2C peripheral (Wire1), or use an I2C multiplexer such as the TCA9548A for many screens.
Robot eyes on an Arduino Uno
The single-screen version also runs on an Arduino Uno or Nano; just connect the OLED to A4 (SDA) and A5 (SCL) and the TTP223 to D2. The Uno has only 2 KB of RAM: when the sketch below compiles, global variables take about 540 bytes, another 1024 bytes are allocated for the screen buffer at runtime, and about 480 bytes are left. So avoid printing long strings with Serial.print on the Uno, and wrap the ones you need in F(). The twin-screen version won't fit on an Uno; use an ESP32 or an Arduino Mega with 8 KB of RAM. In this sketch each touch steps the robot through its moods: normal, happy, tired and angry.
1// Arduino Uno + OLED + TTP223: her dokunuşta yeni bir duygu / a new mood on every touch
2#include <Wire.h>
3#include <Adafruit_GFX.h>
4#include <Adafruit_SSD1306.h>
5#include <FluxGarage_RoboEyes.h>
6
7Adafruit_SSD1306 display(128, 64, &Wire, -1); // SDA = A4, SCL = A5
8RoboEyes<Adafruit_SSD1306> roboEyes(display);
9
10const int TOUCH_PIN = 2; // TTP223 I/O
11const unsigned char MOODS[] = {DEFAULT, HAPPY, TIRED, ANGRY};
12byte moodIndex = 0;
13bool lastTouch = false;
14
15void setup() {
16 pinMode(TOUCH_PIN, INPUT);
17 if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) for (;;); // 1 KB'lık tampon RAM'den ayrılır / 1 KB buffer comes from RAM
18 roboEyes.begin(128, 64, 40);
19 roboEyes.setAutoblinker(ON, 3, 2);
20 roboEyes.setIdleMode(ON, 2, 3);
21}
22
23void loop() {
24 roboEyes.update();
25 bool touch = digitalRead(TOUCH_PIN) == HIGH;
26 if (touch && !lastTouch) { // yalnız dokunma anında / only at the moment of touch
27 moodIndex = (moodIndex + 1) % 4;
28 roboEyes.setMood(MOODS[moodIndex]);
29 if (MOODS[moodIndex] == HAPPY) roboEyes.anim_laugh();
30 if (MOODS[moodIndex] == ANGRY) roboEyes.anim_confused();
31 }
32 lastTouch = touch;
33}If you program a Raspberry Pi Pico from the Arduino IDE (the arduino-pico core), this Uno sketch runs unchanged with the OLED on GP4 (SDA) and GP5 (SCL) and the TTP223 on GP2; the Pico's 264 KB of RAM is plenty even for the twin-screen version. For more on the OLED itself, drawing shapes and screen lifetime, see OLED display SSD1306.
Robot eyes project ideas
- Desk companion robot: Put the eyes in a cardboard head and hide the TTP223 on top; you get a desk ornament that laughs when you pet it and sleeps when you forget it.
- A face for a robot car: Add eyes that look confused when an obstacle appears and happy when the road is clear; for the car itself see Arduino robot car.
- Eyes that follow you: Switch on curiosity mode and turn the eyes towards someone when an HC-SR04 sees them approach; distance measuring is in HC-SR04.
- Weather mood: Make eyes that sweat above 30 °C and shiver in the cold; for temperature readings see DHT11.
- A robot that reacts to clapping: When a sound sensor picks up a loud noise, the eyes tremble in surprise; see KY-038 sound sensor.
- Notification eyes: Let the eyes light up happily when the ESP32 receives a new message over Wi-Fi, and go to sleep after 11 pm.
Common mistakes and how to fix them
| Symptom | Likely cause | Fix |
|---|---|---|
| The screen is completely blank | Address is 0x3D, SDA and SCL swapped, or power reversed | Find the address with an I2C scanner; check the wires and pin order |
| "roboEyes does not name a type" error | Old example code, new library | Use RoboEyes<Adafruit_SSD1306> roboEyes(display); |
| On the Uno the screen won't start or the board hangs | Not enough RAM to allocate the 1 KB buffer | Remove unneeded variables and long Serial strings; use F() |
| The eyes move in jerks | There's a delay() in loop(), or I2C is at 100 kHz | Replace delay() with millis() and leave transfers at 400 kHz |
| The eyes never blink or move | update() isn't called, or the automatic modes are off | Call roboEyes.update() in loop(); enable setAutoblinker and setIdleMode |
| One of the two screens stays blank | Both screens have the same address | Move the resistor on the back of one screen to make it 0x3D |
| The robot gets happy on its own | The TTP223 calibrated while touched at power-up, or it's powered from 5 V | Don't touch the pad at power-up; power the module from 3V3 |
Robot eyes turn a screen that costs a few dollars into a creature with character, and with an ESP32 behind them they become a living companion that reacts to sensors, Wi-Fi and touch. In the BlueGrays app you can build the ESP32 and OLED robot eyes project, the OLED Pong and T-Rex games and other ESP32 display projects step by step, with circuit diagrams and commented code.
Frequently asked questions
Which OLED display do I need for robot eyes?
The most common choice is a 0.96-inch, 128×64-pixel I2C OLED with the SSD1306 driver, and the sketches in this guide work with it. 1.3-inch SH1106 screens work too with the Adafruit SH110X library, and RoboEyes ships an example for them. On 0.91-inch 128×32 screens you'll need to reduce the eye height.
Does the RoboEyes library work on an Arduino Uno?
Yes, with one screen. The sketch uses about 540 bytes of global variables and needs another 1 KB for the screen buffer, so the Uno's 2 KB of RAM gets tight. For the twin-screen version you need a board with more RAM, such as an ESP32, Arduino Mega or Raspberry Pi Pico.
How do I connect two OLED displays to the same I2C bus?
The two screens need different addresses: moving the small resistor on the back of one from the 0x78 position to 0x7A changes its address from 0x3C to 0x3D. If the address can't be changed, use the ESP32's second I2C bus (Wire1) or add an I2C multiplexer such as the TCA9548A.
Can I make robot eyes on a colour display?
RoboEyes is written for monochrome OLEDs and works with displays that send the image from a buffer. For colour TFT screens there are separate libraries such as TFT_RoboEyes. You can also draw the eyes yourself on round GC9A01 or ST7789 colour screens, but that needs an SPI connection and different code.
How long do ESP32 robot eyes run on a battery?
With Wi-Fi off the ESP32 draws about 40–50 mA and the OLED 10–25 mA depending on how many pixels are lit, about 60–75 mA in total. A 2000 mAh 18650 cell lasts roughly 25–30 hours at that rate. Closing the eyes, switching the screen off and putting the ESP32 to sleep at night stretches that a lot.
Why do my robot eyes move in jerks?
The most common cause is a delay() in loop(), because the eyes are only drawn when update() is called. The second is the I2C bus being left at 100 kHz, which limits you to about 10 frames per second. Use millis() instead of delay() and split long tasks into short steps.
Projects to build after reading this
See all projects
LED Blink with ESP32
Teaches basic GPIO output usage with ESP32. We achieve a blinking effect by turning an LED on and off from a digital pin. ESP32 version of the classic blink project on Arduino UNO; the basic blink commands in the Arduino environment are the same, but the ESP32's pin layout and 3.3 V GPIO levels differ from those of the Arduino UNO.

ESP32 LED Control with Pushbutton (Toggle)
Each time the button is pressed the state of the LED changes: if it is on it turns off, if it is off it turns on. Classic toggle pattern. With debounce we clean up the mechanical noise of the pushbutton to ensure a single toggle with a single press.

Paddle Ball Game - SSD1306
A ball, two paddles and you: you play table tennis, one of the very first video games, on a small OLED screen.

OLED T-Rex Run: Arduino Dinosaur Game
The dinosaur game that pops up when your internet goes down, now on your desk: the dinosaur runs across the small OLED screen, cacti come at you, and you jump with a single button.

ESP32 Deep Sleep — Battery Saving (OLED + RTC RAM Counter)
The ESP32's Deep Sleep mode shuts down the CPU and most peripherals, cutting current draw to about 10µA, which is vital for battery-powered IoT devices. This project uses three wake-up sources: a timer (15 s), an external pin (EXT0, the button on GPIO 33) and a touch pin (T0/GPIO 4). Counters marked with RTC_DATA_ATTR survive deep sleep.

ESP32 Color Mixer Light (3 Potentiometers + RGB LED + OLED)
A smart color-mixer lamp: turn 3 potentiometers on the ESP32 and mix any color you like! As you turn the red, green and blue potentiometers, the common-cathode RGB LED changes color instantly. The SSD1306 OLED display shows each channel's 0-255 value, fill bars and the HEX web color code (like #FF8040) live.

ESP32 Smart Lighting (PIR + LDR + Relay + OLED)
With an ESP32, a PIR motion sensor, an LDR light sensor and a relay module, we turn your hallway, bathroom or pantry into smart lighting. If the room is already bright, the light stays off even when there is motion, so it never wastes energy during the day. The light stays on for 30 seconds, and the time extends automatically while motion continues.

ESP32 RFID Door Lock (RC522 + Servo + OLED + Buzzer + LED)
We build a smart door lock with an ESP32, an RC522 RFID module, an SG90 servo, an SSD1306 OLED display, an active buzzer and 2 LEDs. When a card is scanned, its UID is checked against the authorized cards defined in the code; if it matches, the servo unlocks (green LED + 2 short beeps) and locks again after 5 seconds. An unknown card lights the red LED, gives 3 quick beeps and shows its UID on the OLED.
More articles
BlueGrays app
Build this circuit step by step on your phone
Wiring diagram, code and parts list on one screen. 500+ Arduino, ESP32 and Pico projects ready to build.
Scan with your phone
Point your camera at the code and your phone's app store opens.
or open the store

