2.3 " Digital thermometer
18-June-2005
www.sixca.com
This project is a 3-digit digital thermometer easy to build for
beginner or hobbyits.PIC16F628 used to read digital value
of temperature from
a DS1820 sensor.All 7-segments drived by
power logic 8-bit shift register TPIC6B595 with open collector output.
For the 7-segment need 12V volt to drive because it have 3 LED per
one segment.All segment no need to scan display.
Source code
programming with CCS C Compiler
availible.
Feature :
- 2.3 " 7-segment X 3
- Power supply 9-12Vdc from adaptor
- 0.5'C accuracy (see data sheet for more accuracy)
- display temperature rank from 00.0 - 99.5 'C
- small components count.
- easy software for beginer to understand
Figure 1. schematic for this project
The TPIC6B595 is a monolithic, high-voltage,
medium-current power
8-bit shift register
designed for use in systems that require relatively
high load power.
Figure 2. TPIC6B595 pinout
Figure 3. TPIC6B595 logic symbol
This device contains an 8-bit serial-in, parallel-out
shift register
that
feeds an 8-bit D-type storage
register. Data
transfers through both
the shift and
storage registers on the rising
edge of the
shift-register
clock (SRCK) and the register clock
(RCK),
respectively. The
storage register
transfers data to the output buffer
when shiftregister
clear (SRCLR) is high. When SRCLR is
low, the
input shift register is
cleared. When output
enable (G) is held high, all
data in the output
buffers is held low and all drain outputs are off.
When G is held low,
data from the storage register
is transparent to
the output buffers.
When data in
the output buffers is low, the DMOS-
transistor
outputs
are off. When data is high, the DMOS transistor
outputs have sink-
current capability.
The serial output (SER OUT)
allows for
cascading
of the data from the shift register to additional
devices.
From figure ,TPIC6B595 use 5 pins from PIC16F628 to
control only.
#define EXP_OUT_LATCH PIN_B0 // Output latch
#define EXP_OUT_CLOCK PIN_B3 // Clock
#define EXP_OUT_DO PIN_B5 // Data
#define EXP_OUT_CLEAR PIN_B4 // output clear
Code to send data 1 byte to output of TPIC6B595
//=================================
// WRITE DATA TO 6b595
//=================================
void write_expanded_outputs(BYTE *D)
{
BYTE i;
for(i=1;i<=8;++i)
{ // Clock out bits from the *D array
if ((D & 0x80)==0)
output_low(EXP_OUT_DO);
else
output_high(EXP_OUT_DO);
D=D<<1;
output_high(EXP_OUT_CLOCK);
output_low(EXP_OUT_CLOCK);
}
}
The main loop use while statement to looping
to read data from
sensor then
send it
to TPIC6B595
and delay about 0.5 second for
each
loop.
void main()
{
while(1)
{
1. read sensor
2. write data (refreash display)
3. delay 500 mS
}
}
Download source code
Other PIC projects
2.3 " Digital thermometer.PIC Microcontroller base project
3 Channel IR remote control the RC5 protocol IR remote
Control stepping motor via USB interface with PIC18F4550
ICD2 Clone Programmer and debugger for PIC Microcontroller
USB Data Acquisition with PIC18F4550
50 MHz frequency counter with LCD display + PIC16F84
|