4 Channel Touch Control Temperature Monitor
This project was programmed to test out the capabilities of the new Touch LCD e-block
The program is quite complex, using a fair amount of macros and decisions.
It is possible it will run a lot quicker on a 16bit device, however the EB076 is currently not supported on anything apart from 8-bit PICs
Introduction:
The project is a 4 channel temperature monitor/controller.
It uses the LM35 series devices as the temperature sensor, connected to the ADC inputs on the PIC Microcontroller.
Hardware:
EB006 Programmer – 20MHz Crystal
EB076 Touch Screen Display
EB017 Protoboard – With 4 LM35 type Temperature sensors & patch Leads
PIC 18F4550 – Running at 48 MHz
Macros:
Main:
The “Main” macro initialises the touch screen.
It then displays the basic instructions for the program.
Finally , after a couple of seconds delay, the user is in invited to swipe the screen to proceed.
This is a simple macro. First it calls Setup_Screen
The drops into an endless loop.
The loop repeatedly calls the following macros
Display_Temps & Scan_Touch
Setup_Screen:
This simply draws the boxes and places the fixed text on the screen.
Display_Temps:
This is the main part of the program
It performs the following
Read the lower and upper alarm points from EEPROM
Read the 4 ADC inputs from the LM35 devices
Checks if the temperature inputs are above or below the limits.
Depending on the temperature they are printed in a different colour
RED = Above Limit
BLUE = Below Limit
GREEN = Within Limits
Scan_Touch:
This macro scans the touch screen using the X&Y co-ordinated.
There are 5 areas to detect.
Ch1 Setup/Review Ch1
Ch2 Setup/Review Ch2
Ch3 Setup/Review Ch3
Ch4 Setup/Review Ch4
These open a new screen where each channels upper and lower alarm limits can be viewed or changed. These are stored in EEPROM so are non-volatile.
Also shows the min and max temperature since the last reset
Reset This calls reset by means of a “C-Box”
reset();
It has the same effect as pressing the reset button on the programmer.
The 4 channel macros are identical in operation.
If the set low or set high button is touched, the value is entered from the keypad in the following way
Highbyte first
Lowbyte second
keyval = (Highbyte*10)+Lowbyte
keyval is then stored in the relevant cell in the EEPROM.
The value shown on the display is then updated.
The macro is exited by a decision box looking for a touch in the bottom of the screen.
Main System
Close Up Of Protoboard With LM35 Sensors
Touch Control Temperature Monitor
Moderator: Benj