We have simulated & tested a working design in the ideal environment provided in Proteus ISIS. The design does the following functions:
- Sense & display temperature
- Display the input voltage signal
To select the required function, a switch is provided.
We have used an LPC 2138 microcontroller to control the functioning of the device, a K-type thermocouple to sense the temperature, and an LM016L 16x2 LCD display panel to provide the readings. We have used an AD595 instrumentation amplifier to provide CJC for the thermocouple.
To design the circuit schematic & simulate it, we have used the Proteus ISIS Professional V7.10.
To program the microcontroller in embedded C, link the microcontroller specific startup file, load the instructions on the microcontroller and create a .hex file ready to be flashed onto the microcontroller, we have used Keil Uvision 4.
---------------------------------------------------------------------------
Block diagram

Interface
The Display Panel Meter has the following external interfaces:
- K-type Thermocouple to sense the temperature
- 16x2 LCD panel to display the temperature
- 0-10V Potentiometer to represent a 0-10V voltage signal
- Switch to shift between the 2 modes of temperature & voltage display
Modes
The switch can be used to toggle between the following 2 modes:
- Switch on = Temperature Indicator
- Switch off = Voltage Indicator
Specifications
* Temperature Indicator
- Accuracy of output: +-0.25% of full scale [+-3.277‘C]
- Temperature sensing Range: -25‘C – 1286‘C
- Set-Points:
- Upper Set-Point = 1280‘C
- Lower Set-Point = 800‘C
* Voltage Indicator
- Accuracy of output: +-0.1% of full scale [+-0.01V]
- Voltage sensing Range: 0V – 10V
- Set-Points:
- Upper Set-Point = 8V
- Lower Set-Point = 2V
Components used
- AD595 Instrumentation Amplifier with inbuilt CJC
- LPC 2138 Microcontroller
- LM016L 16x2 LCD panel
- K-type Thermocouple
- Red LED (Alarm)
- 100Ω, 4kΩ, 1kΩ Resistors
- (0-10V) Potentiometer [to represent input voltage signal]
---------------------------------------------------------------------------
Schematic Diagram

Programming
Registers used [LPC 2138]
- ADC
- PINSEL0
- AD0CR
- AD0GDR
- GPIO
- IO0DIR
- IO1DIR
- IO1SET
- IO1CLR
- IOPIN0
Program flow
1) Select Pin 27 as ADC port AD0.6 & Pin 29 as ADC port AD0.7 using PINSEL0 register
2) Initialize the LCD
3) Set Pin 40 as Output port P1.20
4) Check P0.0’s value using IOPIN0. If it is 1, call tread. If it is 0, call vread.
---------------------------------------------------------------------------
Functions defined
- Main Code ‘PS-1 DPMc.c’
- adc6: Returns the digital value of analog input, after the conversion has occurred at AD0.6
- adc7: Returns the digital value of analog input, after the conversion has occurred at AD0.7
- vread: Turns on the ‘Temperature Indicator’ mode
- tread: Turns on the ‘Voltage Indicator’ mode
- The LCD header file ‘16x2_LCD.h’ (User-defined)
1. Lcd_init: Initialises the LCD by executing the following instructions
* Function Set (0x38)
* Display Switch (0x0c)
* Input Set (0x06)
* Screen Clear (0x01)
* Cursor at Home Screen (0x80)
2. cmd: provide an instruction to the LCD
3. dat: display a character
4. show: display a string
5. lcd_delay: create a small delay
tread():
1) Select channel 7 of ADC using AD0CR register & start the conversion
2) Check MSB of AD0GDR, to see if the digital conversion has completed
3) If yes, transfer that value to integer val
4) Shift val to ensure that the 1st 8 bits of val contains the converted value
5) Scale val to make it equivalent to the temperature value
6) Adjust for the error created by AD595
7) Provide negative values
8) Display the temperature value
9) Adjust for the Set-Points; display ‘Critical’ if they are exceeded & switch on the LED Alarm
Vread():
1) Select channel 6 of ADC using AD0CR register & start the conversion
2) Check MSB of AD0GDR, to see if the digital conversion has completed
3) If yes, transfer that value to integer val
4) Shift val to ensure that the 1st 8 bits of val contains the converted value
5) Scale val to make it equivalent to the voltage value
6) Incorporate the decimal point & accuracy up to 2 decimal places
7) Display the voltage value
8) Adjust for the Set-Points; display ‘Critical’ if they are exceeded & switch on the LED Alarm
---------------------------------------------------------------------------