uSonicTimer
Firmware for a timer and heater controller I added to a cheap ultrasonic cleaner. A Nokia 5110 LCD shows a menu you drive with a rotary encoder; a DS18B20 sensor watches the bowl temperature, and two solid-state relays switch the heater and the cleaner.
Mains voltage. The controller switches the 110 VAC bowl heater and the ultrasonic cleaner through solid-state relays. If you build one, treat it with the respect mains deserves. It comes with no warranty.
What it does
It runs on an ESP8266 (ESP-12E module). The set temperature, timer preset and LCD contrast are saved in (emulated) EEPROM, so they survive a power cycle.
- On power-up it loads the settings. Anything unset gets a default: 72 °F, 10 min, contrast 64.
- It shows the main menu. Rotate to pick an item; a long press opens it.
- Start Timer counts down and runs the bowl:
- while the bowl is more than 10 °F below the set temperature, the heater is on and the cleaner is off;
- once it’s within 10 °F, the heater is off and the cleaner is on;
- at 0, or on a long press, both outputs switch off and the menu comes back.
The menu
Rotating moves the highlight, a long press (over 1 s) opens the highlighted item, and a short press toggles the backlight.
Main menu
├── Start Timer "Time Left: m:ss" / "Temp: <current>F / <set>F"
│ runs heater/cleaner as above; long press = abort (both outputs off)
├── Set Timer "Set Timer: <n> min"
│ rotate = choose preset 3, 8, 10, 15, 20, 30, 60 min (wraps)
│ press = save to EEPROM and return
├── Set Temp "Set Temp: ddd F" (3 digits, cursor digit in reverse video)
│ short press = move cursor; rotate = change digit (0–9, wraps)
│ long press = save to EEPROM and return
└── Contrast "Contrast: ddd" (3 digits, cursor digit in reverse video)
short press = move cursor; rotate = ±100 / ±10 / ±1 (0–255, live)
long press = save to EEPROM and return
The menu approach comes from the educ8s.tv menu tutorial.
Hardware (PCB rev 1d)
| Signal | ESP8266 GPIO | Notes |
|---|---|---|
| LCD SCLK / DIN | GPIO14 / GPIO13 | software SPI |
| LCD D/C | GPIO1 (TX) | shared with UART TX |
| LCD CS | GPIO2 | 10K pull-up |
| LCD backlight | GPIO15 | via Q1, 10K pull-down |
| Encoder CLK / DT | GPIO16 / GPIO12 | CLK polled (no interrupt on GPIO16) |
| Encoder switch | GPIO3 (RX) | shared with UART RX |
| Heater SSR / Cleaner SSR | GPIO4 / GPIO5 | HIGH = on, NPN low-side drivers |
| DS18B20 1-Wire | GPIO0 | 4K7 pull-up; also the program strap |
Programming is through five pogo pads (GND, RTS, TX, RX, DTR), with RTS and DTR driving the auto-reset and boot circuit. Because the UART pins double as the LCD D/C line and the encoder switch, the serial output from the debug build shares those lines. The README has the full pin map, with the Arduino and module pin numbers.
Status
- Maintenance only.
- There’s no tagged release; build it from the source.
Build and flash
It’s a PlatformIO project for the espressif8266 platform, board esp12e, Arduino framework. PlatformIO fetches the libraries (U8g2, ESP Rotary, Button2, OneWire and DallasTemperature) for you.
pio run -e release # build the release firmware
pio run -e release -t upload # flash it over the programming header
pio device monitor -b 115200 # serial monitor (debug build)
platformio.ini keeps the build output under ~/Library/Caches/PlatformIO/uSonicTimer/, out of Dropbox. On a machine that isn’t a Mac, change or remove those two paths.
Feedback
Questions or fixes: please open an issue on GitHub.
License
uSonicTimer has two licences:
- The firmware and code are under the GNU General Public License, version 3 or later (GPL-3.0-or-later). See LICENSE.
- The hardware design files (the KiCad schematic and PCB, which aren’t in the repo yet) are under the CERN Open Hardware Licence v2, Strongly Reciprocal (CERN-OHL-S-2.0). See LICENSE-HARDWARE.
Copyright © 2024 Somerled Design, LLC.