uSonicTimer

ESP8266 · PlatformIO0.6.1 (73)PCB Rev DIn progressGPL-3.0-or-laterCERN-OHL-S-2.0

A timer and heater controller I added to a cheap ultrasonic cleaner. Firmware on an ESP8266, with a Nokia 5110 LCD, rotary encoder, DS18B20 and two solid-state relays — and the KiCad schematic and PCB for the Rev D board in the same public repo.

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, display unit (°F or °C), LCD contrast and backlight brightness are saved in (emulated) EEPROM, so they survive a power cycle.

  1. On power-up it shows a startup screen with the name, the firmware version and the board revision (v0.6.1 (73), PCB Rev D) for a second and a half, and loads the settings. Anything unset gets a default: 72 °F, 10 min, °F, contrast 52, backlight level 10.
  2. It shows the main menu, Start and Settings…, with the set temperature and time underneath. Highlight Start and long-press to begin a run.
  3. A run looks after the bowl by itself:
    • Heating: while the bowl is more than 10 °F below the set temperature, the heater is on, the cleaner is off and the countdown holds. The screen shows the bowl temperature in big digits with “Heating to 120°F” underneath, and the bar fills as the bowl warms up.
    • Cleaning: once the bowl is within 8 °F of the set temperature, the heater is off, the cleaner is on and the countdown runs: big MM:SS digits with a blinking colon, a progress bar, and the current and set temperatures underneath. If the bowl drops back below set − 10 °F, the heater comes on again and the countdown holds, so only cleaning time counts.
    • No sensor: if the DS18B20 isn’t there, the heater is locked off and the cleaner runs on the timer alone. The screen shows “NO SENSOR” instead of the temperatures.
    • At 0 both outputs switch off and a big DONE stays on screen until you turn the knob or press. A long press at any time aborts the run (both outputs off).
The heating screen on the Nokia 5110, rendered from the firmware's drawing code: the bowl temperature 99°F in big blocky digits, a part-filled progress bar, and Heating to 120°F underneath
Heating: bowl temperature in big digits, the countdown holds until it is up to temperature

The backlight doubles as a status light:

  • Steady: normal operation (menu, cleaning).
  • Flashing (1 Hz): heating up.
  • Pulsing: the run is done; it stops at the next turn or press.
  • Double-blink every 2 s: no temperature sensor during a run.
  • Dim (about 20 %) after 5 minutes without input in the menu; the first turn or press only wakes it.

The menu

Rotating moves the highlight and a long press (over 1 s) opens the highlighted item. In the menus a short press toggles the backlight; in a settings page a press saves and goes back (“Press = save”).

Main menu "uSonicTimer"   (set temperature and time shown underneath)
├── Start             heating screen / countdown screen / DONE, as above
│                     long press = abort (both outputs off)
└── Settings...
    ├── Set temp      3 digits in °F (60–180) or 2 in °C (16–82), cursor digit in reverse video
    │                 rotate = change digit; press = next digit, press on the last = save
    │                 long press = save from any digit
    ├── Set time      rotate = preset 3, 8, 10, 15, 20, 30, 60 min (wraps); press = save
    ├── Set units     °F Fahrenheit / °C Celsius; press = save
    ├── Set backlight Off, Level 1–10 with a bar, previewed live; press = save
    ├── Set contrast  20–100 with a bar, applied live; a quick turn takes bigger steps
    │                 press = save
    └── Exit          back to the main menu
The Settings menu on the Nokia 5110, rendered from the firmware's drawing code: a reverse-video Settings title bar, Set temp highlighted, then Set time, Set units and Set backlight, with a small arrow marking more items below
The Settings menu: four rows at a time, an arrow marks more below

Hold the button while powering up to get an encoder test screen instead of the menu; a long press leaves it.

The menu approach comes from the educ8s.tv menu tutorial.

Hardware (PCB Rev D)

The Rev D controller board is a KiCad 10 project (named uSonicTimer_1d) in the repo under hardware/uSonicTimer_1d/: schematic, PCB, design rules, project symbol and footprint libraries, Gerbers with an order zip, an interactive BOM and board renders. The board is CERN-OHL-S-2.0. A few parts use stock KiCad 3D models; ENC1 and J1 have no 3D body in the project.

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 RST – not connected
LCD backlight GPIO15 via Q1, 10K pull-down, PWM brightness
Encoder CLK / DT GPIO16 / GPIO12 4K7 pull-ups, both 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

  • Rev D boards are built and working on the bench.
  • Firmware 0.6.1 (build 73) is out on GitHub, tagged v0.6.0 and v0.6.1. It adds big chunky-digit countdown and temperature screens on the Nokia 5110, a countdown that waits until the water is up to temperature, a Settings menu (temperature, time, °F/°C, backlight, contrast) and backlight status signals.
  • The controller is now going into the cleaner: the wiring is done and the sensor is bonded to the bowl.
  • Next: finish the install and add build photos.
The 0.6.1 countdown screen on the Nokia 5110, rendered from the firmware's drawing code: big blocky digits reading 07:42, a progress bar, and Now 118 Set 120°F along the bottom
The 0.6.1 countdown screen, rendered from the firmware's drawing code

Versions are a version number plus a build number, like 0.6.1 (73). The build number goes up with every test build and never resets, and 1.0.0 will be the first version installed and in service. Releases are tagged on GitHub (v0.6.1).

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)

Flashing goes through the five pogo pads. The board’s auto-reset circuit needs both DTR and RTS from the serial adapter. The release environment is set to the ck reset method instead, for adapters without DTR: put the ESP8266 into its bootloader by hand by holding the 1-Wire line (GPIO0) low while you press RESET, then upload.

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 (everything under hardware/: schematic, PCB, libraries and fab outputs) are under the CERN Open Hardware Licence v2, Strongly Reciprocal (CERN-OHL-S-2.0). See LICENSE-HARDWARE.

Copyright © 2024 Somerled Design, LLC.

Buy the board

uSonicTimer 1d bare PCB — $20.95

The Rev D printed circuit board only: no parts, no ESP8266 module. It drives two off-board solid-state relays, which are not included; parts are listed in the KiCad project linked above.

Checking stock…

View cart

Checkout is on shop.somerled.design (Stripe). US shipping only; flat $4.95, free on orders of $25 or more. Buy 2, shipping's on us. Michigan addresses pay 6% sales tax.

uSonicTimer 5-position screw terminal set — $3.95

Fits the uSonicTimer 1d board. One 3-position and one 2-position PCB screw terminal block: 5 mm pitch, rated 10 A / 300 V, takes wire up to 14 AWG.

Checking stock…

View cart

Solid state relay — $23.95 each, or $34.95 for two

The uSonicTimer 1d drives two off-board solid state relays. These are surplus Potter & Brumfield (TE) relays, marked EDMZ-240D25R. I couldn't find a datasheet for that exact marking, so check the ratings printed on the relay before you wire it up.

Safety: this relay switches mains voltage. Wire it to code, at your own risk.

Checking stock…

View cart