Steve SpenceKK4HFJ · Advanced Research Systems

Books · Python & electronics

Draw It, Wire It, Run It

The official guide to building control panels in Python with PanelWorks: screens with gauges, lamps, buttons, charts and alarms that talk to the devices in your shop, your shack and your house.

Now on Amazon · Paperback · Kindle (affiliate links) · Free code on GitHub

Remember Visual Basic?

You drew a form, double-clicked a button, typed a few lines, and you had a program. PanelWorks brings that back in Python and points it at real hardware. This book shows you how to use it: draw the panel, wire it to the device, and run it.

You'll build:

  • A relay board and a bench meter over USB serial, with an Arduino or an ESP32
  • A cistern pump controller over MQTT, with logins, Last Will and TLS
  • Modbus panels for energy meters, and an ESP32 gateway for RS-485 meters
  • An SNMP dashboard for a fleet of UPSes, and a USB UPS read through NUT
  • Alarms with delays, deadbands and priorities, sent to your phone with Telegram and n8n
  • An off-grid power dashboard for a Victron GX, with history in InfluxDB and Grafana
  • A garden irrigation controller that checks the rain forecast before it waters
  • A ham shack panel for a radio's CAT port, a GPS and a packet TNC
  • A truck scale, the project that started it all, thirty years ago, in Visual Basic

You'll also let Claude read and drive a running panel, turn a panel into a program anyone can run, put it on your phone, reach it from anywhere with Tailscale, and hang it on the wall on a Raspberry Pi.

Every chapter that uses hardware ends with a fake of that hardware, in Python or on a bare ESP32, so you can build the panel before the parts arrive. Every example was tested before it went in the book. The appendices include a Control Cookbook with a working example for every control, a VB6-to-Python phrasebook, and a guide to writing your own fake devices.

Buy the paperback Buy for Kindle

Amazon links. As an Amazon Associate I earn from qualifying purchases.

Draw It, Wire It, Run It cover
  • FormatPaperback, 7 × 10 in, 277 pages; Kindle eBook
  • ISBN9798147743225 (paperback)
  • SoftwareWritten for PanelWorks 1.0.1
  • HardwareArduino, ESP32, Raspberry Pi, RS-485, UPSes, radios
  • Price$24.99 paperback, $9.99 Kindle
  • BuyPaperback · Kindle
  • StatusAvailable now
  • CodeGitHub (MIT licence)

The code is free

Every listing in the book is a complete file in the book's GitHub repository, folder by chapter: github.com/KK4HFJ/draw-it-wire-it-run-it. PanelWorks itself is free too: pip install panelworks, or see PanelWorks on GitHub.

Fixes to the code land in the repository first, so if a listing gives you trouble, get the latest copy from there before you type it in again.

Errata and updates

First edition, December 2026. Written for PanelWorks 1.0.1.

PanelWorks 1.0.1: OptionButtons in a Frame lose their starting choice in the Designer

Where: Chapter 3, the GenLog panel (optLight, Value True), and any panel with a preselected OptionButton inside a Frame. Affects: PanelWorks 1.0.1, the Designer only. Running panels are fine.

What you see: the button you set to True shows as unselected in the Designer, and when you save from the Designer, "Value": true is left out of the .json file, so the panel starts with no choice selected.

Fix: upgrade to PanelWorks 1.0.2 (due Tuesday 8 December 2026): pip install --upgrade panelworks. Until then, open the .json and put "Value": true back on the button, or copy the file from the book's code on GitHub.

Using a newer PanelWorks? The book's examples are tested against 1.0.1. If a later release changes something the book relies on, the note goes here.

Questions and discussion

Built something with the book, stuck on a chapter, or want to show off your panel? Post it in the book's GitHub Discussions, where other readers can see the answer too. You need a free GitHub account to post.

About the author

Steve Spence is a U.S. Navy veteran, an engineer and an off-grid homesteader. He has spent his working life building practical systems, from automated test benches and plant phone systems to solar and wind power, and he is a certified small engine mechanic and a ham radio operator.

In the 1990s he wrote a Visual Basic program that read a truck scale over a serial port. PanelWorks brings that way of working to Python.

Report a problem or ask a question

Found a mistake in the text, or a listing that doesn't run? Pick Correction and tell me the chapter and page, or the listing's file name, plus what you expected and what happened. Include your PanelWorks version (pip show panelworks), your operating system and your board if it's a sketch.

For anything else, pick Question or other message. Questions other readers might share are best asked in Discussions.

Messages come straight to me, and your email address is only used to reply to you. Confirmed corrections are listed under Errata above.