SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By smeeon
#116627
Hi, I'm starting a beginner project for myself and I need a bit of suggestion from anyone who might have done this before.

I need to build a controller that reads the temperature of liquid in a tank and trigger a relay which will in turn activate a pump which will begin a cool down process. Currently this is controlled manually when a temperature alarm goes off I manually turn on the pump which cools down the tank. Ideal temperature is ~68F so I need the pump to turn on at 70F and turn off when the temp reaches 65F. The problem is this is an anodizing tank which contains sulfuric acid and distilled water (basically battery acid) so the environment for the sensor is pretty harsh. the sensor doesn't have to be TOO accurate it just needs to do it's job of keeping it around 68F.

does anyone have suggestions on what type of sensor to use?

As for a control module I was thinking arduino (because I have a few laying around) but I'm open to suggestions on that too. Thanks for being an awesome community! most of my answers have been answered by just doing some basic searches here but this time I've run dry on results.
By Blackfin
#116659
How is the temperature being measured now (i.e. what sets off the alarm currently?) Is it feasible to tap into that circuit and using it to trigger the pump (using a window comparator arrangement to set the high and low temperature points)?

Can the temperature of the container be used or do you have to measure the acidic liquid directly?
Last edited by Blackfin on Wed Jan 05, 2011 8:33 am, edited 1 time in total.
By esklar81
#116667
smeeon,

How does your current alarm sense the temperature? If the temperature measurement is sufficient (adequately fast, precise, and accurate), why not have a controller monitor the current alarm signal line and, when the alarm is detected, turn the pump on for a predetermined period?

Even if you want the pump to turn off when a certain temperature is reached (say, start the pump at 70 degrees and stop the pump at 68 degrees), can you use the temperature measurement device you have now?

If there's some reason not to use the temperature sensor you have now, I suggest you look at how to separate the sensor from the bath, rather than looking for a sensor that will withstand the bath. I'd start by considering whether the method that your current alarm uses could be used for a new sensor. If not, is the tank wall sufficiently conductive that you could adhere a sensor to the outside, then insulate it well from the room? Lastly, consider using a thermocouple well.

What type of sensor you use depends on the temperature range, precision, and accuracy you need. If all you want to do is turn the cooling pump on and off, just about any type of sensor will work, because you'll just need to program the upper and lower bounds of analog input. You could use a relatively simple circuit, such as this, to detect when the temperature is in the range in which you want the cooling pump to run.

If you're interested in getting a bit more sophisticated, such as having a digital display of the current bath temperature through an Arduino, SparkFun has a few temperature sensors, including this one that's claimed to be both cheap and linear. That sensor has an output of 10mV/°K, which is not great [((10 mV//°K) 5 V = .002/°K) * (1023 counts in the Arduino ADC) = 2 counts/°K] for the range of interest to you, but you could use a op-amp between the sensor and the Arduino to convert °K to °C (that is, to shift 0 mV to 0 °C, assuming you have no need to measure temperatures below the freezing point of water) and increase the sensitivity to 10 (or more, if you're comfortable decreasing the range) counts/°K. The biggest challenge in using that sensor will probably be finding a way to couple it thermally to the bath so that you get acceptable response time. (How rapidly does your bath temperature change? If you need a sensor that responds in less than a second to a 1 °K change, this may be a bit of a challenge. If you need one that responds in a minute or two, it will be much easier.)

Thermistors, such as this, are a bit more complicated to use for digital measurement, because their electrical responses to temperature changes are not linear. If all you want is an on-off switch for your cooling pump, this doesn't really matter, because you can program your controller to respond at the two appropriate points. If you want to display the temperature, you'll need the code to do a bit of math or provide a look-up table.

With either the analog or the digital approach, you'll need to amplify the output to drive a suitable power switching device. If you let us know on what power (AC or DC, voltage, current) the pump runs, we can probably help with that.

One can also measure temperature with a thermocouple or an IR sensor, but my impression is that these aren't your best choices.

Have Fun,
Eric

PS: Blackfin beat me to the punch on a couple of points, but I'm not energetic enough at the moment to edit my posting to remove the duplication of what Blackfin posted while I was typing.
By stevech
#116678
smeeon wrote:Hi, I'm starting a beginner project for myself and I need a bit of suggestion from anyone who might have done this before.

I need to build a controller that reads the temperature of liquid in a tank and trigger a relay which will in turn activate a pump which will begin a cool down process. Currently this is controlled manually when a temperature alarm goes off I manually turn on the pump which cools down the tank. Ideal temperature is ~68F so I need the pump to turn on at 70F and turn off when the temp reaches 65F. The problem is this is an anodizing tank which contains sulfuric acid and distilled water (basically battery acid) so the environment for the sensor is pretty harsh. the sensor doesn't have to be TOO accurate it just needs to do it's job of keeping it around 68F.

does anyone have suggestions on what type of sensor to use?

As for a control module I was thinking arduino (because I have a few laying around) but I'm open to suggestions on that too. Thanks for being an awesome community! most of my answers have been answered by just doing some basic searches here but this time I've run dry on results.
I'd buy one, since this is rather dicey.
By mac
#116986
Cheap and easy to use sensor with arduino: dallas DS1820
Need some special interface and software, but you can find ready-to-use example code for Atmel (ie arduino).

Do not put the sensor directly in the bath. Put it into a casing, either plastic or glass, which is completely sealed. A cheap way is to embed the sensor into epoxy resin, but there is a risk of failure.
By smeeon
#118495
turns out after much searching in unrelated areas of the net that they make this exact device for temperature regulation in aquariums. It does take the fun out of the DIY but its also much more durable of an option and it's only about $120 shipped.

Thanks guys!
#118551
A thermocouple could be used for this. They are available in many varieties and should be able to handle anything you can throw at them.

I just wrote an article on a very simple, cheap way to read a thermocouple using a TI TMP513 Power Supply Monitor chip. The code is written in Swordfish Basic for PIC18F-series micros but it's simple enough that it won't be difficult to translate into any language on any controller that has I2C support.

May not be needed for this project but it may be useful for others.

Jon