Electrical Safety Tester

Earlier this year a client asked me to replace their aging and unreliable Ground-Bond and Hi-Pot test PC and program. It is used for every electrical panel produced so it is used constantly.

Old System

The external USB buttons had become unreliable, the program kept needing restarts several times a day, and the previous engineer had hard-coded it to the instruments so the tester would not work with another set of recently calibrated test instruments.

Python Rewrite

I decided to rewrite the program from scratch in Python because:

  • The source code stays in the computer; any future engineer can easily update it
  • The previous UI was just awful
  • It should be written for the general set of instruments, not a specific unit

CustomTkinter instead of PyQt

Since the touch GUI just needed some simple check boxes and buttons, I did the UI in CustomTkinter. CustomTkinter is simple, fast to pick up, and fast to develop in without the overhead and complexity of PyQt.

GUI

Self-Contained Test Controller

Touchscreen Computer

I replaced the PC/LCD monitor/keyboard/mouse with a small, inexpensive self-contained touchscreen PC running Linux.

The compute, touchscreen display, storage, USB ports, everything is in one simple unit. Reliability is improved by reducing the amount of external wiring.

HMI Computer

Onboard Illuminated Buttons

Illuminated pushbuttons

The external USB buttons had cabling that wore out over the years. Using built-in buttons meant no wear and tear on button wiring.

The simple custom IO board provides a USB interface to basic GPIO plus a small 12V boost to run the illuminated buttons. The illuminated buttons guide the user on which button needs to be pressed and when.

Inside Enclosure

Custom Enclosure

This clean design needed custom CNC milling to cut openings for the display, USB ports and AC power receptacle in the sheet aluminum. It was a straightforward operation on the 4030 CNC mill in my workshop.

Inside Enclosure


QR Code Printer

I made the product test result label more compact by using a QR code instead of the old barcode. I also added the Hi-Pot and Ground Bond test parameters for record keeping.

QR code

Other Advantages

  • Compact backup unit; easy to swap to keep factory running
  • Small and easy to ship to any EMS in the world
  • Automation code is in Python using common open-source libraries
    • easy handoff to supporting engineers/future engineers
  • IO via a single USB connection
  • OS set to read-only
    • no corruption on sudden power loss
  • Real-time status indicator of each USB device
    • immediate indication of a disconnected or powered off instrument
    • easier troubleshooting for factory techs