could be as simple as a direct
connection from the sensor output
to the ADC input if the sensor
voltage is limited to less than the
supply voltage of the PIC. Consult
a qualified electrician before
attempting to design a signal
conditioning circuit for any high
The configuration shown in the
schematic is what I've used in my
electric truck application where the
inputs are 12 volt PWM at a
frequency of 60 Hz. The resistor
voltage divider drops this down to
five volts, and the parallel 10 µF
capacitor smooths the PWM into a
I have tested the timer1 input up
to 100 kHz with a 50% duty cycle
square wave with accurate results. If
you modify the software, you may
have to adjust the length of the
PAUSE statement in the main
subroutine to maintain the accuracy
of your count, as this length takes
into account the latency of the code
in this loop to set a precise half
second interval between displayed
The PIC16F819 has the option
of using an internal oscillator and
internal MCLR pull-up resistor. In this
design, I’m using the internal
oscillator, but have MCLR pulled up
externally so the PIC can be easily
hard-reset if desired. When you
program your PIC, you will need to
select the "INTIO2" oscillator
configuration option to enable the
internal oscillator. Note that not all
programmer software uses
Microchip's standard name for this
option; my software calls it "IntRC."
Construction style is not critical
unless your sensor outputs require
special shielding, so a small piece of
perfboard and a suitable plastic
enclosure is probably all you will
need for the build (Figure 5).
Now, dream up a project that
needs real time process monitoring,
build it, and then build this process
monitor to help you keep tabs on it.
January 2014 37
ITEM DIGI-KEY PART #
PIC16F819 microcontroller, 18-DIP PIC16F819-I/P-ND
( 3) PC-mount pushbutton momentary switches 450-1665-ND
( 4) 10K ohm 1/4 watt resistor 10KQBK-ND
( 2) 10 µF 25V tantalum capacitor 478-5813-ND
7805 voltage regulator, TO-220 296-13996-5-ND
2x20 character LCD with HD44780 controller MOP-AL202C-BYFY-25E-3IN-ND
Parts List excludes input signal conditioning circuits.
Order Toll Free 1-800-826-5432
24VDC DPDT 25A RELAY
Tyco P&B PRD-11DYO- 24.
24 Vdc, 288 ohm coil.
Contacts rated 25A,
240 Vac. 3.375" x
2. 51" x 2. 50" high.
2-COND. POWER CORD
2. 4" square panel meter.
Full scale = 1mA DC.
Imprinted with 0 - 15 and
0 - 3 VOLTS scales in black
with white background.
6' black SVT round
cable. 0.23” nom. o.d.
relief. UL, CSA.
10 for $1.85 each • 150 for $1.75 each
5. 5' cable with 2.5mm coax
plug, center+. RoHS, cULus.
$675 each 10 for $6.50 each
2 AMP CIRCUIT BREAKER
P&B W28-XQ1A- 2.
Single pole, panel mount
circuit breaker. UL, CSA.
CAT# CB-2802 $175 each
4-POSITION PC MOUNT
Screw-clamp terminals on
5mm centers. Accepts up to
14 AWG wire. Rated 10A, 300V. Numbered
1– 4. Consists of 2 interlocking modules that
can be separated or added to other modules.
CAT# TER-404 60¢ each 100 for 40¢ each
ENCLOSURE W/ MEMBRANE
PUSHBUTTONS & BATTERY
designed for a medical
device, 5. 75" x 3" x 1.5".
Six membrane pushbuttons are built into the
front cover with flexi-ribbon
cable termination. Two 0.45"
square cut-outs on either side
of case. Features a battery
compartment, folding desk-stand, a belt clip
and a clear plastic window.
CAT# MB-910 $2 00 each
RGB LED, 5MM
4-lead, red-green-blue LED. One common
lead (anode) and one lead for each color.
5mm (T1 3/4). Water-clear in off-state.
75¢ each 10 for 70¢ each 100 for 60¢ each