Consumer/Industrial - Stud Finder
August 4, 2004
Document No. 001-34563 Rev. **
1
AN2200
Authors: Chris and Vincent Paiano
Associated Project: Yes
Associated Part Family: CY8C22xxx, CY8C24xxx, CY8C27xxx
GET FREE SAMPLES HERE
Software Version: PSoC Designer™ 4.1
Associated Application Notes: None
Application Note Abstract
The PSoC® device is configured to react to the presence of studs through drywall to allow the user to easily locate a sturdy
point to anchor or hang up an object. The sensor presents the studs via five LEDs. By holding the Stud Finder against a wall
and moving it along horizontally, the different LEDs will light up as a stud is sensed.
Introduction
When hanging a heavy object, it is advisable to find a
piece of your home’s supporting wood beams within your
wall on which to anchor the object or your drywall may rip
apart. Using a PSoC Stud Finder, one can simply pass it
along a wall and look at the LEDs to find these studs
without penetrating the drywall. This is very similar to the
operation of COTS (Commercial-Off-The-Shelf) units,
available in hardware stores everywhere.
Software/PSoC Implementation
The PSoC implementation of the Stud Finder involves a
resonant circuit based on two inverters’ propagation
delays, which generates an oscillation. This oscillation
clocks an 8-bit pre-scale counter to divide the frequency
down, and that output is then fed to a 16-bit counter clock
input to count the frequency as it comes in. An additional
8-bit counter is set up as a sample time generator; every
time it reaches terminal count, the frequency counter’s
count is retrieved. The difference between the current
count and the last count is read as the frequency’s value.
Based on the constant NumOfReadings, a number of
readings is taken and then averaged. This average
controls which LEDs light up at any given time, based on
the constants LEDxThreshold.
A TX8 block, clocked at 8x the desired bit rate of 115.2
kbps, was also included to provide a debugging func