Feature Creep
One thing that I've always wanted to know was how long the compressor runs on my keezer when it turns on during a cycle. While my air temperature channels give a ball park that would probably be fairly close on a fridge, chest freezers have a "cooling inertia" that really doesn't exist with fridges. A good chunk of the falling air temperature slope occurs well after the compressor is off.
As I was building my new system I provided a way to monitor the compressor on my keezer - even if BrewPi isn't actually running the keezer.
For a more conventional system run solely by a BrewPi instance, one would daisy-chain the BrewPi relay controls through a simple voltage divider (1K/1K) to bring the Arduino's 5V signals down below the 3.3V limit for the RaspberryPi GPIO pins.
I have an MH1210 single stage controller mounted in the front of the keezer lid that runs it now by switching a hunky relay located in the dolly, and it would be a back-up to BrewPi in the future.
So my new system has a panel mounted switch to select who runs the keezer - BrewPi or MH1210 - but I still wanted the temperature logger to be able to track the compressor state. As the hunky relay control from the MH1210 passes through the new box I tapped off the control signal with a voltage divider to drop the 12VDC coil voltage down below 3 volts before sending it to an RPi GPIO pin.
I've been running the new box in my office for the last week and doing some tweaking along the way, and tonight cobbled up the code to monitor the compressor state, translate the "On/Off" into "temperature" values, then added a column to the logger database for them.
Finally, I added the new column to the web gui graphing routine. Obviously my office is a bit warmer than my beer - and I've been correlating all of the probes on the system so they're all tracking tight - but you can see the "Compressor" toggling as BrewPi tries to change the room temperature to match me changing the Beer Temperature setting.
I just have a bi-state version running as there won't be a heater in my keezer and obviously the temperature in my office is well above my beer, but the idea would be to position the plot for the compressor above the keezer probe readings and below the room temperature curve. The code that writes the database has parameters to specify the values to use - I expect 45, 50 and 55 will work for "Cool", "Off" and "Heat" respectively without impacting the chart scope or overlaying the other traces.
The time bases of the two plots are way different (24 hours vs 2) so it might be hard to picture how this helps - but I'm confident it will
Can't wait to get this thing installed!
Cheers!