Touch Control Temperature Monitor

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

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

Touch Control Temperature Monitor

Post by JohnCrow »

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
Main System
System.JPG (156.25 KiB) Viewed 4311 times
Main System
Sensors.JPG
Sensors.JPG (104.14 KiB) Viewed 4311 times
Close Up Of Protoboard With LM35 Sensors
Temp Monitor V1.fcf
(148.96 KiB) Downloaded 579 times
1 in 10 people understand binary, the other one doesn't !

Post Reply