We own an off-grid cabin that uses a mix of solar and generator power. The solar system has it's own set of monitoring bits (to be documented in another project), This one focusses on just the generator side of things. We actually have two generators:
- 20 kW diesel generator with remote start
- Honda EU2000 portable generator
To run small loads and charge the batteries we use the 120V portable generator. When we want to user the larger (wood and metalworking) tools in the garage we start the big 240V diesel generator.
To measure and track the use the use and total power generation of both generator I decided to build this IoT device.
I was also an excuse for the dive into IoT and to learn Python.
The electrical sideAs mentioned, we have one (large) 240V diesel generator. The maximum current product is 70A @ L1 (120V) and 70A @ L2 (120V), for a total of 70A @ 240V (or 20kW).
The small generator produces max 15A @ L1 (120V), for a total of 2kW. To measure all of this I purchased a 3-channel sensor board with 70A current clamps. There is a manual interlock the determines what generator is actually feeding the system (as you can see in some of the pictures)
The IoT board
As an early Linux adopter, I really like the Onion Omega boards. They are inexpensive ($10), have build in storage (can be extended), WiFi and run a "full" linux stack. Onion sells several boards that can be added to provide additional functions (relays, ethernet, mini display etc), but most of my sensors are purchased from NCD.IO. I use the I2C interface on the Onion Omega to connect the sensor. The code that NCD.IO provides has seen little testing on the Omega's, I've posted my updated code in the linked Github repository.
The AC sensor board requires a 12V supply, the Onion Omega is powered via the NCD.IO I2C board with a mini USB (5V). The parts bin had a cheap ebay 12/24/48V-5V converter. I could have purchased a much smaller converter, but this is what I had.
A lockable DC barrel plug is used to feed the 3.5x4.5" Hammond project box that contains the small pile of electronics.
The Hammond project box is just a little bit to small. So some extra trimming and pushing is required to fit everything in. But it did fit in the end.
Using the Cricut vinyl cutter to add some final details (labelling the box and the current sensors with their respective channels) and it all looks nice!
Some small python code reads the sensor data and pushed it out via MQTT to the Losant IoT platform. Since the Internet is not always available, it will cache data locally and push out to Internet when it becomes available. For a local user interface, the data is also pushed to a local NODE-RED install.
The graph below is an example of the Graph at Losant. You can see the generator trip at about 3/4 of the time.
Comments