26 June 2015
The source code — written in PIC BASIC PRO — is
available at the article link, along with hex files for using
the code without a compiler. The software also serves as a
tutorial on how to use a PIC timer as a frequency counter.
You still need to program the microcontroller, but there
are quite a few circuits for inexpensive programmers on
the Internet, and also a few inexpensive programmers,
Caveats and Conclusion
A few caveats are in order. This system is about as
secure as the simple lock and key
devices in furniture and children’s
toys. It’s not as secure as most RFID
locks, and I certainly wouldn’t secure
my house with one. It would be good
for locking-out TVs and game systems
during homework time, or as a lock for
a child’s lock-box or diary.
Of course, as with any electronic
lock system, you should have an
alternative means of opening your lock
in the event of a circuit or power failure.
The paper clip inserted in a hole that
once was needed for computer optical
discs is one possibility.
Also, you needn’t be limited to
the key shape presented. You can
have a card instead of a key, with a
flat coil to accept the card and some
ferrite powder glued between sheets
of plastic. If you decide to crush ferrite
cores to make a powder, remember to
wear safety glasses! Wrapping them in
paper and crushing in a vice is a typical
ITEM DESCRIPTION ITEM DESCRIPTION
Circuit with Mixer Circuit with Microcontroller
2. 2 megaohm R13-R14
2. 2 megaohm
R5-R6, R9 10K ohm R16R15-
R7-R8 1 megaohm R17 470 ohm
R10 100K ohm R18-R19 220 ohm
R11 220 ohm
R12 1K ohm C13-C14 4700 pF NPO
C15-C17 0.01 µF
C1-C2, C5-C6 4700 pF NPO
C3-C8, C10-C12 0.01 µF L3 Key Coil (Note 2)
C9 0.02 µF (Note 1)
IC5 CD4049 AE
D1 1N4148 IC6 PIC12F675
L1 Key Coil (Note 2) LED2 Red LED
L2 Reference Coil (Note 2)
IC1 CD4049 AE J2 Jumper
IC4 TLC2272 (Note 3)
LED1 Red LED
Five volt Power Supply
PCB (Patterns are available at the article link)
(1) Can be a parallel combination of two 0.01 µF capacitors.
( 2) See text.
( 3) Most five volt rail-to-rail operational amplifiers will work. You need two, or a dual chip.
The datasheet for the PIC 16F675 is available
from Microchip at
Stan D’Souza, “Frequency Counter Using PIC16C5X ,”
Microchip Technology, Inc., Application Note AN592 at ww1.
PIC BASIC PRO is available from
M.E. Labs, Inc.
2845 Ore Mill Road, Ste. 4, Colorado Springs, CO 80904
Dev Gualtieri received his Ph.D. in
Solid State Science and Technology
from Syracuse University in 1974.
He had a 30 year career in research
and technology at a major aerospace
company and is now retired. Dr.
Gualtieri writes a science and
technology blog at
blog/ blog.php. He is the author of two
science fiction novels, and books
about science and mathematics. See
www.tikalonpress.com for details.