- Replace gauge.py (MicroPython) references with gaugecontroller.yaml (ESPHome) - Update CLAUDE.md and README.md to document ESPHome-native API integration - Update LED wiring docs for separate main/indicator strips (D22/D36) - Refactor Arduino firmware to drive two WS2812 strips independently - Add per-gauge physical offset caching for main and indicator LEDs - Frame-limit breathe effect (16ms) to reduce unnecessary strip refreshes
7.1 KiB
Rewire Checklist
This is a practical rebuild checklist for the current integrated setup:
Arduino Mega 2560ESP32runninggauge.pyHV5812P- 4-digit VFD with decimal point and alarm bell
- 3 gauge drivers
- WS2812B LED chain
Use this to rebuild the bench wiring from scratch.
1. Power Off Everything
- disconnect all power supplies
- disconnect USB power if it is currently feeding any board
- do not move wires while the VFD high-voltage supply is live
2. Place The Main Parts
- place the
Arduino Mega 2560 - place the
ESP32 - place the
HV5812P - place the 3 gauge driver boards
- place the WS2812B strip connection point
- place the VFD tube connection point
3. Establish A Common Ground First
Before anything else, create one common logic ground network.
Connect:
Mega GND-> ground railESP32 GND-> same ground railHV5812P GND-> same ground railGauge driver 0 logic GND-> same ground railGauge driver 1 logic GND-> same ground railGauge driver 2 logic GND-> same ground railWS2812B GND-> same ground rail
If your VFD high-voltage supply has a ground/reference return:
VFD HV supply return-> same common ground rail
Do not continue until this common ground is in place.
4. Wire The Arduino Mega Power
Connect:
- regulated
5V logic supply->Mega 5V - ground rail ->
Mega GND
Do not use the Mega to power motors.
5. Wire The ESP32 Power
Power the ESP32 in the way your board expects.
Typical options:
- via board USB
- via board
5V/VINif your ESP32 board has its own regulator - via regulated
3.3Vif it is a bare module that requires that
Also connect:
ESP32 GND-> common ground rail
Do not feed raw 5V into a bare 3.3V-only ESP32 module.
6. Wire The ESP32 UART To The Mega
Connect:
ESP32 GPIO17 (TX)->Mega pin 19 (RX1)ESP32 GPIO16 (RX)<-Mega pin 18 (TX1)ESP32 GND->Mega GND
This UART link is used by gauge.py.
7. Wire The HV5812P Logic Side
Connect:
Mega D46->HV5812P DATA IN / DINMega D47->HV5812P CLOCK / CLKMega D48->HV5812P STROBE / LATCHMega D49->HV5812P BLANKING / OEMega 5V->HV5812P VDDMega GND->HV5812P GND
Do not connect:
Mega 5V->HV5812P VPP
8. Wire The HV5812P High-Voltage Side
Connect:
VFD high-voltage positive supply->HV5812P VPPVFD high-voltage supply return / reference-> common ground rail
At this stage:
VDDmust be5VVPPmust be your VFD high-voltage rail
9. Wire The HV5812P Outputs To The VFD
Connect these one by one:
HVOut1-> VFD segmentAHVOut2-> VFD segmentBHVOut3-> VFD segmentCHVOut4-> VFD segmentDHVOut5-> VFD segmentEHVOut6-> VFD segmentFHVOut7-> VFD segmentGHVOut8-> VFD decimal point segmentHVOut9-> VFD alarm bell segmentHVOut10-> VFD digit 1 gridHVOut11-> VFD digit 2 gridHVOut12-> VFD digit 3 gridHVOut13-> VFD digit 4 gridHVOut14-> VFD indicator grid between digits 2 and 3
10. Wire The VFD Filament
Wire the VFD filament/heater exactly as required by your tube.
This checklist cannot specify the exact filament supply because it depends on the actual tube.
Required reminder:
- do not power the filament from an Arduino GPIO
- use the correct filament supply for the tube
11. Wire Gauge Driver 0
Connect:
Mega D50->Gauge driver 0 DIRMega D51->Gauge driver 0 STEPMega GND->Gauge driver 0 logic GND
Then connect the motor side of that driver to:
- its motor power supply
- its gauge motor
according to the driver board you are using.
12. Wire Gauge Driver 1
Connect:
Mega D8->Gauge driver 1 DIRMega D9->Gauge driver 1 STEPMega GND->Gauge driver 1 logic GND
Then connect the motor side of that driver to:
- its motor power supply
- its gauge motor
according to the driver board you are using.
13. Wire Gauge Driver 2
Connect:
Mega D52->Gauge driver 2 DIRMega D53->Gauge driver 2 STEPMega GND->Gauge driver 2 logic GND
Then connect the motor side of that driver to:
- its motor power supply
- its gauge motor
according to the driver board you are using.
14. Wire The WS2812 LEDs
Connect:
Mega D22-> main backlight/status stripDINMega D36-> indicator stripDIN5V LED supply-> both strip5Vinputs- both strip
GNDinputs -> common ground rail
If the LED chain is long or bright:
- do not power it from the Mega
5V - use a proper external
5Vsupply
15. Verify The Pins That Changed For The Integrated VFD
The VFD is no longer on the old standalone pins.
Old standalone pins:
D51-> DATAD52-> CLOCKD53-> STROBED49-> BLANK
Current integrated pins:
D46-> DATAD47-> CLOCKD48-> STROBED49-> BLANK
So make sure:
- nothing VFD-related is still on
D51 - nothing VFD-related is still on
D52 - nothing VFD-related is still on
D53 - only
BLANK/OEremains onD49
16. Sanity Check Before Powering Logic
Check each item physically:
Mega D46really goes toHV5812 DATAMega D47really goes toHV5812 CLOCKMega D48really goes toHV5812 STROBEMega D49really goes toHV5812 BLANKINGMega D50/D51only go to gauge driver 0Mega D8/D9only go to gauge driver 1Mega D52/D53only go to gauge driver 2Mega D22only goes to WS2812BDINESP32 GPIO17goes toMega RX1ESP32 GPIO16goes toMega TX1- all grounds are common
HV5812 VDDis5VHV5812 VPPis high voltage, not5V
17. Power Logic Only First
Apply only logic power first:
- Mega power
- ESP32 power
- HV5812
VDD - WS2812
5V
Leave motor supply and VFD high voltage off for the first check if possible.
Verify:
- Mega boots
- ESP32 boots
- UART communication works
18. Power The VFD High Voltage
Now apply the VFD high-voltage supply to HV5812 VPP.
Verify:
VDDremains5VVPPis the expected high voltage- no logic wire is heating
19. Power The Gauge Drivers
Now apply motor power to the gauge drivers.
Verify:
- no driver fault LEDs
- no motor heating or runaway movement immediately on power-up
20. First Functional Test
Test in this order:
- confirm the ESP32 can talk to the Mega
- send
VFD 8888 - send
VFD DEAD.! - test one gauge movement from Home Assistant or MQTT
- test one LED output
21. If Something Is Wrong
Use this triage order:
- check grounds
- check
VDDandVPP - check Mega pin number mistakes
- check crossed UART lines
- check that the VFD is still on
46/47/48/49, not51/52/53/49
22. Quick Reference
Mega pins in use
D8-> gauge 1 DIRD9-> gauge 1 STEPD22-> WS2812 DIND46-> HV5812 DATAD47-> HV5812 CLOCKD48-> HV5812 STROBED49-> HV5812 BLANKINGD50-> gauge 0 DIRD51-> gauge 0 STEPD52-> gauge 2 DIRD53-> gauge 2 STEPD18-> UART TX1 to ESP32 RXD19-> UART RX1 from ESP32 TX
VFD outputs
HVOut1..7->A..GHVOut8-> decimal pointHVOut9-> alarm bellHVOut10..13-> digit grids 1..4HVOut14-> indicator grid