Rev. 0.2 / 09 /2015
9
AN1111-2
All three measurement paths (“
sensor
” or “
reference
” or “
calibration
”) use the same
algorithm.
Example
: reference path
:
1.) Discharge all capacitors (I/O pins RC1, RC5, RC6, RC7 and RA2 = output LOW)
2.) Charge
reference
capacitor and C
L
(RC6, RC5, RA2 = input, RC1 = switched to
comparator input, RC7 = output HIGH). The charge from the reference capacitor
is also transferred in the capacitor C2 (=C
L
) and the voltage in C2 (=C
L
) rises a
little bit. C2 is approx. 10.000 times higher than C_REF.
3.) Discharging
reference
capacitor (RC6, RC5 = input, RC1 = switched to
comparator input, RA2, RC7 = output LOW).
4.) Increment the number of charge/discharge events (in this case N_C
Ref
).
5.) Check if the voltage at the pin RC1 (comparator) reaches the voltage at the
voltage divider:
no
repeat point 2.) and recharge the
reference
.
yes
end of loop and save the numbers of charge/discharge events.
6.) Each cycle measures the
reference
path and the
sensor
path and calculates the
sensor capacitance from these measurements.
3.1.1 Bill of Material
Quantity Symbol Device
Dimension
Supplier
1 pc
HCT01
Humidity sensor
HCT01-02 or HCT01-03
E+E Elektronik
1 pc
D1
Fast Si-Diode
1SS400TiG
1 pc
C2
Resistor
1 µF, ceramic / X7R
1 pc
Existing
microcontroller
PIC16F690
Microchip
1 pc
C_REF
Capacitor
82 pF, ceramic / NP0 / CG0
5 pcs
R1-R5
Resistor
470
Ω
Requirements for the microcontroller
1.) 3 to 4 digital I/O pins, switchable between output and (analog) input
2.) Integrated comparator (switchable to digital I/O output), external component also possible
3.) Integrated voltage divider (used as reference voltage at comparator), external component also
possible