TFD-128 USB tempearture and humidity-logger as delivered from Conrad (www.conrad.com).

This is an excellent piece of hardware but unfortunately there is no official Linux software to my knowledge wich is a pitty and the manual is in German only. This page is an attempt to help non German speakers and Linux users to get it up and running using free software only.

This is a picture of the logger and its package.

Picture of logger and package.

Opening the logger to insert the batteries might be tricky. This is how it should be done. Like a matchbox.

Picture of how to open the logger.

According to the developer Andreas Engel there exist two versions of the TFD128. One is from Conrad. The other one is from ELV AG. They seem to be identical and both have been tested with the software written by Andreas. You may download it following This link. (GPL-licensed) or visit Andreas site for the most updated version.

Extract the two files an make the main script executable by issuing

 chmod +x tfd128.py

To get it up and running under Linux you need to install some software-packages. I use Ubuntu so I use apt-get to install the packages I need.

 sudo apt-get install python-serial 

The Python interpreted language is already installed by default and the kernel module needed as well (ftdi_sio.ko).

Add the following entry to /etc/modprobe.conf or /etc/modprobe.conf.local :

options ftdi_sio vendor=0x0403 product=0xe0ec

Add the following entries to /etc/udev/rules.d/10-private.rules:

 SUBSYSTEM=="usb_device", ACTION=="add", ATTRS{product}=="ELV TFD 128", \
      RUN+="/sbin/modprobe ftdi_sio"
  KERNEL=="ttyUSB*", ATTRS{product}=="ELV TFD 128", SYMLINK+="tfd128"

Now connect the logger and follow what's happening.

tail -f /var/log/messages
	
	Jun 23 16:26:04 outside kernel: [ 6635.086269] usb 4-2: new full speed USB device using uhci_hcd and address 2
	[ 6635.268384] usb 4-2: configuration #1 chosen from 1 choice
	[ 6635.392495] usbcore: registered new interface driver usbserial
	[ 6635.392807] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
	[ 6635.393083] usbcore: registered new interface driver usbserial_generic
	[ 6635.393089] drivers/usb/serial/usb-serial.c: USB Serial Driver core
	[ 6635.410481] drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device
	[ 6635.410878] ftdi_sio 4-2:1.0: FTDI USB Serial Device converter detected
	[ 6635.411101] drivers/usb/serial/ftdi_sio.c: Detected FT8U232AM
	[ 6635.411597] usb 4-2: FTDI USB Serial Device converter now attached to ttyUSB0
	[ 6635.411905] usbcore: registered new interface driver ftdi_sio
	[ 6635.411911] drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver
	

Notice that the logger is connected to ttyUSB0 in my case. Now try to run lsusb to make sure everything is ok.

lsusb
	Bus 005 Device 005: ID 058f:6366 Alcor Micro Corp. 
	Bus 005 Device 001: ID 0000:0000  
	Bus 001 Device 004: ID 03f0:0024 Hewlett-Packard 
	Bus 001 Device 001: ID 0000:0000  
	Bus 003 Device 002: ID 045e:0024 Microsoft Corp. Trackball Explorer
	Bus 003 Device 001: ID 0000:0000  
	Bus 004 Device 003: ID 0403:e0ec Future Technology Devices International, Ltd 
	Bus 004 Device 001: ID 0000:0000  
	Bus 002 Device 001: ID 0000:0000  
	

The line "Future Technology Devices International, Ltd" is what we are looking for. Now the red LED on the logger should be on. Try to run the script and see if we are able to communicate with the logger. Make sure that the TTY used by TFD128 is consistent with the TTY used in the script.

tfd128.py -v

It should output the loggers internal versioning number or at least what is supposed to be. On My system it prints "100". If it doesn't work and outputs an error similar to below then try to run the command again.

	File "tfd128.py", line 273, in <module>
    	print "%s" % logger.get_version()
	File "tfd128.py", line 212, in get_version
	result = self.__xfer('V')
	File "tfd128.py", line 65, in __xfer
	r = ord(ser.read(1))
	TypeError: ord() expected a character, but string of length 0 found
	

Now, if everything works fine then bring up the help page by issuing:

 tfd128.py --help 

Now the rest is easy. Many thanks to Andreas Engel for bringing us this software and for his patience while helping me getting started.

Now, why don't you try to calibrate your logger? Mine was 4% off wich might bee the difference between mould and not mould. The divergence of the logger is constant and when it's known it's easy to compensate for. This is how the calibration is done.

Now let's try to plot our data. First install gnuplot

sudo apt-get install gnuplot

Plot the file tfd128-20070609.csv by issuing the following commands inside gnuplot:

	set title "TFD-128 GnuPlot Demo"
	set style function linespoints
	set xlabel "Time"
	set ylabel "Humidity & Temperature"
	unset key
	set grid
	set datafile separator ";"
	plot 'tfd128-20070609.csv' using 1:4 title 'Moisture','tfd128-20070609.csv' using 1:3 title 'Temperature'
	

This should generate a plot like this one from a calibration test on my TFD-128. Remember to comment out the first line in the datafile since the column-titles is not understood by Gnuplot.

Plot of calibration of TFD-128