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 constantPinWhat it is
PIN_OUT_14Switched output — relay / MOSFET channel, 5 V coil
PIN_IN_134Analog input — 3.3 V maximum at the pin
PIN_IN_235Analog 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

  1. Add one sensor at a time and confirm each reading before adding the next.
  2. Flash and open the page; compare each value against a known reference.
  3. Poll /data from a script and confirm the values change at the rate you expect.
  4. 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

Connection diagram for ESP32 Sensor Hub with Web UI

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

Back to all project guides · Study the course