Turtle and Tortoise Newsletter, 2000, 3:16-19
© 2000 by Chelonian Research Foundation

Turtle and Tortoise Newsletter

Continuous Temperature Measurements in Reptile Enclosures, Using Simple Electronic Equipment and a Standard Personal Computer

Victor J.T. Loehr
Homopus Research Foundation, Nipkowplein 24, 3402 EC IJsselstein, Netherlands,
Email:, Website:

Increasing survival pressures on turtles worldwide emphasize the need to develop successful husbandry and breeding protocols. In conjunction with wildlife management plans, these may increase survival chances for many species. Although a growing number of species is reported to propagate successfully in captivity, detailed descriptions allowing others to reproduce the suitable husbandry practices, often lack. Sometimes this is caused by restraints to publish gathered data, but at other times data sets simply are insufficient.

In this article, I describe a relatively easy method to continuously monitor the temperature in reptile enclosures, by means of simple electronics and a standard personal computer. This offers the possibility to make (and eventually publish) detailed temperature measurements, at reasonable costs and time-investment. While temperature is important, I realize that it is only one factor involved with successful husbandry and breeding.

The electronic device consists of a microchip, generating a pulse in a circuit with a capacitor, a resistor and a temperature-dependent resistor (KTY10). The frequency of the pulse is the product of the temperature-dependent resistor and the (stable) capacity of the capacitor, and thus is dependent on the temperature. When the temperature increases, the resistance of the temperature-dependent resistor will increase, decreasing the frequency of the pulse. Measurement of the time one pulse takes (and thus temperature) is effected via the serial port of a personal computer (3.86- or 4.86-laptop computers are ideal, as they save energy and are usually very silent). A maximum of 4 circuits can be connected to a computer via one serial plug.

The components of one circuit are:

· Microchip timer TLC555
· Stable capacitor 1 uF
· Resistor 2kOhm
· Temperature dependent resistor KTY10 (± 2 kOhm)
· Circuit board
· Serial port plug (female)
· Power supply 6 V, 200 mA

The circuitry schematic is shown in Fig. 1 (below).

The pins of the serial plug are numbered 1-9. Pin number 5 (GND) is the ground (-). Pins number 1 (DCD), 6 (DSR), 8 (CTS) and 9 (RI) can be used to send signals from four circuits to the computer (+).

In order to protect the KTY10-sensor when placed into a terrarium, it can be covered by a small watertight test tube.

The pulse generated by the circuit can be ‘listened to’ by the connected computer, using a few lines-program in Turbo Pascal. It records the amount of time (L) needed for a single pulse, using the 1 Mhz clock (8253) in the computer.

This program (Program 1) only measures and displays the amount of time one pulse takes (for each sensor, every minute), without translating it to temperature. In order to translate the time to temperature, the circuitries need calibration. I have found that this can best be carried out after complete installation of the hardware (including the KTY10 sensors in the terrariums). Theoretically (and apparently in some cases experimentally), calibration can also be accomplished by establishing (for each circuit) the function between R and L, by temporarily connecting a stable 2 kOhm resistor, and after that a stable 1.5 kOhm resistor, instead of the KTY10 resistors. After reading of L from the computer screen, the function between L and R should be linear (R = aL + b). Next, R can be translated to temperature, by establishing the resistance of each of the KTY10 resistors at a known temperature range (fridge, freezer, room temperature, et cetera) by means of a multimeter. The function (theoretically also a straight line for the temperature range usually prevailing in reptile enclosures) found should be included in the computer program to display temperature instead of L or R.

Program 1. This program measures and displays the amount of time one pulse takes (for each sensor, every minute), without translating it to temperature.

Since the method described above did not yield satisfying results for my circuits, I have chosen to establish a direct function between L and the temperature. In order to do so, I have installed all hardware, and placed calibrated thermometers touching the KTY10 sensors in all four enclosures. For each 0.5°C in an appropriate temperature range I have recorded L. This yielded 3rd degree polynomial functions for each of the circuits. These were implemented in the computer program, by adding lines ‘T:= a+bL+cL2+dL3;’ after the Measurepulsetime-procedure for each of the circuits, as well as a declaration for T (real type) and changes from L to T in ‘str(L:1:0,S1); outtextxy(451,90,’CTS: ‘+S1);’.

Enlarging the program
The program outlined until now only displays temperatures for four KTY10 sensors. Next, the program can be enlarged, for example to measure temperature every few minutes, saving data once in a while, and showing a graphic on the computer screen. This can be a very time-consuming process, and considerable knowledge on Turbo Pascal, or a friend or collegue who has this knowledge, is required. As an example, below are a few procedures that could be used. A copy of the full program currently in use by the author may be obtained digitally via E-mail as an example.

Drawing of a graphic
The chart axes and a grid can be created by means of the procedures ‘line’ and ‘rectangle’. Axes labels (and grid lines) can be added using the operator ‘mod’, or by putting the numbers and texts separately using procedure ‘outtextxy’ (as was used in the program shown above).

The easiest way to draw temperature lines, is to put a pixel in the graph for every measurement (calculate how many pixels will be put in for instance 24 hours, and adjust the size of the chart (axes) to that). This can be done by means of procedure ‘putpixel’. The software I currently use, draws 4 stacked charts in one screen, one for each of the 4 temperature sensors in use.

Saving data on disk
Temperatures can first be transformed to numbers with a size of one byte (0-255), using a suitable function (for measurements within a temperature range of 15-40.5°C this could be (temperature*10)-150). The total file size then will be the number of measurements per hour * 24 hours * the number of sensors used. The file size can be used to loop the program, for measurement cycles of 24 hours.

A name for the file can be generated from the current date and time (using procedures ‘getdate’ and ‘gettime’), changed into strings. This prevents that files overwrite each other, when the same names are used.

Files are saved at the end of each loop, using procedures ‘assign’, ‘rewrite’ and ‘blockwrite’.

Adjusting computer clock
Note that for each temperature recording, the computer clock is stopped temporarily! When the course of the temperature in the software is recorded as a function of time, a procedure to adjust the clock is necessary. This can be done for instance every 24 hours, using procedures ‘gettime’ and ‘settime’, to add the time that has been lost during the measurements.

Data processing
Before the saved data can be used in a spreadsheet program like MS Excel, it needs to be converted to a compatible format. I use Program 2 to convert the saved data to *.txt files. The calculation to transform bytes to temperature should be changed in case another function is used in the main program.

Program 2. This program is used to convert the data into a format compatible with Microsoft Excel. It saves file in a *.txt format.

Initial results
In addition to the Turbo Pascal software, I have created a macro in MS Excel/Visual Basic, to automate data processing. It calculates averages and standard deviations for maximum temperature, minimum temperature, increase of temperature in the morning, and decrease of temperature in the evening, per sensor and per month. Figures 2 and 3 show some very limited preliminary results for two of the four enclosures.

Figure 2. A. Average maximum and minimum and B. Average temperature change in enclosure 1.

Figure 3. A. Average maximum and minimum and B. Average temperature change in enclosure 2.

Although significant knowledge of Turbo Pascal is required to develop extended temperature monitoring software, the basics of the methods described here are simple, and hardware parts are cheap and usually readily available. The device described may yield valuable information, contributing to the development of successful husbandry and breeding protocols.

Being primarily an ecologist, my knowledge on electronics and Turbo Pascal is limited. Neither the device described here, nor this article could have been produced without the great help of my collegue Ton van der Heiden.

In no event shall the author be liable for any damages whatsoever, caused by practising the methods described in this article.