This demonstrates reading object and ambient temperatures with a ZyTemp (http://www.zytemp.com/) infraredthermometer. Embedded modules can be purchased, or they are commonly found as rebranded low cost handhelddevices. This has been tested with TN105i2 (1:1 distance to spot) and TN203 (6:1 distance to spot, plus laser).These were rebranded as CEN-TECH #93983 and #93984 respectively, from Harbor Freight.
These modules communicate using an SPI-like protocol. The thermometer must be the Master though, so I modifiedthe SPI engine to support Slave operation (and included it with this demo). The pins are accessible by openingthe case of either thermometer. There's a 0.1" header at the bottom of both PCBs with labels.
The pins are labeled:
- A: Action
- G: Ground
- C: Clock
- D: Data
- V: Vdd
This demo connects Clock to P0, Data to P1, Action to P2, and of course Ground to Vss.
To take readings, the Action pin is grounded by pressing the button. This demo watches that pin to determinewhen to read temperatures. This can also be pulled down at the pin if you'd like Propeller control. You mustbe careful though... the button does short this to ground, so I recommend putting in a series resistor (1k or so)to prevent shorting the output from the Propeller in case you press the button while connected. On the TN203,the laser seems to be grounded through this pin as well, so there's ~10mA sunk when grounded. If you have theseries resistor, you'll still get readings, but the laser won't light. This demo displays the object and ambienttemperatures to the debug RS232 port.
While I haven't tried it, I believe you can power the thermometer through the Vdd pin. I've always left theinternal battery installed and left Vdd disconnected though. I believe the laser on the TN203 is poweredseperately though. You should remove the battery if powering from Vdd.
The modules have an EEPROM to store emissivity values, which can be changed, though this demo doesn't use thatfunctionality. More information on the protocol, messages, and features can be found by downloading the manualson the ZyTemp website.
This code was based on Beau Schwabe's SPI Spin Demo.
See forum post for more info/pics: http://forums.parallax.com/forums/default.aspx?f=25&m=453982 .