Free code › Project #1
ESP32-S3 DS18B20 Wi-Fi temperature sensor
A $15 build that puts a live temperature graph on your phone. Sparky's first free project: an ESP32-S3-DevKitC-1-N16R8 reads a waterproof DS18B20 probe every 30 seconds and sends it - over verified HTTPS - to your free homeautomation.com dashboard.
Install from your browser (Chrome/Edge) or download the full PlatformIO project (free zip).
Parts list
| Part | Qty | Notes | |
|---|---|---|---|
| ESP32-S3-DevKitC-1-N16R8 | 1 | 16 MB flash, 8 MB PSRAM. Other S3 DevKitC variants work with small platformio.ini changes. | Check price |
| DS18B20 waterproof probe | 1 | Stainless tip, 1-3 m cable. Red = VDD, black = GND, yellow = DATA. | Check price |
| 4.7 kΩ resistor | 1 | The 1-Wire pull-up (yellow-violet-red bands). Some probe kits include one on a little adapter board. | Check price |
| Breadboard + jumper wires | 1 | Full-size breadboard; the DevKitC is wide, so it covers one row of holes on each side. | Check price |
| USB-C data cable | 1 | Must be a data cable - many "charge only" cables won't show up as a port. | Check price |
Wiring
| DS18B20 wire | ESP32-S3 pin | Notes |
|---|---|---|
| VDD (red) | 3V3 | 3.3 V - not 5 V. |
| GND (black) | GND | Any GND pin. |
| DATA (yellow) | GPIO4 | + 4.7 kΩ from GPIO4 to 3V3. |
Why GPIO4? It's a plain GPIO with no side jobs. We stay away from the strapping pins (GPIO0, 3, 45, 46), the native USB pins (GPIO19/20) and GPIO35-37, which the octal PSRAM on N16R8 modules uses internally.
Wi-Fi setup from your phone (no code edits)
The firmware has its own setup page, so nobody has to edit a file before compiling. Here is what you see:
- Power the board. With nothing saved yet, the LED pulses blue and the board opens an open Wi-Fi network named Sparky-Setup-XXXX (XXXX = the last 4 characters of its MAC address, printed on the serial monitor too).
- Get your device key first. Your phone has no internet while it is on the setup network, so sign up, tap Create device + key on the dashboard and copy the key (it starts with
hak_). - Join Sparky-Setup-XXXX on your phone. The setup page pops up by itself (Android: "Sign in to network", iPhone: a captive sheet). If not, browse to
http://192.168.4.1. - Pick your Wi-Fi from the scanned list (signal bars, Refresh, or "Other / hidden network"), type its password, paste the device key, optionally name the device. The Advanced section holds the ingest URL (default
https://api.istuff.io/v1/ingest). - Save & connect. The board test-connects (LED blinks blue fast). On success the page shows the board's new IP and name, the settings are stored in the board's flash, and it restarts into normal mode. On failure it tells you what went wrong and stays in setup.
- Watch your dashboard. Readings arrive every 30 seconds.




Screenshots are the real setup page rendered at phone size. The page is about 15 KB (8 KB compressed) and works with no internet at all.
Starting over: hold the BOOT button for 5 seconds while the board is running (the LED flickers purple/white, then turns green). Release it and the board erases the saved Wi-Fi and key and reboots into setup mode. If the saved Wi-Fi is unreachable for about 3 minutes (new router, moved house), the setup network reopens by itself while the board keeps retrying.
Security note: the setup network is open so the page pops up on every phone, which means your Wi-Fi password travels unencrypted over a few metres of air for a few seconds. Do setup at home, not in a crowded place, or build with -DSETUP_AP_PASSWORD="\"yourpass\"" for a password-protected setup network (printed on the serial monitor).
Flash it from your browser
No PlatformIO, no drivers to compile anything: plug the board in and click. Works in Chrome or Edge on Windows, macOS, Linux or ChromeOS (Web Serial; Firefox and Safari can't do this).
- Plug the ESP32-S3-DevKitC-1 into your computer with a USB data cable (either USB-C port works for flashing).
- Click Install, choose the board in the browser's port list (USB JTAG/serial debug unit or CP210x/CH343) and confirm. First install on a used board: tick Erase device. Updating a working sensor: leave it unticked so your Wi-Fi settings survive.
- Wait about a minute, then follow the phone setup above. Nothing to type into code.
Prefer another tool? Download factory.bin (1013 KB, merged image for address 0x0), sha256 00e59eec2f57b692… and run esptool.py --chip esp32s3 --baud 460800 write_flash 0x0 factory.bin.
How it works
- Every 30 s the board reads the probe at 12-bit resolution (0.0625 °C steps).
- It POSTs
{"temp_c":21.44,"temp_f":70.59,"rssi":-58,"uptime":1234,"sensor_ok":1}tohttps://api.istuff.io/v1/ingestwith your device key.https://homeautomation.com/api/v1/ingeststill works as a legacy alias. - The server certificate is verified against the embedded ISRG Root X1/X2 - no
setInsecure()shortcuts. - If the server says "too soon" (HTTP 429), it waits exactly the
Retry-Afterseconds. - Wi-Fi drops? It reconnects on its own. Bad readings (-127 °C disconnected, 85 °C power-on value) are retried and never graphed.
- On your home network the board also serves a small read-only status page at
http://sparky-XXXX.local/(or its IP): current temperature, last post result, signal and uptime. Settings can only be changed with the BOOT-button reset.
Status LED
The onboard RGB LED is on GPIO48 on DevKitC-1 v1.0 boards. v1.1 boards use GPIO38 - add -DRGB_LED_PIN=38 to build_flags if yours stays dark.
| blue pulse | Setup mode: join Sparky-Setup-XXXX |
| blue fast blink | Testing the Wi-Fi you entered |
| blue slow blink | Wi-Fi is down, retrying |
| green flash | Reading accepted (steady green = setup saved, restarting) |
| yellow blip | Server asked to wait (429) |
| red blip | Sensor problem - check wiring and the pull-up |
| purple blip | Network/TLS/server error, retrying in 60 s |
| white blip | Device key rejected (401): hold BOOT 5 s and enter a fresh key |
Or build it from source (PlatformIO)
- Create a free dashboard account and click Create device + key.
- Download the project zip and unzip it.
- Open the folder in VS Code with PlatformIO, then Build and Upload to the port labelled USB. First time? Follow the PlatformIO guide.
- Join Sparky-Setup-XXXX with your phone, enter Wi-Fi + key, and watch your dashboard.
Optional: copy include/secrets.example.h to include/secrets.h and fill it in to bake Wi-Fi and key into the firmware to bake Wi-Fi and key into the firmware. It is only used while nothing is saved on the board.
License
PolyForm Noncommercial 1.0.0: free for personal, hobby and educational use; commercial use needs a license (contact us). The firmware source and the prebuilt firmware above are covered; the homeautomation.com website and dashboard are not part of this release.