Home › ESP32 simulator

ESP32 simulator

An ESP32 DevKit (WROOM and S3), a Raspberry Pi Pico 2 and a LILYGO T-SIM A7670E on the bench, programmed in Arduino C++ in the built-in editor. GPIO, PWM, ADC, I²C, SPI, UART, interrupts, deep sleep, Wi-Fi and LTE drive real circuit parts: sensors, OLED and TFT displays, relays, motor drivers, GPS, a microSD card. The code runs against the circuit solver, so a sensor divider that is wrong gives a wrong reading, a relay coil without a diode spikes, and a board on a flat battery browns out, exactly as on the desk. Wokwi diagrams import straight onto the bench.

ESP32 and LCD bench

Open the labFree, in your browser, no account needed. Part of a free electronics simulator with 293 parts, 193 lessons and 66 builds.

What you can do

Builds (3)

ESP32 battery sensor node

Wakes, reads a sensor, reports, sleeps.

LILYGO T-SIM A7670E: an ESP32 and an LTE modem on one board

ESP32-WROVER-E + SIMCom A7670E LTE Cat-1 board: power-on sequence, registration, data context, BAT_ADC.

Motion-activated light

Lights for 30 s when someone passes.

Lessons (30)

SPI bus: MAX7219 display

SPI is the other main serial bus. The master drives a clock (SCK) and shifts data out on MOSI while each device has…

Detecting USB plug-in with an ESP32

A device knows a cable was plugged in by watching VBUS. Divide the 5 V down to a safe level for a 3.3 V GPIO and…

Light sensor with an ESP32

An LDR and a fixed resistor make a voltage divider whose output falls as it gets darker. The sketch reads it on GPIO34…

Wi-Fi and HTTP to the cloud

Connect to the bench access point and POST a JSON message to a server every 10 seconds. This is the last step of every…

Send an SMS with the A7670 LTE module

Cellular modules are driven by AT commands over a serial port. Press the button and the ESP32 tells the A7670 to send…

Capstone: solar-powered GPS tracker

Everything together: a solar panel and charge controller keep a LiFePO4 battery up, a buck converter makes 5 V, the…

Interrupts and debouncing

An interrupt runs a function the instant a pin changes, even while loop() is busy, so no press is ever missed. But a…

Deep sleep and battery life

A battery device spends most of its life asleep. Awake, the ESP32 chip draws about 45 mA; in deep sleep only its…

Settings that survive a reset (NVS)

RAM is wiped every time the chip resets or loses power. To keep a setting, a calibration or a counter, a program…

Watchdog timer

Field devices hang: a sensor stops answering, a network call never returns. A watchdog is a hardware timer the program…

I²C sensor: accelerometer tilt

An accelerometer at rest measures gravity. How the 1 g splits across its x, y and z axes tells you how it is tilted…

I²C sensor: temperature, humidity, pressure

Environmental sensors like the BME280 sit on the I²C bus at a fixed address and return calibrated readings. A library…

PWM actuator: hobby servo

A hobby servo is position-controlled by pulse width, not duty cycle: every 20 ms it expects a pulse between 0.5 ms…

PWM actuator: DC motor through a MOSFET

A GPIO pin gives a few milliamps; a motor wants an amp. A logic-level MOSFET switches the motor’s own supply, and PWM…

Monitoring a supply rail with the ADC

The ESP32’s ADC reads from about 0.15 V to 3.1 V at its default setting, and is only straight up to about 2.45 V. So a…

Blink: your first sketch

Every microcontroller course starts here: setup() runs once, loop() runs forever. digitalWrite() switches a pin…

Analog in, PWM out

analogRead() turns a voltage into a number from 0 to 4095, but the ESP32’s ADC is not a straight line: at its default…

I²C scanner

I²C devices share two wires (SDA, SCL) and each answers to its own 7-bit address. A scanner tries every address and…

16×2 I²C LCD

Show text and numbers on a character LCD over I²C. Here a 12 V adapter feeds an HW-688 for 5 V, the ESP32 reads a pot…

H-bridge: PWM speed, direction and braking

Four switches let current flow through the motor either way. The DRV8833 takes two logic inputs per motor: one high…

ULN2003 driver array for a stepper

An ESP32 pin can give about 20 mA at 3.3 V; a stepper phase wants 100 mA at 5 V. The ULN2003 has seven Darlington…

Bidirectional I²C level shifter (BSS138)

A 3.3 V ESP32 and a 5 V I²C device share a wire that either side may pull low. One BSS138 MOSFET per line does it…

Load-cell scale front end

Four strain gauges on a metal bar form a Wheatstone bridge whose output is a millivolt or two at full load. The HX711…

ADC front end: reference and anti-alias filter

Sampling at 1 kHz can only represent signals below 500 Hz; anything faster (here 3 kHz interference) folds down and…

Strapping pins: when the board will not boot

Five ESP32 pins are read once, as the chip leaves reset, to decide how it starts: GPIO0 (run your program, or wait for…

Arduino Uno: upload your first sketch

An Arduino is a computer on a chip with pins you can switch. It comes with Blink already loaded, so the L LED flashes…

Reading a button: floating inputs and INPUT_PULLUP

A pin set to INPUT with nothing driving it floats: it picks up hum from the room and reads random HIGHs and LOWs…

analogRead and PWM: a pot dims an LED

analogRead turns 0–5 V into a number from 0 to 1023 (10 bits). analogWrite cannot make a real voltage: it switches the…

Powering an Arduino: USB, VIN and the regulator

On USB the board runs from the computer’s 5 V (through a 500 mA fuse on the Uno). On VIN or the barrel jack, the…

Arduino Nano on a breadboard: a servo sweep

The Nano is an Uno shrunk to 45 × 18 mm, with the same ATmega328P. The Servo library makes 50 Hz pulses on any pin…

Parts (40)

Arduino Uno R3 (ATmega328P)

Arduino Uno R3 · ATmega328P 16 MHz, 5 V logic · 32 KB flash (0.5 KB bootloader), 2 KB SRAM, 1 KB…

Arduino Nano (ATmega328P, FT232RL)

Arduino Nano · ATmega328P 16 MHz, 5 V logic · 32 KB flash (2 KB bootloader), 2 KB SRAM, 1 KB…

ESP32 DevKit (ESP32-WROOM-32, AMS1117)

ESP32-WROOM-32 DevKit V1 · 30 pins · 3.3 V logic · VIN 5 V through AMS1117

ESP32-S3 DevKitC-1 (ESP32-S3-WROOM-1, ESP32-S3-WROOM-1-N8R8, SGM2212)

ESP32-S3-DevKitC-1 v1.1 · ESP32-S3-WROOM-1-N8R8 (8 MB flash, 8 MB octal PSRAM) · dual-core 240 MHz…

Raspberry Pi Pico 2 (RP2350A, RT6154A, RP2350)

Raspberry Pi Pico 2 · RP2350A dual Cortex-M33 (or Hazard3 RISC-V) at 150 MHz · 520 KB SRAM · 4 MB…

LILYGO T-SIM A7670E R2 (ESP32-WROVER-E, ESP32)

LILYGO T-SIM A7670E R2 · ESP32-WROVER-E (240 MHz, 4 MB flash, 8 MB PSRAM, Wi-Fi + BLE) · SIMCom…

Orange Pi One

Orange Pi One · Allwinner H3 quad Cortex-A7 1.2 GHz, Mali-400 MP2 · 512 MB DDR3 · boots from…

Coin acceptor

Multi-coin acceptor · DC 12 V ±10 % · 80 mA idle, 250 mA accepting · open-collector COIN output…

Coin slot (₱5 only)

Single-coin validator taught the ₱5 · DC 12 V ±10 % · 80 mA idle, 250 mA accepting ·…

I2C LCD (HD44780, PCF8574)

HD44780 16×2 character LCD · PCF8574 I2C backpack at 0x27 · 5 V · white on blue

MAX7219 8-digit display

MAX7219 LED driver with eight 7-segment digits · SPI write-only: DIN, CLK, CS (load) · 5 V · send…

ILI9341 2.8" TFT (SPI) (MSP2807, MSP2806, XPT2046)

2.8" TFT LCD module, ILI9341 controller, 240 × 320, 65K colours, 4-wire SPI · VCC 3.3–5 V (662K…

1.69" IPS TFT (ST7789) (ST7789V2)

1.69" IPS LCD module, ST7789V2 controller, 240 × 280, 65K colours, 4-wire SPI (write only) · VCC…

OLED display (I²C) (SSD1306, SH1106)

0.96" 128×64, white · SSD1306 · I²C 0x3C

MPU-6050 IMU (GY-521)

GY-521 breakout · 3-axis accelerometer ±2 g and gyro ±250 °/s · I²C at 0x68 · 3.3–5 V, pull-ups on…

BME280 environment sensor

BME280 breakout · temperature ±1 °C, humidity ±3 %, pressure ±1 hPa · I²C at 0x76 · 3.3 V · now 29…

Hobby servo (SG90)

SG90 micro servo · 4.8–6 V · 50 Hz pulses: 0.5 ms = 0°, 1.5 ms = 90°, 2.5 ms = 180° · ~10 mA…

GPS module

u-blox NEO-6M on a GY-NEO6MV2 board · VCC 3–5 V (3.3 V LDO), 3.3 V UART · Open sky · NMEA at 9600…

4G LTE module

SIMCom A7670 LTE Cat-1 board · VIN 5–12 V · UART 3.3 V at 115200 · SIM inserted

MAX485 RS-485 module (MAX485CSA, MAX3485)

MAX485 half-duplex RS-485 transceiver module · 5 V part (works at 3.3 V on the bench, out of spec…

microSD card module (AMS1117, 74LVC125A, FAT32)

Micro SD Card Adapter (AMS1117 + 74LVC125A, 5 V) · 16 GB microSDHC (FAT32)

DS3231 RTC module (ZS-042) (DS3231SN, AT24C32)

DS3231SN real-time clock, ±2 ppm TCXO · AT24C32 EEPROM · CR2032 (3 V lithium, NOT rechargeable)

L298N motor driver

L298N dual H-bridge module · 5–35 V motor supply · 2 A per channel (bipolar Darlington outputs…

DRV8833 motor driver

DRV8833 dual H-bridge breakout · 2.7–10.8 V · 1.5 A per channel (MOSFETs, about 0.36 Ω per side) ·…

INA219 current sensor

INA219 breakout · 0.1 Ω shunt between VIN+ and VIN− in the high side · measures shunt voltage…

ACS712 Hall current sensor (ACS712ELC, ACS712ELC-5A)

ACS712ELC-5A breakout · Hall-effect, isolated from the load path (1.2 mΩ) · OUT = V_CC/2 + 185 mV…

HX711 load-cell ADC

HX711 breakout · 24-bit ADC with a gain-128 bridge amplifier · supplies the bridge excitation (E+…

PAM8403 class-D amp

PAM8403 stereo class-D amplifier board · 2.5–5.5 V · 2 × 3 W into 4 Ω · gain 24 dB (× 16…

Relay module (SRD-05VDC)

1-channel relay board · 5 V coil (SRD-5VDC) with transistor, flyback diode and indicator LED ·…

nRF52832 BLE module

Ebyte E73 (nRF52832) · Bluetooth LE · 1.7–3.6 V · 1.9 µA asleep with the RTC, low-power comparator…

E-paper display 1.54" (SSD1681)

1.54-inch e-paper module (SSD1681) · 200 × 200 · SPI · 3.3 V · draws about 5 mA for 2 s while it…

DS18B20 temperature sensor

DS18B20 digital thermometer · −55 to 125 °C, ±0.5 °C · 1-Wire bus on DQ: needs a 4.7 kΩ pull-up to…

LM35 temperature sensor (LM35DZ)

LM35DZ analog thermometer · output 10 mV per °C (250 mV at 25 °C) · 4–30 V supply · ±0.5 °C · now…

MAX6675 thermocouple module

MAX6675 board with a K-type thermocouple · 0–1024 °C in 0.25 °C steps · SPI read-only: SO, SCK, CS…

PIR motion sensor (SR501)

HC-SR501 passive infrared motion sensor · 4.5–20 V · output 3.3 V HIGH for 3 s after movement…

Ultrasonic distance sensor (SR04)

HC-SR04 ultrasonic ranger · 5 V · send a 10 µs pulse on TRIG; ECHO then goes HIGH for 58 µs per cm…

Hall-effect switch

A3144 unipolar Hall switch · 4.5–24 V · open-collector output pulls LOW while a magnet's south…

Reed switch

Glass reed switch · contacts close when a magnet is near · 0.5 A, 100 V · used in door/window…

Soil moisture sensor

Capacitive soil-moisture probe v1.2 · 3.3–5.5 V · analog output about 2.9 V in dry air falling to…

Microphone amplifier (MAX4466)

Electret microphone with a MAX4466 amplifier · 2.4–5.5 V · output sits at V_CC/2 and swings with…

Calculators

LED resistor calculator

The series resistor for one LED or a string

Voltage divider calculator

Vout from two resistors, or the resistor for a wanted Vout

Also on the lab

Solar PV simulator · Battery and BMS simulator · Arduino simulator · Breadboard simulator · House wiring simulator · PCB layout and perfboard · Brownout backup · Piso Wi-Fi on solar · Questions answered · Compared with other simulators