Code and instructions for interfacing with the Westinghouse portable generator ATS port using an ESP32 (or similar) Arduino.
Originally started on Reddit-- platform is now unusable so I'm moving this here:
Original Reddit Post:
So, I have a Westinghouse WGEN5300DF generator for my backup generator. We don't use it a ton, and the dual fuel option is sorta nice (though as soon as I fix the propane regulator on that thing we're never putting gas in it again if we can help it...) but what is actually really nice is the electric start. Aside from not coming with it's own battery maintainer system, it's pretty darn nice.
No more running out in the rain to start / stop the thing! Just push the button on the remote!
...
But I'm lazy. I don't want to push a button.I want my AIMS inverter's 'generator start relay' to control it. Well... it's just a 'dry contact' style. Closes a relay to say "I want the generator on now" and opens it again to say, "Okay, I'm done, you can shut off now."
Well... this is an issue, because the Westinghouse generator has a push-button start. Push-on, Push-off. That's annoying.
There is however, an ATS connection plug on the front of the thing... but it only works with Westinghouse's horrible 'Smart Switch', which neither support 240 volts nor does it support the inverter's 'dry-contact' style relay control. It's also $300 or so. :[
So, over the past few weeks, I've been reverse-engineering the interface on the generator, and building a controller to mediate the connection between the AIMS inverter and the Westinghouse generator.
My question is, anyone else have one of these (or similar) generators? And are you interested in a fairly pre-packaged but still DIY solution for interfacing with these generators?
If so, I'll bother to write up documentation on the interface, what each pin does, etc., and publish the Arduino sketch and such as well for controlling it.
If no one cares... well... I won't bother.
EDIT:
As promised, some more information as far as I have gotten:
First, the ATS 'Smart Switch' system connector diagram can be seen here in this screenshot from the manual:
CAUTION: The manual shows some sort of 'engine switch connecting' diagram next to the connector pinout. This is a lie, apparently, as far as I can tell. Attempting to follow this diagram resulted in a blown fuse during testing!
It has 7 pins. I will address them as they are on the diagram above. Please note that at least on my generator, this connector is actually 'upside down' compared to this diagram. Note the 'keying' of the connector on your unit!
This is the connector that fits in there:
https://www.ebay.com/itm/221350409399
The connector's actual name, as far as I know, is a GX20-7 'aviation connector'. I linked the one I bought, as that is the one I KNOW works / fits. There are likely cheaper (and maybe even better) ones out there.
ATS Pinout with Generator Switch On, Engine Off. (The condition in which the 'push to start' button would work to start the generator.):
PIN 1: +12 volts (Battery voltage).
Pin 2: Ground.
Pin 3: +5 volts above ground. START PIN! Connecting this pin to Ground (Pin 2) will be the same as pushing the button on the control panel!
Pin 4: Unknown
Pin 5: ~0 volts.
Pin 6: Unknown
Pin 7: Unknown / Unused?
ATS Pinout with Generator Switch On, Engine On. (The condition in which the 'push to start' button would work to stop the generator.):
PIN 1: +12 volts (Battery voltage).
Pin 2: Ground.
Pin 3: +5 volts above ground. START PIN! Connecting this pin to Ground (Pin 2) will be the same as pushing the button on the control panel!
Pin 4: Unknown
Pin 5: ~12 Volts AC between this and Pin 6, but might confuse your meter like it did mine when I first checked, since it's low voltage AC. +12 volts. (Battery voltage, it seems?) According to the schematic this is one of the outputs from the charging coil in the engine. I am planning to use this to signal that the generator is on, so the controller will know that it has successfully started.
Pin 6: Other output of charging coil from engine.
Pin 7: Unknown / Unused?
Update 11/11/2021: Sorry for taking so long to do anything on this... life gets in the way as always, it seems.
I have almost completed a working version of all of this. I'm currently waiting on a part to arrive, since I needed a relay with a coil voltage of ~240VAC for my setup.
Updated some other things above to correct it / improve accuracy.
Switched from using an Arduino MEGA 2650 for testing, to using an ESP8266 dev board as it has built in wireless, and the MEGA was overkill in terms of the number of GPIO's it had.
I have added (during my fiddling with the programming) a web interface (very basic) to control the generator as well over the local area network. Suggestions for features on the web interface are welcome, currently it just shows on/off status, and allows you to request the generator to start.
Debating adding an 'override' feature so that even if the inverter / charge controller requests power via dry contact, the generator could be shut off via the web interface, and not allowed to start again until the override is released, either through the web interface or by resetting the controller's power.
Web interface / LAN connectivity is OPTIONAL. System will work in 'headless-dummy-mode' with only the diagnostic LED outputs if WLAN connection is not configured or drops out.
Update 11/13/2021: I clicked a button on my computer, and the generator gracefully started, and the status page updated correctly.
The version 1 prototype, complete with absolutely 5-year-old-tier programming quality, is complete, sans a housing, which I will be going to the hardware store to get some plastic box to glue stuff into.
The Arduino Sketch code can be found here, in it's current incarnation:
I am so sorry in advance for the incredibly bad quality of this. XD I will be rewriting this to make it less retarded, I swear.
This works for my Westinghouse WGEN5300DF, and is essentially plug and play once you build the hardware out. Hardware details coming soon!
Update 11/26/2021: I found a problem-- the thing would arbitrarily crash. I think it had something to do with the web server portion and being overwhelmed and running out of memory because of this... rewrote based on a different method slightly. Also fixed the (really) bad LED flash hack to something better. :)
If this is stable, will continue on with the project.