ESP32 & ESP8266 Connectivity · Intermediate · Web control
ESP32 Sensor Hub with Web UI
Several sensors behind one page, so the whole rig reads at a glance.
Firmware status: Generated from this project's own pin map and compiled with arduino-cli for esp32:esp32:esp32 before publication; bench validation on your hardware is still required.
Board: ESP32 DevKit (ESP32-WROOM-32, 30 or 38 pin) · ESP32 dual core @ 240 MHz · 3.3 V logic · build for esp32:esp32:esp32.
What you will build
An ESP32 reading multiple analog channels and serving them as both a page and JSON, with the reading rate visible.
Components
- ESP32 board
- Three analog sensors (light, temperature, position)
- Jumper wires and a breadboard
- 5 V USB supply
Pin map for this build
| Sketch constant | Pin | What it is |
|---|---|---|
PIN_OUT_1 | 4 | Switched output — relay / MOSFET channel, 5 V coil |
PIN_IN_1 | 34 | Analog input — 3.3 V maximum at the pin |
PIN_IN_2 | 35 | Analog input — 3.3 V maximum at the pin |
Tools
- USB programming cable
- Multimeter
- Current-limited bench supply (for anything that switches a load)
- Small screwdriver and wire cutters
Build sequence
- Add one sensor at a time and confirm each reading before adding the next.
- Flash and open the page; compare each value against a known reference.
- Poll /data from a script and confirm the values change at the rate you expect.
- Leave it running for an hour and check the heap figure in the log for a slow leak.
Test and expected result
All channels read and track their sensors, JSON is stable over hours, and free heap does not fall continuously.
Acceptance checks
all channels read, json stable, heap flat over an hour
Safety and limits
Sensors sharing a supply can couple noise into each other. If one channel is erratic, power it separately before rewriting the code.
Hardware scope
Multiple ADC channels, page plus JSON, heap reporting.
Connection diagram
Download the connection diagram (SVG)
Download the Arduino sketch (E27_esp32_sensor_hub_web_ui.ino)
Guide source: the sketch on this page was generated from the pin map above and compiled for esp32:esp32:esp32 before publication.
Related projects
- ESP32 Captive Portal Wi-Fi Manager — Boot the ESP32 with no credentials and configure its network from a phone, with the portal saved to flash.
- ESP8266 Config Portal — The same idea on the cheapest board that can do it: an ESP8266 that configures itself from a browser.
- ESP8266 Sensor Portal Logger — A battery-minded sensor node you configure in the field, with the reading shown on its own setup page.