I have a DIYBrewPi setup using an RPi 3 and an Arduino Uno. I am building a “smart keezer,” based off of this guide and planned to use the SmartKegerator program in conjunction with BrewPi. My original intent was to use BrewPi as a fridge temperature controller/monitor and to use SmartKegerator for dispensing & monitoring of the beer, along with a tap list, and to have everything running on one system.
My first thought was that I could let the RPi focus on the touch screen interface running BrewPi and SmartKegerator programs, and I could use the Uno to do the data collection and dumb, heavy lifting since it communicates with the Pi via USB. I thought it’d be as simple as modifying a few files here and there, duplicating/modifying some variables to expand the number of sensors I had to work with, and bam I’d have a hybrid of the two that worked together beautifully. Given my extreme lack of experience and short sight, I am now in over my head and am hoping for some help.
-BrewPi successfully uses the Uno to interface with the LCD, temperature sensors, and relay. It does this with a USB serial connection, and from what I gather uses its own code to accomplish the serial communication–or maybe PiSerial?
-SmartKegerator is already setup to collect data from (2) flowmeters, and a temperature sensor. It does this via the WiringPi library.
I want to add a decent number of sensors to be read in by Smartkegerator, including an additional flowmeter, (4) load cells w/ amplifiers, and Wheatstone bridge pressure sensor w/ amplifier. My thought process was that adding these sensors to the Arduino pins and sending that data back to the Pi over the USB connection as well would be ideal. I assumed that it would help on Pi system resources and made more sense overall to connect all sensors to the Arduino. Because SmartKegerator uses WiringPi, it also conveniently has fairly direct access to the included Serial Library, which treats the Arduino IO pins as extensions of the normal PI GPIO pins called using WiringPi.
I tried to implement some basic tests last night to see if something like this was even possible, and was unsuccessful. It got me thinking if what I was trying to do was in fact possible, and if it even made sense. With that, I have a number of related question.
1.) Since BrewPi opens the serial connection to the Arduino, would I need to do so in SmartKegerator as well–could I piggy back that open connection into separate programs, do I have to open in both programs, or will trying to have two programs talking to the same Arduino cause issues?
2.) Along the same vein, SmartKegerator looks for a temperature sensor normally connected to a Pi GPIO. I originally thought that I could access the same temperature probe information that BrewPi uses just to eliminate a sensor and some more code, but the more I think about it the more I am convinced that calling the onewire temperature probe information from the serial connection while BrewPi is also doing so would be complex and might cause issues. I am now leaning towards just getting another temperature sensor to read temperature at the same area in the fridge as the BrewPi probe since sensors so cheap, but am wondering if using the existing probes as mentioned is easily doable.
3.) As I mentioned, I assumed that it made sense to have the Arduino handle all the data collection instead of the Pi so as to help free up Pi system resources for it to run the GUI’s and do other stuff. Is this a false assumption? Would simply connecting all the sensors to the Pi and using WiringPi as-is, directly, be slower and eat a noticeable amount more of system resources than trying to have it go through the Arduino/serial connection instead?
BrewPi is certainly a more complex program and looking at the code is daunting for a complete noob like myself. On the other hand, SmartKegerator is much more straightforward and would prevent me from having to worry about the issues I mention above. I could just copy/paste/modify the existing code to expand it for the additional sensors I want to add to SmartKegerator, however that only makes sense to do if it won’t bog down the Pi or be too much to handle.
Thanks in advance for your help.