How to : Build a PID temperature control

Discussion in 'Beer Brewing "How-To" Guides' started by BigYin, Apr 14, 2011.

Help Support The Homebrew Forum UK by donating:

  1. Apr 14, 2011 #1

    BigYin

    BigYin

    BigYin

    Regular.

    Joined:
    Dec 31, 2009
    Messages:
    247
    Likes Received:
    3
    Location:
    Falkirk, Scotland
    This is a guide to how I built a temperature control box that controls the temperature of my boiler/HLT.

    This guide has been refined and additional safety information added following feedback and suggestions from a lot of people - thank you all for taking the time to help :thumb: :cheers:


    DISCLAIMER: MAINS ELECTRICITY AND WATER ARE A DANGEROUS COMBINATION, IF YOU ARE NOT CONFIDENT WORKING WITH SUCH, GET A COMPETENT PERSON TO DO IT FOR YOU.


    Safety First.

    *Disclaimer* - I am NOT an electrician - follow this guide at your own risk, but beware, you are dealing with 240v electrics that have the capacity to deliver a lethal shock - unlikely if you are sensible, but still, BE CAREFUL!

    Water and mains voltage electricity do NOT mix well. In use, raise the PID clear of the surface your boiler is on, and keep it reasonably clear so that slopped/spilt water, or over-boiling wort, won't land on the box and potentially cause fireworks!

    If you have a fuse box rather than a 'power trip' (RCD) box, consider using a plug RCD unit this is to ensure if there is a short, that the power is cut in the fastest time possible, to reduce the risk of a serious electric shock :thumb:

    Please also note, that running two elements off the same circuit can draw too much current and melt your socket!!

    I have one element plugged into the downstairs mains socket ring, and the other plugged into a separate supply, that used to supply the immersion heater, but as that's no longer there I have a socket instead. Most people probably won't have anything quite so convenient, so you may have to use just one element - it will still work, only a bit slower - or run one of the elements off a separate circuit - maybe the upstairs socket ring?



    If you are comfortable to continue, please do!

    The basic concept is this - the heating elements in the boiler are switched on and off by the control box. You set the target temperature, and the box does the rest. As the boiler/HLT temperature gets close to the target temperature, the elements will be switched off and on, initially more on than off, moving gradually to more off than on, then off, until the temperature falls and the elements will start switching on and off again.

    The main components are :

    A PID temperature control (in my case an XMT7100) (try Virtual Village on ebay, and search for "PID Digital Temperature Controller" - and note that Virtual Village are offering a 20% discount to forum members - see here )
    [​IMG]

    A PT100 temperature probe (again, try VirtualVillage on ebay and search for PT100 )
    [​IMG]

    One 40 amp SSR (solid state relay) for each heating element you wish to control - I used two
    [​IMG]

    Some way to cool the relay(s). More on this later.

    A casing big enough to take all the kit. Ideally this should be a box rated to IP56 for electrical safety - have a look here.

    I have to admit I used a 3 litre snap close plastic box from Maplin that cost about a fiver :oops: . I think on reflection a slightly bigger box would be better - there's a lot to pack into this - and one a bit safer considering we are playing with lots of electricity here :whistle:
    [​IMG]

    To allow me to easily plug in a different temperature probe I have the PID connected to a Euro Chassis Plug and the probe is wired to a Euro Line Socket - this also lets me completely unplug the PID setup from my boiler - making it a whole lot easier to move the boiler around, clean it etc.

    I also didn't want to wire the elements in directly to the PID, again I want to unplug them when I need to. So, I used two 1 gang switched sockets with simply back boxes
    [​IMG] [​IMG]

    This also allows me to have everything plugged in, but switch off either element as I wish, or switch them both off and just have the PID monitoring the temperature.


    For the internal connections some 5amp connector blocks are adequate for the connections between the PID and the relays, but for the other, mains connections, I used ones rated to 30A
    [​IMG]

    Lastly, some cable, capable of handling up to 30amp draw - ask at a suitable shop! - and three standard mains plugs.

    You will also need a few crimp terminal connectors (for connecting to the back of the Euro socket)
    [​IMG]


    Useful tools are :
    a dremel / drill
    a cable stripper
    screwdrivers
    a multimeter (only needed to figure out the probe connections)


    So, onto the build.

    The first thing to do is to figure out the temperature probe to PID connections.

    Although in the diagram below I have specifically shown where the three cables from the probe connect to, depending on your probe, you may need to wire it differently.

    To work this out you need a multimeter.

    Measure the resistance between each set of wires. In my case that was :
    red - blue : 108.8
    red - yellow : 108.8
    blue - yellow : 1.1

    Because blue to yellow is the lowest reading, they are the two that must go to the + and - terminals on the PID - terminals 6 & 7 on mine - while that leaves the red to go to the earth - terminal 8.
    [​IMG]

    The PID needs power, and the terminals are marked clearly enough -
    1 - live - red (or brown)
    2 - Neutral - black (or blue)
    3 - earth

    If you connect them up as a test you should see the temperature reading on the PID rather than just EEEE - error.

    Now is also the time to get the instruction sheet for the PID and get the settings sorted.

    Here's the settings I used :
    inty - input type - PT100
    outy - control output type - 2 ('one alarm relay output; SSR all the way non-contact level PID output')
    HY - autotuning pV bias - 0.3 (default)
    PSb - pV bias - 0.0 (default)
    rd - control action type - 0 (heat)
    CorF - unit selection - 0 - (Centigrade)

    You probably don't need to worry about the alarm settings, as I didn't bother with either the settings, or attaching any kind of alarm!!

    I didn't mess with the PID parameters, I just left them at their default values.


    You will also have to tackle the business of how to fit the temperature probe to your boiler/HLT. I tried a few solutions and settled on using the 10mm nut on the 15mm to 10mm Reducing Coupler which fitted the screw thread on the probe. I drilled a hole in the boiler, between the two elements (to leave space for the hop filter) and used 2 'O' rings to seal it.


    Relays

    Note that the SSR relays have a metal backing plate. This is their heat transfer plate, and it gets HOT in use. This has 2 effects - firstly, the efficiency of the relay reduces as it gets hotter, reducing the amount of power delivered to the heating element. Secondly, the life of the SSR will be severely shortened, and it will fail, if it is repeatedly allowed to overheat - not to mention it could melt your case if it's mounted to close to the side. :nono:

    There are several ways to tackle this issue. It's up to you how you decide to tackle it.
    1. a heatsink
    2. a cooling fan
    3. both!

    There are heatsinks sold specificaly for SSRs. They must be fitted using the appropriate heat transfer paste - all over the contact surfaces to ensure complete heat transfer. Please think carefully when you buy your SSR and see what the manufacturer says about safe use, and see if they have appropriate heatsinks - even better, get one complete with heatsink!

    Alternatively (or as well!) use a cooling fan - fit the SSR with a space between the metal backing of the SSR and the mounting surface surface (to acheive this I used bolts with a number of nuts as spacers to hold the relay away from the side of the box) and fit the cooling fan so that it will blow over the metal plates, carrying the heat away.

    If you do decide to go without a heatsink, DO CHECK that your setup is carrying away enough heat. Put it on a test boil with a boiler full of water (well, we don't want to muck up a brew day, do we :thumb: ) and monitor the temperature of the SSR(s) :thumb:

    I opted for this second option, using the cooling fan from an old PC - it is driven by a 12v power adaptor, powered by the same power feed as the PID in the control box. I drilled plenty of vent holes to allow the free passage of air through the case. In use, the SSR plates stay so cool they don't even feel warm to the touch :thumb:

    The hole I cut for the fan needs a bit of tidying up :lol:
    [​IMG]

    So, with the temperature probe connections figured out, the SSR cooling planned out, and the PID settings sorted, it's time to wire it all together..

    Here's my wiring Diagram (note that the probe plug wiring isn't included here) :
    [​IMG]

    First, mark out where you want each component to go.

    For the PID, the euro socket and the switched sockets I marked out the sizes and then cut the holes and tidied them up carefully.

    For the relays I drilled holes to take the mounting bolts, and 3 larger holes to pass the power cables through. To prevent the cables pulling you need some way of securing them - simplest would be a knot in the cable, and secured with a cable tie. To prevent water entry at these points consider fitting cable glands.

    For the relays I also drilled a whole series of holes on the side wall below where the relays were to go, and in the lid above them, to allow the heat from the relays to escape.

    With the holes all done, it's time to get wiring.

    The precise order is up to you.

    1. The PID needs power and it's connection to the probe.

    2. The switched output from the PID needs to go to each relay - note that the (+) terminal on the PID must be connected to the + terminal on the relay. Same for the (-) connection. I used connector blocks to take the switched output and split it between the two relays.

    3. The 'power out' - i.e. the switched sockets - take power from the other two power cables, but the live wire is routed through the relay to provide the switched control.

    4. Make sure all the connections are secure, and there is no exposed bare cable.



    That should be it! After plenty of fiddling about, getting things tightened up and secure, it's time to test it out.

    For the first run, the PID should have a 'learn mode' - check the instructions! - this is where it tries to intelligently learn the 'profile' of the kit it's been connected to. It doesn't know what volume of liquid it's heating. It doesn't know the power of the heating elements it's controlling. So it has to do a run or two to learn how often, and when, to switch the elements on and off to just hit the target temp, and no more.


    In day to day operation, you simply connect it all up, use the ^ and v buttons to set the temperature - just press them until the display shows the target temp, then leave it.

    I fill my boiler with water, then set the PID to the strike temperature, switch both elements on, and I can then disappear off to measure out my grain, knowing the boiler will be at the right temp when I come back.

    The PID will maintian the temp in the boiler (or HLT) during the sparge, BUT - make sure you turn the elements off BEFORE the liquor level gets too low!!

    For the boil, I set my PID to 102, using both elements until the wort starts boiling, then switch one element off. I then like to alternate between the elements every 20 minutes or so.

    At the end of the boil, I switch both elements off, but leave the PID on so it shows the temperature during the cool.

    Here's mine, working towards a boil. - Note the PID is sitting up on an upturned washing up bowl - I was glad of this since in a moment of inattention I let the wort boil over - if it wasn't for the bowl, the PID would have been sitting in a small lake of hot, sugary wort :nono:

    [​IMG]

    Good luck!! :drink:
     
  2. Apr 21, 2011 #2

    Guest

    Recently been looking at something similar, although I'll be using this http://shop.ebay.co.uk/i.html?_trkp...SetTopBoxes&_trksid=p3286.c0.m14&_sop=2&_sc=1 it already as two 10Amp relays built in.

    [​IMG]

    diagram
    [​IMG]
    [​IMG]

    you can simply add a 4 plug extension lead to both outputs which are rated to 10amps (heating & cooling) (2400watts each), they are the as same stc-1000, then set the desired temp to which you wish to strike.

    Also see
    http://helms-deep.cable.nu/~rwh/blog/?p=29

    Using instructions
    [​IMG]

    or (PDF)
    http://www.google.co.uk/url?sa=t&source ... ug&cad=rja (you'll need to download Chinese fonts)

    Total cost under 25

    With a little modification; If you only need one output, but a larger relay you run the other unused relay in parallel giving 20Amps.
     
  3. Apr 21, 2011 #3

    Aleman

    Aleman

    Aleman

    Regular.

    Joined:
    Aug 15, 2008
    Messages:
    257
    Likes Received:
    26
    But it's only a thermostat, not a PID controller . . . it's not designed to do the same thing at all
     
  4. Apr 21, 2011 #4

    Guest

    What it will do, is switch off at set temperature then switch back on on a set temperature. (All within the programming its a CONTROLLER) also switch on a fan at set temperature for cooling

    Temp range -50C - 99C

    for a better understanding here's a guy selling one, which hes using for home brew.

    http://cgi.ebay.co.uk/ws/eBayISAPI.dll? ... K:MEWAX:IT

    Also

    http://cgi.ebay.co.uk/ws/eBayISAPI.dll? ... K:MEWAX:IT (using a lower temp range)
     
  5. Apr 21, 2011 #5

    Aleman

    Aleman

    Aleman

    Regular.

    Joined:
    Aug 15, 2008
    Messages:
    257
    Likes Received:
    26
    I understand what it will do . . . I have three of them, but what it will not do is control a temperature to within 0.1C of the set point, for this you require a PID Controller and SSR. the PID controller switches the power on and off at a much higher frequency, and the duration of the on and off cycles (which vary) are tuned to each heating environment so that the temperature increases rapidly to the set point, slows down approaching the set point (to avoid overshoot) and then holds the temperature at the set point.

    The STC - 1000 is a digital thermostat. I can't recall off hand what the minimum on off cycle is - due to my instructions being in Chinese - but it is quite long (compared to a PID). These are perfect for controlling fermentation temperatures as the temperature changes are much slower. Use a mechanical relay at 10A with the frequency that a PID switches at and you will soon need to buy another relay

    the PID controllers are designed to control HLT Temperatures / RIMS and HERMS heater chambers for recirculation mashing. . . . . I use one on my boiler to maintain the mash out temeprature while I am sparging

    Completely different beasts intended for completely different environments.
     
  6. Apr 21, 2011 #6

    Guest

    Agreed they are different, the on/off can be set within 1C, not as low as 0.1C, but for most homebrew this is a very cheap alternative, as said in my first post its similar, the cost of the PID would be around 100+ with parts

    If you want English instructions a I've posted the link to STC-1000 (first post)
     
  7. Apr 22, 2011 #7

    BigYin

    BigYin

    BigYin

    Regular.

    Joined:
    Dec 31, 2009
    Messages:
    247
    Likes Received:
    3
    Location:
    Falkirk, Scotland
    Virtual village are currently selling the XMT7100 for 25.98 posted, and the 40 amp SSR's for 11.48 posted. They also give you 20% off as a homebrew forum member. I make that just under 40 for the PID plus the two SSR's. All the rest of the setup is cables, sockets etc which are pennies in screwfix.

    Horses for courses, although this is a thread about How To build a PID control unit. It is NOT a discussion about what's best or cheapest - that's a discussion to be had in somewhere like General Beer Brewing Equipment Discussion :thumb:

    The idea being, people can make up their own mind what to use, and IF this guide is useful to them, then great. If they decide on some other design, then that's fine too :drink:
     
  8. Sep 13, 2011 #8

    Darcey

    Darcey

    Darcey

    Landlord.

    Joined:
    Mar 22, 2011
    Messages:
    1,409
    Likes Received:
    0
    Location:
    Stockport
    Just a small technical question... I have purchased a SSR with heat sink and will be mounting it away from the wall of the enclosure, however in the future I will be adding another element to the boiler and will be adding another SSR so just in case and so I dont have to replace them every year I would like to add a case fan as you did. However when you say
    Does this mean that there is a 12V adapter inside the enclosure wired by connector blocks in to the live feed? Starting to get crowded in there?! Im not sure I have a 12V adaptor lying around.. hmm could use an old HO railway controller?!
     
  9. Sep 13, 2011 #9

    Muddydisco

    Muddydisco

    Muddydisco

    Landlord.

    Joined:
    Feb 26, 2009
    Messages:
    502
    Likes Received:
    1
    You can get 240v fans, mainly used on Disco lighting etc.. 4-5 on ebay, does away with the need for a 12v PSU
     
  10. Sep 13, 2011 #10

    Darcey

    Darcey

    Darcey

    Landlord.

    Joined:
    Mar 22, 2011
    Messages:
    1,409
    Likes Received:
    0
    Location:
    Stockport
    Ah ha! Sounds like a plan. Seems slightly pointless putting a fan if it is has to also cool a 12V adaptor!?

    EBAY! :cool:
     
  11. Sep 15, 2011 #11

    tomkandy

    tomkandy

    tomkandy

    New Member

    Joined:
    Sep 9, 2011
    Messages:
    12
    Likes Received:
    0
    I built a PID controller box for sous vide cooking, although it's currently controlling the fermentation temperature of my beer.

    [​IMG]

    I just built it to have a mains plug so I can plug a water bath into it for sous vide, aquarium heater for fermentation, HLT etc.

    The one I purchased has a k-type termocouple installed which isn't ideal for any of these jobs, so I've got a pt100 on the way.
     
  12. Oct 12, 2011 #12

    marc

    marc

    marc

    New Member

    Joined:
    Feb 13, 2011
    Messages:
    7
    Likes Received:
    0
    Location:
    leicestershire
    What is wrong with a K-type thermocouple ?

    i used to make and use them all the time in textile printing machines so i konw they are good.

    gives the highest mv/temp unit

    the pt100 is a good device.

    If your temp controller has a self tune mode then use it with a normal capacity of water first then record the settings just in case you have a failure.Also re run the test if you change anything.

    Looks like a project i will be making soon personally i will be using a heatsink might ebven use a fan without lights ...lol
     
  13. Oct 12, 2011 #13

    Vossy1

    Vossy1

    Vossy1

    Landlord.

    Joined:
    Jul 28, 2008
    Messages:
    1,307
    Likes Received:
    5
    Location:
    Manchester.....scorchio !
    Dragging this from the depths of my memory which isn't great at the best of time :lol:
    IIRC, Type K's don't work on a 'linear' basis, so they can be inaccurate at different temperature ranges, ie, just because they have been 'zero'd' at 0 deg c, doesn't necessarily mean they will read 100 deg accurately. Not really ideal for using over large temperature ranges.
     
  14. Nov 12, 2011 #14

    Jaffa

    Jaffa

    Jaffa

    Active Member

    Joined:
    Oct 6, 2011
    Messages:
    31
    Likes Received:
    0
    Just been browsing the forum. I am looking at going AG in the new year, I had to chuckle to myself at the IP56 box with a big hole in the side. My guess is its about IP00 now :p
     
  15. Nov 12, 2011 #15

    tazuk

    tazuk

    tazuk

    Landlord.

    Joined:
    Dec 30, 2010
    Messages:
    1,528
    Likes Received:
    2
    Location:
    beeston nottingham
    this is how i built my pid unit i think its the dogs bits lol get my drift following post :thumb:

    viewtopic.php?f=13&t=19526
     
  16. Nov 12, 2011 #16

    Jaffa

    Jaffa

    Jaffa

    Active Member

    Joined:
    Oct 6, 2011
    Messages:
    31
    Likes Received:
    0
    Nice job, im still on kits, my PID consists of the wireless controller for my boiler sat on my FV next to a radiator :geek:
     
  17. Nov 12, 2011 #17

    tazuk

    tazuk

    tazuk

    Landlord.

    Joined:
    Dec 30, 2010
    Messages:
    1,528
    Likes Received:
    2
    Location:
    beeston nottingham
    ya lol i not even done my first ag brew i have getting all me gear ready got me recipys ready to do :thumb:

     
  18. Feb 24, 2012 #18

    bobsbeer

    bobsbeer

    bobsbeer

    Well-Known Member

    Joined:
    Apr 13, 2011
    Messages:
    119
    Likes Received:
    13
    Location:
    Milnthorpe, Cumbria
    Can't seem to find the PID mentioned in this How To, but found this on on E Bay:
    [​IMG]

    SSR PID Temperature Controller



    Brand New and High quality
    REX-C100 Dual Digital F/C PID Temperature Controller Control
    Adopts special microcomputer adjusting meter that employs switching power and surface mount technology (SMT)
    Auto setting and intelligent control
    Commonly used in the display and control of the parameter of temperature, pressure, flow, and liquid level.




    Specification:
    Display
    1. Process value (PV), Setting value (SV) :-1999~+1999
    2. Output, alarm and self-tuning can be indicated by: LED

    Control method
    1. PID control
    2. Auto setting control

    Accuracy
    1. Measuring accuracy: 0.5%FS
    2. Cold-end compensation tolerance: 2C (can be modified by software in 0~50C)
    3. Resolution: 14 bit
    4. Sampling cycle: 0.5 Sec

    Setting range
    1. Setting value (SV): identical to measuring range (PV)
    2. Proportional band (P): 0~full range (ON/OFF control when set to 0)
    3. Integral time (I): 0~3600 sec (No integral action when set to 0)
    4. Derivative time (D): 0~3600 sec (No derivative action when set to 0)
    5. Proportional period: 1~100 sec
    6. On-Off control output hysteretic loop width: 0 to 100C (or other PV units)

    3.79 plus postage.
    Is this any good? Suitable?
     
  19. Feb 24, 2012 #19

    Northern Brewer

    Northern Brewer

    Northern Brewer

    Landlord.

    Joined:
    Nov 21, 2011
    Messages:
    563
    Likes Received:
    0
    Location:
    Todmorden
    Hi BB

    I have tested the REXC100 with a kettle and a PT100 probe see here but not used them in anger yet - will be soon so hope htey work as I have a few of them :pray:

    You have to get the SSR version, see the end of this thread

    Cheers
    NB
     
  20. Feb 24, 2012 #20

    bobsbeer

    bobsbeer

    bobsbeer

    Well-Known Member

    Joined:
    Apr 13, 2011
    Messages:
    119
    Likes Received:
    13
    Location:
    Milnthorpe, Cumbria
    Thanks NB. Will this control 2 elements?
     

Share This Page