PIC16F690DM-PCTLHS Microchip Technology, PIC16F690DM-PCTLHS Datasheet - Page 4

BOARD DEMO PICTAIL HUMIDITY SNSR

PIC16F690DM-PCTLHS

Manufacturer Part Number
PIC16F690DM-PCTLHS
Description
BOARD DEMO PICTAIL HUMIDITY SNSR
Manufacturer
Microchip Technology
Series
PICtail™r

Specifications of PIC16F690DM-PCTLHS

Sensor Type
Humidity
Sensing Range
1 ~ 99% RH
Interface
Analog
Voltage - Supply
5V
Embedded
Yes, MCU, 8-Bit
Utilized Ic / Part
MCP6291, PIC16F690
Processor To Be Evaluated
MCP6291 and PIC16F690
Interface Type
ICSP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
AC162061 - HEADER INTRFC MPLAB ICD2 20PIN
Sensitivity
-
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Lead free / RoHS Compliant
AN1016
For instance, a +5% error in k
becomes a -0.25% error in the average ((k
this is a very significant improvement in accuracy.
Greater accuracy can be achieved by reducing the
original error in k
to +2% gives a -0.04% error in (k
The extraction equations are below in Equation 7.
These equations assume C
described in Equation 3 and Equation 4. The constant,
B
(see Figure 3) was chosen to make it easy to convert
k
EQUATION 7:
The firmware actually multiplies the sum (k
the pre-calculated constant B
HUMIDITY SENSOR
The HS1101LF humidity sensor from Humirel is
described in detail in its data sheet [1]. It has a relative
humidity (RH) accuracy of about ±2%, and its nominal
capacitance ranges from 162 pF to 193 pF.
FIGURE 4:
Sensor’s Nominal Capacitance with T
Since C
range, and has a nominal value of 180 pF, it follows
that:
• A 1 pF change in C
• RH changes
• RH changes
• RH changes
DS01016A-page 4
1
1,
nominal value
C
count (k) for Figure 3
Pre-calculated Constant:
Extraction Equation:
and k
is the circuit’s resolution in units of pF / count. R
SEN
195
190
185
180
175
170
165
160
B
C
SEN
2
1
SEN
0
into C
=
changes by about 31 pF across the full RH
10
------------------------- -
V
k
---------------- - B
V
RH
SEN
1
k
DD
1
0.32% for each increase of 1 in the
1
3.2% for each 1 pF change in
6% for each 1% change in C
+
20
2
. For example, reducing the k
+
k
V
(making B
k
2
2
RL
2
30
SEN
HS1101LF Humidity
B
----- -
2
1
40
T
------------ -
R
1
is a 0.56% change in its
⎞ ,
CLK
INT
RH (%)
1
50
SEN
/2.
1
= 0.100 pF / count).
coded form
1
1
60
(a -5% error in k
+ k
is constrained as
70
2
)/2.
80
A
= +25°C.
1
1
90 100
SEN
+ k
+ k
1
2
2
error
) by
)/2);
INT
2
)
FIRMWARE
This algorithm is implemented in the firmware for the
Humidity Sensor PICtail™ Demo Board [15]. The
firmware can be downloaded from Microchip’s website
(www.microchip.com).
Additional Requirements
The circuit and microcontroller need to be initialized. It
is necessary to drive V
starting the capacitance measurements; it could be
either above or below V
Averaging (8 times) is included in this algorithm. The
timer counts need to be converted to C
Extra delay before starting each measurement
improves the accuracy. It gives the op amp time to
settle, and allows the firmware time to prepare for the
next measurement.
Modular Code
The following assembly code modules (for the
PIC16F690) make up the Humidity Sensor project:
• main.inc - contains I/O port and global defines
• main.asm - contains the main executive routine
• initialize_f690.asm - initializes the
• capacitance.asm - reads capacitance using a
• humidity.inc - contains PwLI table segment
• humidity.asm - contains PwLI routine to
• ssc.asm - contains Synchronous Serial Commu-
• 16f690.lkr - linker script for Humidity Sensor
These files can be downloaded from the Microchip web
site (www.microchip.com); and are contained in the
00084R1.zip file.
used throughout the project
including configuration bit assignments
PIC16F690 to known initial values
dual slope integration technique; Table 2 shows
the algorithm for this module
values
convert capacitance to %RH humidity
nications (SSC), a synchronous serial communi-
cations protocol between a target PICmicro
microcontroller unit and the PICkit™ 1 Flash
Starter Kit or PICkit™ 2 Starter Kit.
project
RL
© 2005 Microchip Technology Inc.
SEN
when starting.
to a known point before
SEN
, then to RH.

Related parts for PIC16F690DM-PCTLHS