Raspberry Pi Temp Controller

If it plugs in, post it here.

Moderator: Site Moderator

User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Raspberry Pi Temp Controller

Post by eStill »

I had noticed my recirculated cooling water warming up. I was also curious about the difference in temperature between top and bottom of my column. Essentially, I wanted multiple thermometers. "Hold on a minute..." I thinks. "Let's hook a bunch of waterproof temperature sensors to a Raspberry Pi. Sweet. a few hours later, I have a three channel digital thermometer with an LCD screen and the ability to draw a graph of temperatures over time!

So... Why don't I use it to control my electric hotplate? Hotplate is 1k6W at 240VAC, so I'll hook in a 10A relay. Nice.

Now, here's where the problems begin. I'm simply unable to control the temperature. If I demand that the heater switches off when the top of the column is at 74 degrees (that's metric temperature), even after the hotplate is off the temperature continues to rise up to around 87 degrees. I've asked it to turn on when to top temperature drops to 73 degrees. As the temperature is falling from 85, passes 73, hotplate switches on, but the temperature can drop to 65 before starting to rise again.

(As an additional note, while the the top of my column is cycling from 65 to 87 degrees, the bottom has much less variance: it's cycling from 85 to 90 degrees.)

Basically, I think the bulk of the hotplate and liquid is taking a long time to heat up a little and a little temperature change at the bottom is making a huge difference at the top.

Now, assuming I was talking about a fractionating column in a still, I imagine that I wouldn't want the temperature fluctuating that much. Or at all, in fact. So, this is a question on temperature control. Has anyone any experience of temperature control using a microcontroller and a relay? How can it be done better than my simple hysteresis method?

I have read about triac controlled heaters and I strongly believe that's the route I'll have to go down. I'm fairly sure I can do SOMETHING clever in software to predict the temperature of the hotplate over time after switching on and off, though. Even I have to switch it on and off a few times a minute.

I'm also a little confised by what I read over at: viewtopic.php?f=62&t=43024 which seems to indicate that I can't control off temperature. From all my background reading, I thought I was required to adjust the heater such that the vapour temperature was the vapour temperature of the particular fraction I was trying to collect.
Last edited by eStill on Mon May 09, 2016 2:50 pm, edited 1 time in total.
rad14701
retired
Posts: 20865
Joined: Wed Dec 19, 2007 4:46 pm
Location: New York, USA

Re: Raspberry Pi Temp Controller

Post by rad14701 »

You don't understand the theories and fundamentals of distillation yet... You can't control temperature in a boiler... If you don't know the WHY then you need to slow down and do some serious research... The time to know what you need to know is before you need to know it, which is before you fire up your still... Reading your few initial posts it's obvious that you aren't ready yet... Maybe not what you wanted to hear, but what you need to hear... You're trying to get all high tech without knowing the basics...

Edited to add: The hotplate cycling is a problem as well because you can't maintain power input... Again, something you should know before your first attempt...
User avatar
Mikey-moo
Distiller
Posts: 1498
Joined: Sat Feb 16, 2013 10:54 am

Re: Raspberry Pi Temp Controller

Post by Mikey-moo »

+1 what Rad said.

Takes most of us a while to grasp that bit.
Best place to start for newbies - click here - Courtesy of Cranky :-)

If you have used this site to save money by making your own top quality booze at home then please consider donating a couple of dollars to help keep this site running. Cheers!
User avatar
InvertedSpin
Novice
Posts: 34
Joined: Tue Apr 26, 2016 10:01 am

Re: Raspberry Pi Temp Controller

Post by InvertedSpin »

That's great advice from Rad.

After reading up and getting familiar with the fundamentals, your Raspberry Pi will be useful for collecting data, but it should be passive. Automation has a cool factor, for sure, but it can't taste or smell which is really how the magic is made.
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

rad14701 wrote:You don't understand the theories and fundamentals of distillation yet...


I get that. I'm no chemist. I was trying to take a bit of the magic out of it. Building a still just seemed like such a hit-and-miss process.
rad14701 wrote:You can't control temperature in a boiler... If you don't know the WHY then you need to slow down and do some serious research...


The wash boils at whatever temperature the wash boils at and that depends on its eutectic mix which changes as the fractions evaporate off. I did high school chemistry. It is possible to put in too much heat or not enough, though. I had understood that the temperature of the vapor at the top of the column was what I was trying to control; this started out as an exercise it teaching my teenager to solder, and turned into an exercise in learning to program Python, so it's been a complete success. With your help, I might be able to turn out a product that's more useful than barbecue lighting fuel.
rad14701 wrote:The hotplate cycling is a problem as well because you can't maintain power input... Again, something you should know before your first attempt...
I get that, too, but I still need a method to control and maintain power more consistently. Right now I have about a pint per gallon of wash before the runoff starts to taste watery. I wouldn't drink it, though, and a run takes 2-3 hours where I understand it should take less than one.
Last edited by eStill on Tue May 10, 2016 10:17 am, edited 3 times in total.
User avatar
Mikey-moo
Distiller
Posts: 1498
Joined: Sat Feb 16, 2013 10:54 am

Re: Raspberry Pi Temp Controller

Post by Mikey-moo »

iStill wrote:The wash boils at whatever temperature the wash boils at and that depends on its eutectic mix which changes as the fractions evaporate off. I did high school chemistry.
I did that in school too but with crude oil which is a mixture, not a solution. We all watched the white vapours climb the fractionating column at different temperatures, one at a time, eventually condensing into separate flasks. This is exactly what I expected to happen in my still.

Sadly, for solutions it's not quite as easy - it all boils at once (yes, at a temperature defined by the relative %ages) and it's much harder to separate. This is why reflux columns need time to equalise - allowing the different vapours to settle out into layers in the column which can be slowly drawn off one at a time.
iStill wrote: a run takes 2-3 hours where I understand it should take less than one.
That depends on the type of still you have, the size of the charge, the amount of alcohol in it, the amount of power you can put into it and whether you run it hard and fast for stripping or low and slow for keeping.

You mention a column but we don't yet know if you have a pot still, using a column for passive reflux, or if you have a proper reflux still.

Pictures of your build would help :-)
Best place to start for newbies - click here - Courtesy of Cranky :-)

If you have used this site to save money by making your own top quality booze at home then please consider donating a couple of dollars to help keep this site running. Cheers!
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

Mikey-moo wrote:You mention a column but we don't yet know if you have a pot still, using a column for passive reflux, or if you have a proper reflux still.

Pictures of your build would help :-)
Yes. I'm still really concerned about the legality of a hobby still. I don't think I've mentioned anywhere whether I have a still and if I have intimated that I built one, I've not indicated what it's for.

If I have a still, I'm not yet prepared for the round of laughter ensuing from the publication of photos. It's not as bad as the redneck engineering discussed elsewhere, but it was only supposed to be an apprentice piece of pipework, which... Erm... Evolved... Into something which might be viable.

... And I'm not sure what category it fits in. Later tonight, I'll attach a design sketch purely for discussion. I anticipate a list of issues, mostly along the lines of "you don't know what you're doing" but I already accept this and don't need to hear it again.

It's a vertical column 15mm OD and 600mm long (I know - too short and too skinny) attached to a 5L pressure cooker. At the top and bottom of the column are thermometers and at the top, a 45 degree angled jacketed condenser. Condenser is also 15mm with a 22mm jacket. Cooling water recirculated through jacket by a pond pump from a 20L bin.
rubber duck
retired
Posts: 3452
Joined: Tue Feb 10, 2009 9:33 am
Location: brigadoon

Re: Raspberry Pi Temp Controller

Post by rubber duck »

OK so now that everyone has established you don't know what your doing distilling I like to hear more about using a pi as a temp monitor and controler.

I've done a little reading about using raspberry pi units but it's a little hard to follow.

Ohh and welcome to the forums.
Ideas are like rabbits. You get a couple and learn how to handle them, and pretty soon you have a dozen. John Steinbeck
rad14701
retired
Posts: 20865
Joined: Wed Dec 19, 2007 4:46 pm
Location: New York, USA

Re: Raspberry Pi Temp Controller

Post by rad14701 »

You are describing a simple pot still... Nix the pressure cooker... You'll learn WHY during your research... It's been more than adequately covered...

Some folks here do like automation but our advice to novices is to learn how to build and run a still manually, until you are proficient, before entertaining the idea of automation... Automation can be used as a tool but should not be used as a crutch - and I'm not implying that you you are...

Get with the research and it will all come together, but it won't happen overnight...
User avatar
InvertedSpin
Novice
Posts: 34
Joined: Tue Apr 26, 2016 10:01 am

Re: Raspberry Pi Temp Controller

Post by InvertedSpin »

rubber duck wrote:OK so now that everyone has established you don't know what your doing distilling I like to hear more about using a pi as a temp monitor and controler.

I've done a little reading about using raspberry pi units but it's a little hard to follow.

Ohh and welcome to the forums.
A Raspberry Pi is perfectly capable for this application, but you might consider an Arduino as an alternative as it is purpose-built for these kind of applications.

See Microcomputer vs. Microcontroller: http://www.digitaltrends.com/computing/ ... pberry-pi/" onclick="window.open(this.href);return false;" rel="nofollow
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

InvertedSpin wrote:A Raspberry Pi is perfectly capable for this application, but you might consider an Arduino as an alternative as it is purpose-built for these kind of applications.
I'm comfortable with either hardware/software platform. That's my specialist interest area. I went with the Pi as I initially wanted to have a standalone device to temperature logging, and The RPi has all the OS and storage for this, which the Arduino lacks.
rubber duck wrote:I like to hear more about using a pi as a temp monitor and controler.
For anyone who's interested, turning the RPi into a WiFi connected 10 channel digital temperature logging thermometer with (optional) LCD screen is a piece of piss.
rubber duck wrote:I've done a little reading about using raspberry pi units but it's a little hard to follow.
Nah. You don't even need soldering iron and can accomplish it for under $60, including the RPi, PSU, SD card and a few sensors. I'll walk you through it.
User avatar
cranky
Master of Distillation
Posts: 6676
Joined: Fri Sep 27, 2013 3:18 pm
Location: Pacific Northwest

Re: Raspberry Pi Temp Controller

Post by cranky »

It would be nice to set something up to automatically adjust the coolant flow to my CM but that sort of thing seems very confusing to my simple mind.
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

The most expensive part is the positional valve. I cheated slightly: I can switch my recirculating pump on and off with a relay.
User avatar
Mikey-moo
Distiller
Posts: 1498
Joined: Sat Feb 16, 2013 10:54 am

Re: Raspberry Pi Temp Controller

Post by Mikey-moo »

iStill wrote:
Yes. I'm still really concerned about the legality of a hobby still. I don't think I've mentioned anywhere whether I have a still and if I have intimated that I built one, I've not indicated what it's for.
Here in the UK it's legal to build, own, buy or sell a still. You can even use it to make distilled water, or extract essential oils from botanicals without fear of any interference from the state.

As soon as you put alcohol in it though, that's when you need a licence, either for distillation or rectification of spirits. None of us actually do that mind, but we like to pretend that we did, for shits and giggles. Mainly giggles.

I'm tempted to knock up pot still heads for sale on Ebay, I have a nice design in my head that would make it very easy if only I had a big enough pipe bender. Ho hum.
Best place to start for newbies - click here - Courtesy of Cranky :-)

If you have used this site to save money by making your own top quality booze at home then please consider donating a couple of dollars to help keep this site running. Cheers!
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

Mikey-moo wrote:Here in the UK
...and on that note, where the hell do we buy 50mm copper pipe??????
Mikey-moo wrote:You can even use it to make distilled water, or extract essential oils from botanicals without fear of any interference from the state.
Hell, that's all I'd want it for. I heard you can get 1 teaspoons of orange oil from half a dozen orange peels!
Mikey-moo wrote:As soon as you put alcohol in it though, that's when you need a licence, either for distillation or rectification of spirits. None of us actually do that mind, but we like to pretend that we did, for shits and giggles. Mainly giggles.
With my luck, I'd end up with the shits.
jdetechguy
Swill Maker
Posts: 244
Joined: Tue Feb 09, 2016 7:33 pm

Re: Raspberry Pi Temp Controller

Post by jdetechguy »

eStill wrote:
InvertedSpin wrote:A Raspberry Pi is perfectly capable for this application, but you might consider an Arduino as an alternative as it is purpose-built for these kind of applications.
I'm comfortable with either hardware/software platform. That's my specialist interest area. I went with the Pi as I initially wanted to have a standalone device to temperature logging, and The RPi has all the OS and storage for this, which the Arduino lacks.
rubber duck wrote:I like to hear more about using a pi as a temp monitor and controler.
For anyone who's interested, turning the RPi into a WiFi connected 10 channel digital temperature logging thermometer with (optional) LCD screen is a piece of piss.
rubber duck wrote:I've done a little reading about using raspberry pi units but it's a little hard to follow.
Nah. You don't even need soldering iron and can accomplish it for under $60, including the RPi, PSU, SD card and a few sensors. I'll walk you through it.
Did you write your own code? If so, is it in C, Java or Python? I have worked with a temp sensor and Pi, but have not done a complete distilling system. I fist decided to learn the manual way. And learned how to build my own controller.

I have been playing with Arduino and NodeMCU.
eStill wrote:
Mikey-moo wrote:Here in the UK
...and on that note, where the hell do we buy 50mm copper pipe??????
Mikey-moo wrote:You can even use it to make distilled water, or extract essential oils from botanicals without fear of any interference from the state.
Hell, that's all I'd want it for. I heard you can get 1 teaspoons of orange oil from half a dozen orange peels!
Mikey-moo wrote:As soon as you put alcohol in it though, that's when you need a licence, either for distillation or rectification of spirits. None of us actually do that mind, but we like to pretend that we did, for shits and giggles. Mainly giggles.
With my luck, I'd end up with the shits.

Cranky's Spoon Feeding
http://homedistiller.org/forum/viewtopic.php?t=52975
User avatar
Mikey-moo
Distiller
Posts: 1498
Joined: Sat Feb 16, 2013 10:54 am

Re: Raspberry Pi Temp Controller

Post by Mikey-moo »

eStill wrote:...and on that note, where the hell do we buy 50mm copper pipe??????
I got mine off ebay, but it's 54mm. For everything else I recommend JTM plumbing online.

But... do the reading first :-)
Best place to start for newbies - click here - Courtesy of Cranky :-)

If you have used this site to save money by making your own top quality booze at home then please consider donating a couple of dollars to help keep this site running. Cheers!
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

jdetechguy wrote:Did you write your own code? If so, is it in C, Java or Python? I have worked with a temp sensor and Pi, but have not done a complete distilling system. I fist decided to learn the manual way. And learned how to build my own controller.
Yep. It was my first outing in Python. I have countless obscure languages under my belt. LabVIEW, Ada and a few customer specific in-house ones used for safety critical work. I thought I'd go mainstream and learn Python. It's lovely! I hope to do a Java Android App for the user interface.

I've just discovered solid state relays. I think that might be how to more smoothly regulate the power to my hotplate.
User avatar
Danespirit
Master of Distillation
Posts: 2648
Joined: Tue Dec 25, 2012 8:09 am
Location: Denmark

Re: Raspberry Pi Temp Controller

Post by Danespirit »

A SSR could do the job indeed, but a simple SCR would also do the job.
They can be bought ridiculous cheap on E-bay...
Have a look at my extra controller here: http://homedistiller.org/forum/viewtopi ... 85&t=58011
It's very simple and could easily control a hot plate like yours.
A cheap way to learn how to run a still manually, before playing with automation.. :wink:
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

Danespirit wrote:A cheap way to learn how to run a still manually, before playing with automation.. :wink:
hehe! Without a doubt, I'll be controlling it manually at first. Electronically, but manually! Thanks for the tip.
User avatar
Kegg_jam
Distiller
Posts: 1167
Joined: Wed Aug 27, 2014 5:29 am
Location: Appalachian Mountains of MD

Re: Raspberry Pi Temp Controller

Post by Kegg_jam »

The SSR is easy to get going manually (potentiometer). Later you can tie it into the Pi or Arduino once you get a feel for what's going on.

I use an Arduino but am not tied down by it.
User avatar
raketemensch
Distiller
Posts: 2001
Joined: Sun Nov 09, 2014 2:10 pm
Location: Tralfamadore

Re: Raspberry Pi Temp Controller

Post by raketemensch »

I use a pi with a couple of DS18B20 temp sensors. Using them to control your boiler is counterproductive, as you've learned, but they're hella useful for other things.

I have sensors in my fermenters so that I can make sure the temp keeps my yeast happy. I also have set up a pi to control a hot plate to program in a mashing protocol for making AG. Unfortunately, I have crappy Stockpots, and my 16-gallon is too bit for the hot plate, but soon it'll be controlling a heating element in the big guy anyway.

Python is crazy easy to learn, too.

I recently discovered some $9 chip computers with built-in wifi, which is always the PITA with a new pi:

https://www.kickstarter.com/projects/15 ... 9-computer" onclick="window.open(this.href);return false;" rel="nofollow
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

raketemensch wrote:I use a pi with a couple of DS18B20 temp sensors. Using them to control your boiler is counterproductive, as you've learned, but they're hella useful for other things.
Changed policy now. I only use it to control the input power to regulate the cooling water. I recycle my cooling water from an 20gal tank. A 2 gal stripping run can raise the temp of the cooling water from 20 to 40 degrees. So, I adjust my input power depending on the temperature of the coolant to ensure the condenser can cope.

I must publish some temp / time graphs...
User avatar
raketemensch
Distiller
Posts: 2001
Joined: Sun Nov 09, 2014 2:10 pm
Location: Tralfamadore

Re: Raspberry Pi Temp Controller

Post by raketemensch »

Wait, so you're still controlling your boiler temp with it?
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

raketemensch wrote:Wait, so you're still controlling your boiler temp with it?
No. As I learned early on, one can't control boiler temp. The wash boils at whatever temperature it's eutectic mix demands. I control my heater with the Pi, because I need to regulate the power to my heater. In my case, it's an attempt not to overwhelm my condenser. I have a 1600W heater and only a 1 gal pot, until I find something larger.
User avatar
Mikey-moo
Distiller
Posts: 1498
Joined: Sat Feb 16, 2013 10:54 am

Re: Raspberry Pi Temp Controller

Post by Mikey-moo »

Hmmmm I'm thinking x power in causes y temperature increase in cooling water no matter how gently x is applied... within reason... your reservoir can get up to 60°C and still work enough to condense the vapours.

How long do your runs take you at the moment then?
Best place to start for newbies - click here - Courtesy of Cranky :-)

If you have used this site to save money by making your own top quality booze at home then please consider donating a couple of dollars to help keep this site running. Cheers!
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

Mikey-moo wrote:Hmmmm I'm thinking x power in causes y temperature increase in cooling water no matter how gently x is applied... within reason... your reservoir can get up to 60°C and still work enough to condense the vapours.
I agree that x power causes y temperature increase. So, a decrease in x yields a decrease in y. In other words, I hope that reducing the power causes the power to be reduced, so there is less power getting to the condenser.
Mikey-moo wrote:How long do your runs take you at the moment then?
About 15 minutes to get up to temperature and about an hour for a gallon of wash.
User avatar
Mikey-moo
Distiller
Posts: 1498
Joined: Sat Feb 16, 2013 10:54 am

Re: Raspberry Pi Temp Controller

Post by Mikey-moo »

That doesn't seem too bad. I think my point was that whether it's 1kw for an hour, or 2kw for 30 minutes, the overall power put into the cooling water is the same.

I know your running slowly to give the reservoir time to cool down. I imagine you're running several charges back to back. Does it really make much of a difference running slowly?
Best place to start for newbies - click here - Courtesy of Cranky :-)

If you have used this site to save money by making your own top quality booze at home then please consider donating a couple of dollars to help keep this site running. Cheers!
User avatar
eStill
Swill Maker
Posts: 150
Joined: Sun May 08, 2016 1:36 am

Re: Raspberry Pi Temp Controller

Post by eStill »

Mikey-moo wrote:That doesn't seem too bad. I think my point was that whether it's 1kw for an hour, or 2kw for 30 minutes, the overall power put into the cooling water is the same.
Again, I agree, but more heat can be dissipated through the copper condenser and lost from the cooling tank in 1 hours than can be lost in 30 minutes.
Mikey-moo wrote:I know your running slowly to give the reservoir time to cool down. I imagine you're running several charges back to back. Does it really make much of a difference running slowly?
I'm not sure I've ever exceeded the capability of the condenser. just worried that, as you say, when I do 2 runs back-to-back, those 3 hours of running at 70% of 1.6kW is enough for 20 gal of coolant to go from 20 to 40 degrees C! I'm going now o do an experiment running my coolant back into the reservoir over a weir from a height in the hopes it'll cool a good bit.
User avatar
Mikey-moo
Distiller
Posts: 1498
Joined: Sat Feb 16, 2013 10:54 am

Re: Raspberry Pi Temp Controller

Post by Mikey-moo »

Good idea. I saw a sketch that someone had drawn where the returning water was trickled down a slanted metal washboard to help cool it down. That might help. Or you could rig up some other sort of radiator in the return...
Best place to start for newbies - click here - Courtesy of Cranky :-)

If you have used this site to save money by making your own top quality booze at home then please consider donating a couple of dollars to help keep this site running. Cheers!
Post Reply