Stupid water bath tricks

As part of the downward spiral into increasingly esoteric subjects that is currently happening on this site, I now present some info on making a water bath do things. Simple things, but things nonetheless.

An old Cole-Parmer Digital Polystat water bath.

An old Cole-Parmer Digital Polystat water bath.


As part of an ongoing project in the lab, it became necessary to start carrying out simple temperature ramps with a water bath. For instance, we’ll start from a temperature of 15°C and go to a target temperature of 35°C at a rate of 10°C per hour. We could have an intern sit there and manually change the target temperature every minute or five minutes, but that’s not a terribly efficient use of people, especially when you’re confronted with a 2+ hour temperature ramp.

However, we have several of these old blue Cole-Parmer Digital Polystat water baths floating around the lab. They were purchased back in the early 2000’s, and are no longer sold. Cole-Parmer sold two different versions, the basic “Digital” model, and a more expensive “Programmable” model. The basic digital models cost at least $3000, so you didn’t just go around buying programmable models willy-nillly if you don’t need their features. But the basic Digital models we have do have the capability to communicate over a RS232 serial port, which opens up the possibility of changing and querying the bath temperature via computer (or a microcontroller). The Programmable models had the same communications capability, plus the ability to store a series of fancier temperature ramp cycles (akin to a PCR thermocycler).

I wrote a Python 2.7 script (found in this GitHub repository) that will carry out a simple linear temperature ramp (up or down) from a specified starting temperature, at a specified rate. The script relies on the Pyserial add-on package to carry out the communication over RS232 serial. The water bath has an old-school RS232 port on the back that you use to communicate with the computer. If your computer isn’t ancient enough to have a RS232 port any more, you can buy a cheap USB -> RS232 adapter for around $15.

The RS232 port on the back of the water bath. Also pictured is the separate external temperature probe plug.

The RS232 port on the back of the water bath. Also pictured is the separate external temperature probe port.

After establishing a serial connection (57600 baud, 8-N-1, no flow control), the Python script can talk to the water bath using three simple commands.
To query the current water bath internal temperature, it simply sends RT and the water bath responds with the temperature in degrees Celsius (by default): 25.23.
To query the current water bath setpoint (the temperature it’s trying to hold), you send RS and receive back the temperature setpoint: 25.00.
Finally, to change the setpoint, you send a command SS with the temperature appended to it as such: SS026.25. All of the digits (three ahead of the decimal, two after the decimal) must be included. With these simple commands, the Python script can implement two program types. The first option brings the bath to the starting temperature and holds there until you tell it to begin the temperature ramp. The second option starts the temperature ramp immediately from whatever the current bath temperature is.

The Python script relies on the water bath’s internal PID controller to deal with achieving the desired setpoint and not overshooting constantly. There will always be some lag or occasional overshoots of the target and actual temperature while the ramp is occurring, but the error is likely to be less than 0.1 °C. When the final target temperature is achieved, the Python script closes the serial connection and quits, leaving the water bath to sit at the current set point. Ultimately the performance will be limited by the bath’s ability to add or shed heat from the water, so asking for temperature ramp rates in excess of ~20°C/hr is probably asking for too much. If you wanted to implement more complicated temperature cycles, you can use this script as a template for your own custom version.

What if you don’t have this specific water bath model? Well, check the instructions that came with your water bath and see if it has any serial communications capabilities. If it does, follow the protocol listed there. The commands might not be simple codes like RT or SS025.00, but you should be able to find the corresponding codes. The current Polystat water baths implement a different communications protocol via USB, but in theory you should be able to make Python talk to those units just as well by following Cole-Parmer’s protocols and modifying the commands that my Python script sends to suit that protocol.