Raspberry Pi Temp 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.

steve071

Member
Joined
May 22, 2009
Messages
13
Reaction score
9
Location
RI
I developed a wireless, web controlled PID temperature control system for a single brew kettle using the $35 credit card sized Raspberry Pi computer.
http://www.raspberrypi.org/

The server side is written in Python which should be really easy to learn and expand to control pumps, solenoid valves, more heating elements, etc. I really like Python for quick development and its libraries. The web server is web.py. http://webpy.org/

On the browser side I'm using jQuery http://jquery.com/ and plugins for real time display (gauges and charts). Mouse overs on the temperature plot show time and temperature for the point highlighted. It currently works in a Firefox browser. Real time status information is sent back from the Raspberry Pi approximately every second to the browser using AJAX to prevent page refresh.

For IDE I'm using Aptana Studio 3. After I make changes to the code on the laptop I press the synchronize button and the changes are sent wirelessly over to the raspberry pi so development and testing is very quick. I also can use putty on windows to ssh login into the raspberry pi computer.

For PID tuning I made it really simple to tune the system using the Ziegler-Nichols open loop. After setting the heat output to 100%, wait for the input to changed by 10% and then just highlight the sloped line after the dead time on the temperature display to calculate the parameters. Then, after I programmed it all, I found out that this method is known to overshoot the set point. I played around with the parameters in order for it to work well with no overshoot. There is a better way to tune it using the ITAE-load method described on this site: http://www.vandelogt.nl/htm/regelen_pid_uk.htm but it takes a long time.

The electronic side of things is pretty simple and easy to put together (not including the ssr, heating element, etc.):
I use the Raspberry Pi, Adafruit Pi Plate Kit, DS18B20 temperature sensor probe, jeenode output plug http://jeelabs.com/products/output-plug, 20 x 4 LCD and LCD117 kit, LED, cheap belkin wifi dongle, and a couple of resistors

More information and source code can be found on the following web site:
https://github.com/steve71/RasPiBrew
 
This is awesome. I have the Pi already and ordered up some stuff from Adafruit last week. Can't wait to look through the code tomorrow at work.
 
I already built my brewery using a BCS 460 but i was hoping someone might do this w/ a Raspi. I ordered one last week just to play with. Might be a great way to bring my Ferm chamber, keezer and Hops drying under automated control.

Thanks for doing and sharing this work!
 
Thank you! Since there is some interest in this I started putting together an installation guide that I hope will be of some help:

https://github.com/steve71/RasPiBrew/blob/master/RASPI-SETUP.md

The Raspberry Pi is a good platform for experimenting and can also be used with an arduino if desired. I wanted to see what it can do without one and put something together quickly. It would be nice to have templates for different brewing configurations. The browser/javascript part is the hard part of this. If there are javascript problems I don't get an error message. It just doesn't work. The python part should be easy to pick up. On the python side more processes and pipes can be added to control and monitor other things at the same time. Just add the additional status data to send back to the browser and more commands back to the web server.
 
Hi Steve, I'm interested in this. Could you maybe post a schematic for the hardware?

I'm very interested in seeing this, too - I'm debating using a Raspberry Pi as a central control unit for an electric brewery, and am curious as to how you wired the various I/O bits to the GPIO.
 
Subscribed! I love this idea. I'd love to get a system in place where I can control my E-kettle, fermentation chamber, keezer and beer line coolant pump in one hub. I'm a total coding and electronics noob though so any help is much appreciated! :mug:
 
I'm using the enclosed PJ's schematic for wiring the e-keggle element with relays and switches. I don't have the schematic for wiring the raspberry pi but I can put something together. This shows how to wire the 1-wire sensor: http://www.datasheetcatalog.org/datasheet/maxim/DS18B20.pdf using a 4.7k resistor. This is connected right to pin 4 of the raspberry pi. I'm using a jeenode output plug connected to the i2c pins of the raspberry pi (pin 3 is SDA and pin 5 is SCL) and to the SSR. This schematic of the output plug is here: http://jeelabs.net/projects/hardware/wiki/Output_Plug

Auberin-wiring1-a4-5500w-BIAB-30d6.jpg


254px-GPIOs.jpg
 
I don't have the schematic for wiring the raspberry pi but I can put something together.
Great info - thanks! I know I would certainly appreciate you putting together a schematic for wiring up the Pi when you get a chance - just ordered mine, and can't wait to start playing with it . . .
 
Adafruit, has rolled their own distro that has the I2C/1-wire, and many other features pre-compiled.

I'm looking at several different options right now that will comprise a multiple thermo/SSR setup.
 
Adafruit, has rolled their own distro that has the I2C/1-wire, and many other features pre-compiled.

I'm looking at several different options right now that will comprise a multiple thermo/SSR setup.

That's what I was looking at running with to start. Just ordered some additional stuff from them (i2c 16 port i/o expander, 8 channel SPI ADC, etc.) for basic testing and prototyping.
 
I'm thinking of using an Aduino for the hardware heavy lifiting, which would include a small 5" GLCD touchscreen and the RPi as the web/wireless interface.
 
I've been looking into the rasperry pi as well. Has anyone checked out http://www.proview.se/ ? It looks like someone on their forum has compiled it for the RPi. I was thinking that it would be slick to use proview.se for the controls and host interface. Then connect to the interface via VNC or web using an iPad or android tablet.
 
Ordered mine today, I already have an Arduino 2560...now to figure out what to do with it all!!!!

My plan is to take my networked temperature monitor, and add support for the ds2406+ 1-wire switch which would control SSRs for my RIMS and pumps, use the 5" GLCD with touchscreen for local monitoring and control, and then feed the data to the RPi for networking and web monitoring, control and datalogging.

My investigations so far seem to show that the 1-wire on the RPi is still a bit wonky, but the I2C is solid. I would use the I2C bus for communications between the Arduino and RPi.

I have several different Arduino boards, but plan on using the Mega2560, with its large memory and program space and tons of I/O.

Just my $.02 :p
 
Great stuff Steve. I was thinking of going with a hacked router a la uberfridge but the memory constraints might prove to be too much of a pain. This sounds like a great alternative.

I would think piggybacking an Arduino on the Raspi might make the IO a bit easier for most people. Plus these Arduino PID libraries might speed development: https://github.com/br3ttb
 
Got the parts in yesterday to make my bi-directional level shifter so that the Arduino's 5v I/O doesn't damage the RPi's 3.3v I/O. Breadboarded a shield for the Arduino Uno, and got the two communicating over I2C.

I don't want to hijack this thread, so I'm taking my progress over to my Arduino thread.

Looks like this is gonna be fun... :ban:
 
My RPi arrived today. I'm going to build a Pi based brew controller too.

I am still waiting for my relay board to arrived. And I need to build the rest of my brewstand first too...

Anyone have a one wire bus working with the 18B20 temp sensors ?
 
On the browser side I'm using jQuery http://jquery.com/ and plugins for real time display (gauges and charts). Mouse overs on the temperature plot show time and temperature for the point highlighted.

Which gauge plugin are you using and how do you like it ?
 
Anyone have a one wire bus working with the 18B20 temp sensors ?
Which gauge plugin are you using and how do you like it ?
Check out steve71's github page that he has linked in the original post: https://github.com/steve71/RasPiBrew
I am starting a Raspberry Pi build myself using steve71's work as an example. His work is an excellent resource! I am going to use JMWidgets in my build for the gauge, buttons, indicators, etc. http://www.jmwidgets.com/
 
Check out steve71's github page that he has linked in the original post: https://github.com/steve71/RasPiBrew

I saw that.

I am starting a Raspberry Pi build myself using steve71's work as an example. His work is an excellent resource!

I agree.

Its funny that there are a bunch of us doing BrewPis and we are all doing them individually. Do you think we could come up with a common spec and pool our talents and efforts ?

I need the following.

- 3 PID loops and temperature indicators for controlling/monitoring 3 gas burners, inputs from 2 to 3 temp sensors per loop
- simple on/off switches for 3 pumps
- temperature data logging
- brewpi controller serving it all as a web page to local or remote host running Firefox
- my build will be based on Fedora/KDE OS install
- burner and pump control is simple on/off via USB relay board
- temp sensors are all 18S20s onto a single one wire bus


I am going to use JMWidgets in my build for the gauge, buttons, indicators, etc. http://www.jmwidgets.com/

Nice find ! I love the dashboard gauges. Looks as good or better than a real dashboard. I love the fact its open source/ GPL.
 
Just in case people haven't seen this, I'll share the link
http://brewpi.com/

I don't know if this person is a member here or not.

I like what this guy did, but yet it doesn't work for me. I don't mean to knock his efforts as its innovative and great for him for sharing it. :mug:

But I don't like having the Arduino as the slave to the RPi as the hardware interface for the system. If I wanted an Arduino as the hardware interface, I'd implement the whole system on the Arduino platform. I much prefer the RPi platform when it comes to serving web pages, etc, and I'd rather implement my hardware right on the RPi and skip having 2 microcontrollers in the system.

I also don't understand having the microcontroller in these systems drive a local LCD and/or dedicated keypad.

To me the beauty of RPi is that its a full on Linux system and I can add regular PC hardware to it with almost no thought. So if I want a local display, I'll find a used HDMI monitor for $50 and wala, I have a nice big display. And if I need a keyboard, I'll find an inexpensive USB keyboard and wala, I have a means to input data.

But the real beauty to me is to run BrewPi as a headless server and interface to it with a browser on another machine. For me that will probably be a tablet, but it could also be Firefox running locally on BrewPi itself on local hardware, if I wanted it to be.

And if I really wanted a local mini LCD display, I'd use a RPi LCD shield from Adafruit and implement that and the web server interface, so that I used a browser as the setup and data logging UI and the local mini LCD as local feedback.

How are other people designing their BrewPi systems ?
 
Just in case people haven't seen this, I'll share the link
http://brewpi.com/

I don't know if this person is a member here or not.

I like what this guy did, but yet it doesn't work for me. I don't mean to knock his efforts as its innovative and great for him for sharing it. :mug:

But I don't like having the Arduino as the slave to the RPi as the hardware interface for the system. If I wanted an Arduino as the hardware interface, I'd implement the whole system on the Arduino platform. I much prefer the RPi platform when it comes to serving web pages, etc, and I'd rather implement my hardware right on the RPi and skip having 2 microcontrollers in the system.

I also don't understand having the microcontroller in these systems drive a local LCD and/or dedicated keypad.

To me the beauty of RPi is that its a full on Linux system and I can add regular PC hardware to it with almost no thought. So if I want a local display, I'll find a used HDMI monitor for $50 and wala, I have a nice big display. And if I need a keyboard, I'll find an inexpensive USB keyboard and wala, I have a means to input data.

But the real beauty to me is to run BrewPi as a headless server and interface to it with a browser on another machine. For me that will probably be a tablet, but it could also be Firefox running locally on BrewPi itself on local hardware, if I wanted it to be.

And if I really wanted a local mini LCD display, I'd use a RPi LCD shield from Adafruit and implement that and the web server interface, so that I used a browser as the setup and data logging UI and the local mini LCD as local feedback.

How are other people designing their BrewPi systems ?

Couple of thoughts:

First, to serve webpages from the Arduino, you either need a ethernet shield or get a board with on-board ethernet, such as Freetronics EtherTen or EtherMega. Second, especially with the Arduino Uno, you'll rapidly run out of code and RAM space so the number and type of pages you can serve are limited. It's actually cheaper to get an Arduino and an RPi, tie them together, and let the RPi handle the internet chores.

Second, having a full-on linux system is nice, but I can tell you from experience that the 1-Wire library that uses the RPi's GPIO interface is a bit wonky, since you don't have complete control over the timing of the bit-banging required for the 1-Wire mini-lan. You mght be able to set up the RPi as described here, but I haven't tried it.

I want to be able to monitor and control multiple units that are not necessarily next to each other, so I've been playing with many different combinations. You can see some of my results at my website or here.

FYI, here is another RPi brewing project.
 
Thanks for sharing your thoughts.

I totally agree that Arduinos make for limited web page servers.

Thank you for the links in your post above. I just ordered a USB one wire adapter to use on my RPi. http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=271079913098

I have no affiliation with this vendor.

My apologies to the OP if I have derailed your thread. Say the word and I'll start my own.
 
Here another RPI newcomer!

My plan is using it together with the Opentroller DX1 (Brewtroller) giving it the following tasks:

- reading from the Brewtroller HLT temp sensor the beginning of the boiling
- managing an automated hop dropper (timers and step/servos motors to drive)
- Displaying on a 10" touchscreen the Brewtroller web interface, in order to manage everything from the control panel.

Very interested in watching other experiences as well.
 
Hi,
Firstly, I'll declare being mostly illiterate on the technical level you guys are talking - so everything is said with humility.

I'm looking to make a controller that I could eventually have built and sold to control a brewery system I'm currently prototyping. Simple unit: a recirc pump, a heating element, and chill pump under control.
Essentially I want something like the BCS, but with a less 'designed by an engineer' web interface and and interface which is tailored to the specific unit. The 'state machine' approach makes a lot of sense to me.
I'm trying to understand the pros and cons of different approaches.

So: If there was effort put to fixing up the 'wonky' one-wire library, would that make a RPI unit a good solution on its own (ie without a slave Arduino)?
Could there be a web page, with 'buttons' to allow inputs to control the process, without wires via a browser running device - be it a tablet or PC?
 
So: If there was effort put to fixing up the 'wonky' one-wire library, would that make a RPI unit a good solution on its own (ie without a slave Arduino)?
I think so, yes.

The reason the one wire setup on the RPi is wonky is because its hardware doesn't support one wire natively. There is no one wire send and receive hardware module and there is no one wire data buffer.

The one wire functionality on the RPi is achieved by "bit banging" rather than hardware, meaning that the CPU manually toggles the output pin via timed interrupts and polls the input port for a response. This can be made to work, but given that Linux isn't a real time OS, its kludgy.

The solution to that issue is to implement a one wire system using a hardware module that handles the low level one wire functionality and buffers the data as necessary. This is exactly what the USB one wire interface that I linked to above (and ordered) seems to do.

Could there be a web page, with 'buttons' to allow inputs to control the process, without wires via a browser running device - be it a tablet or PC?
Absolutely, and it is my goal. Its called a headless (brewstand) server (controller).
 
I'm watching this pretty closely. I want to give it a shot. I'm a web application developer by trade so I'm interested in trying to help flesh out a strong web UI.
 
I'll handle the hardware drivers if you handle the web pages... :mug:

I would like to work in Fedora because all my other machines are Fedora and I know it well.
 
Shouldn't be that hard to get something together. If we write it properly could scale well to mobile devices too removing the need for a app or second UI for tablets and phones. I currently have Raspbian on my pi (Working on a project ), but fedora works for me.

I think a good way to interface with the devices is via a REST api. Then you can either run the front end straight on the device, or on a dedicated server. The front end can then manage 1 to X number of devices. Properly written the front end web services shouldn't care where they run and the device is either exposing just the REST api via http or exposing both the REST api and the front end.
 
It all sounds good.

I have my Pi and I'm working on the brewstand its going on right now. My one wire device should be here in a week or so and I want to brew a beer before Christmas.

Where do we go from here ?
 
brewman ! said:
I'll handle the hardware drivers if you handle the web pages... :mug:

I would like to work in Fedora because all my other machines are Fedora and I know it well.

There's a Fedora Remix Image available for the RPi
 
One of the threads I mentioned above uses fuse and treats the 1-Wire devices as just another device, making it very easy to access the 1-Wire devices. I did that setup first
 
jimmayhugh said:
One of the threads I mentioned above uses fuse and treats the 1-Wire devices as just another device, making it very easy to access the 1-Wire devices. I did that setup first

Stupid phone!!

Anyway, I did that setup first, and it worked well enough with a really old laptop, but had a fairly slow response time.
 
Stupid phone!!

Anyway, I did that setup first, and it worked well enough with a really old laptop, but had a fairly slow response time.

Will it handle multiple devices on the bus ? How long does it tie up the system when its communicating with devices, say getting temps from 10 or so sensors ?
 
I posted and I think it vaporised. Can't see it so posting again:

I could support accelerated development by supplying some funds to this.
I could pay for 'hard' costs like test RPIs, test chips for the one wire solution, pcb development, website/forum/wiki for collaboration.
It would be an 'open' project.
Let me know you're interested.

Cheers,
Yorg
 
I'm not looking for support, but thanks anyway.

I would have done this on my own anyway. I'm happy to do it in a group instead of by myself.

Just to be clear, I am wanting to build a brewstand controller, not a fermentation chamber controller. I'm not against fermentation controllers, I'm just focused on controlling the mash and boil(s) right now.

BTW, I am hoping that this doesn't require a PCB, other than a simple RPI breakout board from the connector to some terminal screws, which is easily made or bought. To me, that is the beauty of using the one wire temp sensors and a simple relay board.

As soon as you need PCBs, it makes things a lot more difficult for the DIYer, at least for me, anyway.

Here is the relay board I bought.
http://www.ebay.com/itm/New-5V-8-Ch...ic-/270984095956?ssPageName=ADME:L:OC:CA:3160

It will control my burners and pumps.
 
Back
Top