TPA81 Infrared Thermopile

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

TPA81 Infrared Thermopile

Post by JohnCrow »

TPA81 Infrared Thermopile Array

The TPA81 is a thermopile array, that operates in the infrared spectrum ( 2um to 22um range).

It has an array of 8 infrared sensors and a ninth sensor to measure local ambient temperature.
Unit has a maximum reading of 100°C. I have managed to get reading up to 150°C by pointing it at a soldering iron, this is obviously below the tip temperature, and accuracy cannot be guaranteed above 100°C.

The device is aimed more at being a heat source detector, rather than an accurate infrared thermometer.

A device such as the Melexis MLX90614 which uses the SM-Bus would be a ideal for that requirement.

Required Hardware.

EB006 Multi- Programmer (Standard crystal and 16F877A Microcontroller
EB005 LCD Display PORT A
EB007 Switch Board PORT B
EB058 gLCD Display PORT C
EB016 Proto-Board with TPA81 PORT D

Connecting Wires

Readings are taken using the I2C bus protocol. (Software)

Configuration.

The LCD display cycles between the 2 sets of readings.

The average of the 8 thermopiles is shown along with the sensor internal temperature.
The maximum and minimum values of the average thermopile readings is shown.

The 8 thermopile values are shown graphically using the gLCD display.
These range from 0°C to 100°C

I2C Configuration.

It will be noticed that the program does not use the hardware implementation of the I2C bus.
It runs using the software implementation on Port D
SCL = Bit 3
SDA = Bit 4
Speed is not over important in this project.

Also trying to read the registers in sequence, as the I2C bus would normally be read, didn’t work.
After some experimenting, the configuration used in this project was found to work.

The pull-up resistors used are 1k8



General Operation & Macro Descriptions.

This is a brief description of each part of the program.
The flowchart should be found to be documented and easy to follow.

Main
The main part of the flowchart. Calls other macros when needed.

Max-Min
Stores the maximum and minimum values of the average value from the 8 thermopile sensors
The max temp is set to 0
The min temp is set to 100
This means that when the 1st set of readings is taken the correct values are set as max and min.
This then compares the stored value with the current value and if different the value is changed.

Calculate Average
The readings from all 8 sensors are averaged and displayed along with the internal temperature of the TPA81 (Ambient). This holds for 2 seconds and then the max and min values of the average are displayed

Display Thermopile
Shows all 8 values on the LCD
1-4 on the top row
5-8 on the bottom row
This macro is not actually called in this version. If required a macro call can be inserted in the main loop.

gLCD
This takes the 8 thermopile values and plots them as a simple bargraph on the gLCD display
The graph is designed to show the relative difference between the sensors, rather than for accuracy.

Display Results.
Prints the results on the LCD.
These are shown in 2 sets
First Ambient and Average. Then this is cleared and the Max & Min Values are shown.

Read Sensors.
Reads the 9 temperature registers over the I2C bus
Results are stored in an array.

Reset MM
Press & hold SW0 on Port B. Display will show Max – Min Reset.
Resets the stored max and min values to the current temperature.
This needs to be held for a couple of seconds to reset the old values.
Complete System
Complete System
Complete System v2.JPG (139.15 KiB) Viewed 4654 times
TPA81 Sensor On Development Board
TPA81 Sensor On Development Board
Sensor.JPG (90.9 KiB) Viewed 4654 times
TPA81- gLCD-LCD-Software V4.fcf
Flowchart
(30.68 KiB) Downloaded 409 times
1 in 10 people understand binary, the other one doesn't !

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: TPA81 Infrared Thermopile

Post by JohnCrow »

Slight improvment. I've used an interupt to call the Max-Min reset function.
Using the INT, the reset is called by pressing RB0
TPA81- gLCD-LCD-Software V5 - Int.fcf
(30.24 KiB) Downloaded 400 times
1 in 10 people understand binary, the other one doesn't !

Post Reply