Generator Monitor

A few years ago, we decided to install a standby generator. In New England, we have experienced several extended power outages over the years, and the risk of frozen/burst pipes and subsequent damage is very real, not to mention keeping a fire going in the fireplace all day. Ahh - modern problems!

We decided not to get a whole-house generator, although in retrospect we probably should have spent a little more and gone whole-house, since the bulk of the cost was the installation - wiring, circuit breaker modifications, propane tank, underground plumbing, cement pad, inspections, etc. As it is, the generator, which is a Generac Powerpact 7.5 KW, powers the essentials: refrigerator, freezer, water pump, furnace, garage doors, and of course, the internet modem. Several rooms with lights as well.

Since we are often away in the winter, I also wanted to keep tabs on outages and the generator's health. This required adding a "MobileLink" wireless monitor - I recall it was around $200, plus a monthly subscription of something like $15/month. Last year I started getting emails from Generac saying that the service was going away due to the demise of 2G networks. Great. Then they started sending me offers for a new upgraded monitor for something like $150 (regularly $250), still requiring a subscription. OK, I thought - I still want the piece of mind, so I ordered one. I installed it and observed the status LEDs indicating power but no connection to the generator's controller. The instructions said to call support and get it activated, so I did. After many long on-holds and getting bounced to different support people, I got the bad news. This new, upgraded monitor which they sold me, was incompatible with my generator model. Curiously, my generator is registered with them, so they knew the exact model I own, but still sold me something which they knew to be incompatible. I can only attribute this to corporate incompetence. So back it went for a refund.

This ticked me off so I started looking at alternatives and came across Genmon, which is a software project designed to run on Raspberry Pis. The software is very clever and was created and documented on GitHub by jgyates, who basically reverse-engineered the MODBUS protocol used by many generator controllers over serial interfaces. Genmon is generously made available for free, as in open source. It also has some add-ons, developed by other users to extend the functionality. My primary interest was to be able to get alerts remotely if something goes wrong with the generator, as well as notifications about successful exercise cycles (which happen once a week) and Genmon has this functionality built-in.

One of Jon's pHats on top of my Pi Zero W

Jon Helms created a series of Pi interface boards to support the project which he sells here. These simplify hooking a Pi up to a generator controller by providing power to the Pi and an RS232 serial interface to the GPIO pins.

One fly in the ointment for all Pi projects has been a lack of availability and scalper prices due to the shortages. Fortunately, I had a leftover Raspberry Pi Zero W (wifi on board) from some other projects which I had purchased at a MicroCenter store a couple of years ago for $10. So I ordered a Pi "Hat" for the Zero from Jon.

The project languished for several months, but I finally got around to building it and connecting it to the generator. The following are my notes about the process.

Existing Wiring for MobileLink Cellular Modem

The first step in the project was to understand the existing wiring between the "Evolution" controller and the obsolete MobileLink unit. (It turns out that my Generac has a specific version of the controller for the PowerPact variant). This diagram shows that the only two pins connected to the controller were TX OUT and RX IN. The cable connecting these to the MobileLink 6-pin connector was shielded, presumably to minimize interference. The shield was connected to one of the ground pins on the MobileLink connector. A split in the cable contained two wires going to the battery. The positive cable had an inline fuse.

The next step was to understand the proper connections for the pHat. I could not find a diagram, so I wrote to Jon and he described the pinout in an email. Other references on GitHub in the Genmon wiki pages described how the RS232 signals are connected between the controller and the Pi interface. This is exactly like good old null modem cables, where the TX and RX lines are swapped, so that the TX OUT from one device goes to the RX IN of the other device and vice-versa. Since the pHat has a built-in buck converter to power the Pi with 5 Volts, a connection to +12 Volts from the battery is needed. Since the controller in my Generac PowerPact did not have pins for 12 Volts, a separate cable from the battery was needed, exactly like the old MobileLink.

Given that the cable requirements were the same for the new setup as for the old MobileLink, it made sense to me to re-use the cable. Even though Jon supplies a ready-made 8-pin Molex Minifit Jr cable to go between Evolution controllers and his Pi Hats, that would have required modification in any event. So I chose to re-use the old cable because:

So I began to gather STUFF. I realized that the female pins on the old 6 pin connector were the wrong type to mate with the Minifit Jr Molex on the pHat - literally a square peg in a round hole. That meant getting the right Molex connector and pins. Amazon sells a set of Molex shells and pins which I purchased. These could also be used to construct a cable from scratch, should you so choose. You can also see references to the right connectors on the Genmon wiki, which can be ordered from various sources like Mouser and Digikey.

I already had a crimper that worked with Molex pins. The one I use can be purchased here.

Before proceeding, I wanted to make doubly sure I had the right connections mapped out before going live, since there is a risk of frying something - most concerning was damage to the Generac controller, which is expensive to replace.

I sketched out a re-pinning diagram to help me make sure I did not do something stupid. This diagram shows the correspondence of how the wires need to be moved from the old connector and placed into the new one.

Note that the existing harness had labels on the wires, which I retained and used as a reference. I then cut the wires one at a time, stripped them, and crimped on new pins, inserting them into the new shell. The Genmon wiki has some good instructions on crimping Molex pins. Once done, I hooked everything up and successfully tested the Pi running Genmon.

I already knew that the wifi radio and antenna in the Pi Zero W was going to be too weak to reach my main router - some 75 feet away with walls in between, so I placed a tp-link repeater in the garage, about 6 feet from the generator. This gave me a good wifi signal to the Pi. Alternatives to this would have been to add a WiFi dongle and external antenna, as some other Genmon users have done. I already had the repeater, so it was a quick solution.

I installed the Pi and pHat in a water-tight box, purchased here. It measures about 6x4x3".  I used the same mounting hole that I had previously drilled into the generator for the MobileLink and re-used the existing threaded plastic conduit fitting, along with a 3/4" nut and washers between the box and the generator for weatherproofing.

Screenshot of Genmon running - the generator is not running in this screenshot - it was part of my testing to verify communication with the controller.

I followed up this article by writing a wiki page on GitHub, so that jgyates can share it on his GitHub pages. It can be viewed here.