StrangeBrew Elsinore - Raspberry Pi based brewery controller

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

DougEdey

Well-Known Member
Joined
Dec 29, 2011
Messages
770
Reaction score
181
Location
Ottawa
So, I've been working on this for a month or so, initially the hardware used a program that steve71 made on HBT, but I found it was extremely limited (1 output, a specific controller input, and some other annoyances). The next iteration needed to be rebased, and now I've made significant improvements

First things first: Github Repo for the code - Elsinore Server
Elsinore Android App

I will add be updating frequently as I find improvements/bugs, this is an Alpha for all intents and puposes

So the raspberry pi is a tiny (credit card size, almost), cheap ($35) PC with GPIO, 1Wire, PWM, and more on it, but it has the advantage of being able to run full linux in a low power environment via an SD card.

The basic setup is:

Raspberry Pi with Debian installed and 1wire modules, connected to 1wire DS18B20 probes, and SSR outputs.

The inputs are the 1wire probes, which are accurate enough for this kind of work, they can be chained on one bus which helps to reduce footprint.
The SSRs control the -120v and +120v (or just one if you want to save a bit of cash) to the elements.

Circuit Diagram
rpi_circuit.png


It is designed to throw JSON style data out constantly (using the /getstatus URL):

{"hlt_pid":
{"elapsed":1361666853197,"scale":"F","cycle":2.0,"duty":0.0,"p":4.0,"gpio":11,"temp":37.4,"setpoint":175.0,"k":41.0,"i":169.0,"mode":"off"},
"kettle_temp":
{"elapsed":1361666852388,"scale":"F","temp":37.2866}
}

In this example the HLT is setup as a PID (there's a GPIO pin setup in the config file, and a temperature probe setup), the Kettle is setup with a probe and no GPIO, so it's only reading the temperature.

Here is an example of the Android I have made, and uploaded, (ignore the names of the devices, I've been playing)

PID_Elsinore.png


The settings allow you to specify the server name and port, as well as the refresh time.

UPDATES:

[Sunday March 17th]
Uploaded new versions of Server and app

The server now supports connections to COSM (formally pachube) so data will be uploaded to datastreams for each device that you have. These pushes only occur when you get data from the server locally, so if you use the android application, it will only update whilst that is running. If you quit the application it will stop pushing data to COSM. The data is pushed from the Elsinore Server to Cosm, not from the android application.

For example: https://cosm.com/feeds/119008 is my feed for Elsinore. You can call it whatever you want, but the datastreams will be made to match your setup if they don't exist already. Annoyingly you can't tell Cosm to display in your timezone.

So I added an extra url: getimages (i.e. https://elsinore:8080/getimages) which will get the last 8 hours of data from Cosm and dump it out to files in the "graphs" directory. I'm going to add extra details like a start/end time customization, and some better axes, but the Cosm API is a bit fiddly and apparently frequently changing.

Once you've gone to the getimages URL, you can then go back to the root/graphs directory (i.e. http://elsinore:8080/graphs/) to see all the images.

Long term, this'll be made into a brewing report.

The Android application itself has received a load of updates (and workarounds for Android bugs), so it now does work correctly, and will show the correct dial range, Celsius or Fahrenheit, depending on what the server is set to.

[18th March] More updates:
I've made a few more changes, like adding a launcher script




You can also specify the start and end time of the images (in your local timezone, or any timezone)




keezer:8080/getimages?startDate=2013-03-16T02:07:10-04:00&endDate=2013-03-16T18:07:10-04:00




Gets the graph between the startdate and endDate (-04:00 is the timezone different to UTC), I'll be updating the android controller to have a start brewday, end brew day, start Mash, end Mash, etc... form to allow multiple graphs to be selected.

[UPDATE Mar 20th]
WC6UhUA.png

Decided to play with a local graph (and fix a crap load of annoyances)
So it live updates the graph as you're going, more as an informative thing. I'll add the setpoint if there is one later so you can see how far away you are :)

Repositories are all up to date now.
 
Awesome post! I just bought a couple Raspi's Just learning now. I love how much info is available on the web for these little guys!
Looks like your well on your way to a great use for it! You graphic for the dial thermometer has an error..I'm sure your not heating your HLT to 138 to 175 deg. C :p
 
Awesome post! I just bought a couple Raspi's Just learning now. I love how much info is available on the web for these little guys!
Looks like your well on your way to a great use for it! You graphic for the dial thermometer has an error..I'm sure your not heating your HLT to 138 to 175 deg. C :p

You're right, whilst I update the scale based on the input, I haven't changed that bit yet!
 
This is very interesting to me but I'm confused about the diagram. I'll admit I don't know how to read these things fully but I don't see where the 120 V "supply" is and how everything is chained together. I suspected the 120 V to go something like this:

Hot side of plug -> SSR -> Element -> Neutral side of plug

Looking over it again, it looks like the "Mains" is switched as kind of a master on/off? Is that right? Wouldn't you want a mechanical switch for that? Perhaps I'm reading this all wrong. I've got a Raspberry Pi that I bought for the novelty of it and, while I've played with it alot, I haven't found a real use for it.
 
Subbed... That Android screen is beautiful. I can't wait to work on my RasPi and get things going.
 
I'm ready to jump in on this project. I want to just control one element for an electric HLT. I have the Raspberry Pi already. I'm thinking all I need is the following:

SSR - http://www.auberins.com/index.php?main_page=product_info&cPath=2_30&products_id=9
SSR Heat Sink - http://www.auberins.com/index.php?main_page=product_info&cPath=2_30&products_id=45
Temperature Probe - https://www.sparkfun.com/products/11050

Obviously I'd also need wires, project box, etc... I'm just thinking the "main" components. What am I missing? Is there a place I can buy all this at once to save shipping?
 
Hot side of plug -> SSR -> Element -> Neutral side of plug

Kinda, this depends on your country, for Canada (and I believe 120V based countries in general), to get 220/240V you need a special hookup, most people have this for their tumble dryer, or spa, or you can get one run custom. But this is a 4 pin output, which provides:

-120V
Neutral (0V)
+120V
Ground

To get 120V you would wire up Neutral and +120V, but to get 240V you take the -120V and the +120V which gives you a differential (not sure on the proper word here) 240V.

If you're unsure, do some research, my knowledge isn't huge, I'm not an electrician, don't kill yourself.

If you're in a country which is 240V, then you would only use neutral and live to get 240V. Just make sure you have the current to back it.

I'll post pictures of my setup when my new project box arrives.
 
I'm ready to jump in on this project. I want to just control one element for an electric HLT. I have the Raspberry Pi already. I'm thinking all I need is the following:

SSR - http://www.auberins.com/index.php?main_page=product_info&cPath=2_30&products_id=9
SSR Heat Sink - http://www.auberins.com/index.php?main_page=product_info&cPath=2_30&products_id=45
Temperature Probe - https://www.sparkfun.com/products/11050


You need the 4k7ohm resistor (for the probe), I personally went with these: http://www.ebay.ca/itm/3m-Digital-T...n_0&hash=item519bad9205&_uhb=1#ht_2976wt_1165

Since I can mount them in the side of my pots. which makes life a lot easier. The colouring is a bit odd on the wires. I believe some are Red, yellow, *something else*

But the centre (on the ones I got) was always Data, and then I swapped the +ve and ground around till it worked, then they were all the same, if you have red, that should be +ve

Keep an eye on the probes when you wire them up, if you wire them up wrong they heat up, I didn't cause any damage (luckily) to mine, but I'd recommend being careful!

I used ebay for the probes and the SSRs/heatsinks, I think I saved maybe $5 per SSR compared to your prices, but Your mileage may vary. I also bought 10x at a time to save money and help friends out.
 
Kinda, this depends on your country, for Canada (and I believe 120V based countries in general), to get 220/240V you need a special hookup, most people have this for their tumble dryer, or spa, or you can get one run custom. But this is a 4 pin output, which provides:

-120V
Neutral (0V)
+120V
Ground

To get 120V you would wire up Neutral and +120V, but to get 240V you take the -120V and the +120V which gives you a differential (not sure on the proper word here) 240V.

If you're unsure, do some research, my knowledge isn't huge, I'm not an electrician, don't kill yourself.

If you're in a country which is 240V, then you would only use neutral and live to get 240V. Just make sure you have the current to back it.

I'll post pictures of my setup when my new project box arrives.

Ah, I see. I'm actually only planning on doing 120V, 1500 W elements. I had considered doing 240V and adding a circuit, etc... but since I don't plan on going fully electric (my burner is natural gas), I decided to just keep it simple and stay with 120V. My HLT will have two 1500 W elements (I have two circuits in my garage) and I'll drive them both to get to temp, then unplug the "dumb" one and let the smart one maintain the temp. I'll check ebay. Always good to safe some cash. Thanks for the help!
 
I'll drive them both to get to temp, then unplug the "dumb" one and let the smart one maintain the temp.

I'm working on adding a "supplemental" button to enable a secondary element manually. Unless you hit "off" on the ui.
 
I've been thinking about this some more. Given my current setup, I think this would be more beneficial to me for use in fermenting and keezer duties. I have a keezer that's connected to a Ranco and a fermenting fridge that's also connected to a Ranco. Inside the fermenting fridge I also have a reptile heater for in the winter. I could connect all these of these for control by this thing and free up my Ranco's for other duties. Have you thought about adding the ability for cooling as well as heating? What about heating and cooling (two SSR's) controlled by the same thermometer?

EDIT: I could maybe help out with this part. I have a decent amount of experience in Java.
 
Have you thought about adding the ability for cooling as well as heating? What about heating and cooling (two SSR's) controlled by the same thermometer?

I have thought about it, I think it just needs to be a change that if greater than the target temperature we can enable the cooling functions.

It's something I was looking to do with a different setup which'd be able to measure the liquid in a keg (for a keezer) to determine the amount of liquid and show drinking levels :)
 
Out of curiosity, what happens if the pi loses connectivity? Is the control algorithm on the pi itself or on the server?
 
Out of curiosity, what happens if the pi loses connectivity? Is the control algorithm on the pi itself or on the server?

The Pi is the server, android is the client. When I have the web UI (and Strangebrew itself) working, you'll be able to control the controller from anywhere.

Long term plan is:

Prepare recipe in Strangebrew
Send mash/water details to the server
Server will control mash temperature so it matches the recipe.
Monitoring/Controlling from Web UI, Strangebrew, Android, BB.

Monitor via web so you can show people what you're doing (include a webcam too)
 
The Pi is the server, android is the client.

Ahhhhh. Gotcha. I have something similar going using a FEZ Panda and network shield. I have a hand controller with a joystick and lcd that can control the FEZ locally and without connection to the net. Then I have an asp.net site w/ sql database that receives json the same way your pi is getting it from the android client. Every time the FEZ sends data up to the web server, it looks for settings changes made from the asp site and sets itself accordingly. When I sat down to design the whole system it was absolutely crucial for me to be able to control everything with the hand control or the net ui, possibly simultaneously. Sounds like you'll end up having this by default but just something to keep in mind as you move forward.
 
The way this works is it only changes settings when it receives a valid POST set of data, so it'll run continuously if you don't turn it off.
 
Subbed!!! Doug, I have a software background if you would like some help! I have done some Android SDK work as well.
 
I'm ready to jump in on this project. I want to just control one element for an electric HLT. I have the Raspberry Pi already. I'm thinking all I need is the following:

SSR - http://www.auberins.com/index.php?main_page=product_info&cPath=2_30&products_id=9
SSR Heat Sink - http://www.auberins.com/index.php?main_page=product_info&cPath=2_30&products_id=45
Temperature Probe - https://www.sparkfun.com/products/11050

Obviously I'd also need wires, project box, etc... I'm just thinking the "main" components. What am I missing? Is there a place I can buy all this at once to save shipping?

A little piece of advice. While your on auberins site, grab a float switch. 15 bucks now will save you 15 the first time you accidentally leave the element on after the hot water has run out. ;)
 
A little piece of advice. While your on auberins site, grab a float switch. 15 bucks now will save you 15 the first time you accidentally leave the element on after the hot water has run out. ;)

Yup, I learned this too, I'm adding a scale to determine water volume (and grain weight) in the vessels and will be adding an auto off below a certain value :)
 
A little piece of advice. While your on auberins site, grab a float switch. 15 bucks now will save you 15 the first time you accidentally leave the element on after the hot water has run out. ;)

That's actually not a concern for me. It will not be possible to drain my HLT below the elements. The only way that could happen is if it all boiled off.
 
Yup, I learned this too, I'm adding a scale to determine water volume (and grain weight) in the vessels and will be adding an auto off below a certain value :)

Nice. What are you using for scales if you don't mind my asking? Are they onewire compatible or something similar that could plug into something wee like a pi or fez? I'd love to create a fully automated rube goldbrew machine someday. Scales would be key to making that happen.
 
Nice. What are you using for scales if you don't mind my asking? Are they onewire compatible or something similar that could plug into something wee like a pi or fez? I'd love to create a fully automated rube goldbrew machine someday. Scales would be key to making that happen.

I'm using a Arduino breakout for analogue input, I've got a few types of scales I'm testing with and I'll just be tapping into the feed to the controller. The idea is to be able to use cheap digital body scales (that you can get for as little as $10) to use.

EDIT: Wrote "Pi Breakout" Meant to be a Arduino :)
 
So this is what I have added in the last few days (note, I've found some big issues with the Android controller, so I'll be fixing it today, turns out the display is wrong when you're on physical devices).

https://cosm.com/feeds/119008 (switch the scale to the last day, or longer)

You can see the temperatures on each output and find issues with mash temp and so on (note, I was fixing some bugs during my mash, hence the lack of data).

I've also got methods that will save the actual data to images on your local machine so you can create brewing reports (and the software will do this for you too).

I'll update the repos today once I have fixed the android application, so keep an eye on the repos.
 
I've made a few more changes, like adding a launcher script

You can also specify the start and end time of the images (in your local timezone, or any timezone)

keezer:8080/getimages?startDate=2013-03-16T02:07:10-04:00&endDate=2013-03-16T18:07:10-04:00

Gets the graph between the startdate and endDate (-04:00 is the timezone different to UTC), I'll be updating the android controller to have a start brewday, end brew day, start Mash, end Mash, etc... form to allow multiple graphs to be selected.
 
Quick update: To make the last update work better I've added in methods to get the raw XML data (the COSM API produces ugly and pretty much useless graphs)

And I've created this today to help this out some more:

ZxnCH9l.png
 
And finished the timing inputs:



They don't do much (aside from tracking start times and end times) for now, but I'm working on buttons to show your graphs of temperature and save the data!
 
One more update, then I think it'll just be bug fixes for a while, the app does what I need it to for now, and no-one has raised any bugs or questions.

See first post as usual :)
 
doug, have to say this project seems awesome. i'd be all in if i was looking to go this route. good job and keep it up.
 
So one of my friends invested in my control box as a gift for my work:

5R903k0.jpg


Whilst the core brewstand is headless, he's given me a Touchscreen (10") and a NEMA box to work with. The cables are hardwired for now (I can't justify the $200++ on the fittings at this point, and the pi is inside and working.

Unfortunately the SSRs he gave me were duds, so I got my old ones back from him and I'm going to be running a cleaning cycle tonight to test everything works.

When I have the inside tidied up (it's a mess at the moment), I'll post some more pictures.

But the next update will provide a UI to manage the config file for first time configuration.
 
So if you're using this PLEASE UPDATE THE ANDROID APP AND SERVER! I found that updating the PID didn't work at all, so I fixed it today.

Also, I worked some more on my control panel.

KmrQ04r.jpg


1ebMSuE.jpg


I got new SSRs and found one is broken (always on, so I can still use it since the other one still kills the circuit). I'm also waiting for new voltage regulators because the screen power is meant to be centre negative, but it's actual centre positive (not sure if this is a manufacturing fault or a documentation fault), so I blew the Voltage regulator on the HDMI->LVDS board.
 
Anyone have thoughts on how this could be modified to drive 2 5500 watt elements using contactors?
 
You need to use an SSR to drive an element, not a contactor. A contactor (or a relay) is not meant to switch on/off that often.

Kal
 
I haven't looked at the schematic but I'm sure it's the SSRs that are turning the elements on/off baed on what the BCS-460 is telling it to do while the contactors are there for safety. The contactors are likely switched through physical switches.

This is a common approach and is what I do.

I explain it in the "How it works" section of my heating elements wiring diagram here: http://www.theelectricbrewery.com/control-panel-part-2?page=13

Quote:

At first glance the BOIL and HLT relays may seem redundant: We use a PID which controls an SSR which in turn tells the element when to fire. So why are the mechanical relays needed at all? Why don't we simply use the ELEMENT SELECT 3 position switch between the PIDs and SSRs instead? The reason is safety: The mechanical relays ensure that there is a complete physical disconnect between both HOT lines and the heating elements when the relay is off. This is important as we will often be working or cleaning one kettle while the other is operational.

Doing something similar with SSRs would require 2 SSRs per heating element (one for HOT A and one for HOT B), but even that would not be 100% safe as SSRs have a small amount of leakage current that flows through at all times, even when the SSR is off. SSRs are also known to fail from time to time and when they do, they tend to fail "closed" meaning that the heating element stays on. The mechanical relays provide us with the piece of mind that when we've turned the element off, there is no possibility of it coming on by accident nor is any side of it energized.

So why use SSRs at all? Why can't we just use the mechanical relays? SSRs are Solid State Relays, essentially switches with no moving parts so they are able to switch as fast as required, often many times per second. Regular mechanical relays are not meant for this amount of switching as the contacts would wear out quickly. Whenever frequent switching is required, SSRs are used instead as we've done here. The three 30A/240V DPDT relays we use are only switched once or twice during the brewing session so they are being used in the way that they are designed to operate.

Kal
 
Sorry for being quiet on updates, I've used this a few times, done some bug fixes, modified some other code, and updated the Android app so it now supports Landscape Layout (this took a while since I've been learning Android layouts).

fnc7uV4.png

N79dnLu.png
 
So some updates should be coming out tomorrow, mainly storing brewing session data on the server to enable better logging in the long run. I've updated the server and android app backends to lay the groundwork.
 
Updated the repos today, the server now stores and serves the datestamps for starting the day, mashing in/out, sparging, boiling, and chilling, this'll be used at a later date more, but for now, I'm using it as a brew timer (long pressing the inputs on the first page on the android app will update the server, and if you have multiple devices running, it'll update them all)
 
Back
Top