an LED to indicate basic
functionality, and a screw
terminal array configured
to behave as digitally
compatible switching
inputs via some pull-up
resistors. I don’t mean to
understate things, yet the
circuit design is just that
simple. This is certainly a
case where the firmware
handles the brunt of the
task.
All project files are
available at the article link,
so the schematic diagram
presented here is to be
used as an outline of
behavior. Notice how the
schematic generally
resembles the image of
the original prototype.
There are plenty of
standards and opinions regarding circuit design. Keeping
things simple and straightforward is usually the best policy
to promote understanding and even dreaded
troubleshooting. The schematic’s only difference is it has
more input switches in the form of pull-up resistor-connected pin headers (top of schematic: S1-S16) and the
addition of an optional voltage regulator (IC3).
The switches work as simple closure contacts. For
example, R2 (1K ohm to 39K ohms, depending on signal
skew and transient rejection desired) is connected serially
to the voltage source and to switch S1 (pin header). The
other connection is S1 to ground.
When S1 is closed (terminal is shorted to ground), the
voltage seen at the junction of R2 and S1 changes from
the nominal high voltage (five volts, in this case) to ground
(0 Vdc). The PIC will interpret this voltage change as an
input logic transition from 1 to 0. Thus, we have a
negative logic switch. As long as our firmware knows this,
everything will work fine.
Resistor R18 (1K ohms-5K ohms, depending on
desired brightness) and diode D4 are the components
used to connect an “idiot light” LED to our PIC.
Again, this will be a logic 0 driven output. Other than
the output via a USB connection, this will be our only
indication of functionality.
The example firmware is written so that the LED will
illuminate on device startup initialization and on key
presses (switch closures). In my humble opinion, there
November 2013 29
■ FIGURE 2. Schematic.
ITEM DESCRIPTION MFG PART# SOURCE / NOTES
C2 CAP/TANT 4. 7 µF 16V 20% 1206 F931C475MAA Nichicon
C4 CAP/CER 0.47 µF 10V 20% 0603 C1608X5R1A474M TDK Corporation
D1 DIODE SWITCHING 75V SOD323 1N4448WS-7-F Diodes, Inc.
D2-3 DIODE ZENER 3.9V SOT23-3 BZX84C3V9-7-F Diodes, Inc.
D4 LED CHIPLED 633NM RED 0603 LS Q976-NR-1 OSRAM Opto Semiconductors Inc / Not required for
operation
IC1 IC MCU 8-BIT 32 KB FLASH 28SOIC PIC18F2550-I/SO Microchip Technology
IC3 REG LDO 5V 0.1A TO92-3 L78L05ACZ ST Microelectronics / Not required for operation
JUSB CONN USB A SMD 1001-011-01101 CNC Tech
JPRG CONN HEADER .100 5-POS PEC05SAAN Sullins Connector Solutions / Programming Header
POW 9V BATTERY CONNECTOR 84-4 Keystone Electronics / Not required for operation
R1-17 RES 39.0K OHM 1/10W 1% 0603 RC0603FR-0739KL Yageo / Valid range from 1K ohm to 100K ohm
R18 RES 3.30K OHM 1/10W 1% 0603 RC0603FR-073K3L Yageo / Valid range from 100 ohm to 5K ohm
S1-16 MOMENTARY SWITCH SPST-NO GPB024A05BB CW Industries / Not required for operation
Y1 20 MHz CERAMIC RESONATOR PBRC20.00MR50X000 AVX Corp
Note: Generally, most of these part values and manufacturer part numbers can be substituted.
This circuit is very forgiving! So, use whatever you have around as long as it is reasonable.
PARTS LIST