CURRENT ISSUE

Contests

bottom corner

FEATURE ARTICLE



Issue #216 July 2008

Place Microchip 2007 Design Contest
’Net-Enabled Alarm Clock

by DJ Delorie

Start | System Overview | Network | Display | MP3 | ADC | Memory | Power | Software | Time | Alarms | GUI | Remote Protocols | Construction & Packaging | Smart Combinations | Sources & PDF

ADC

Three ADC inputs are used to monitor the ambient light, volume setting, and push buttons. The photocell is used with R110 to produce a light-sensitive voltage divider. More light increases the reference voltage, which is read as a higher value by the ADC. Each ADC input includes a small capacitor to keep the ADC’s sample and hold circuitry from distorting the input signal.

In addition to the photocell and volume control, the ADC is also used to monitor the seven push buttons. To save on pins, each switch connects a different valued resistor into a resistor divider. The resistor values were carefully selected so the ADC values produced are evenly spaced and halfway between multiples of 64. Thus, I can simply use the high 8 bits as the “switch number.” For debouncing, there are two mechanisms. First, capacitor C101 acts as a low-pass filter. Its value is small enough that the signal can pass through each switch’s “zone” within one cycle of the ADC. Second, the software requires the same switch reading multiple times in a row. Only a stable value is used to trigger a button event.

The mounting of the switches was somewhat of a challenge. I use tactile switches, which have a small range of motion but a good “feel.” To adjust their spacing relative to the wooden buttons activating them, I mounted them on a circuit board, and held that board with two nuts on a screw (see Photo 3). The screw head is epoxied to the case. The nuts can be adjusted to control the spacing between the board and the case accurately.

Photo 3
Photo 3— A separate circuit board and some screws epoxied into holes in the wood provide an adjustable mounting point for the tactile switches. Attaching the screws to the PCB before gluing holds them in place to ensure alignment. The nuts are adjusted so the wooden buttons don’t rattle.

Previous | Next                *| Subscription Deals |*

 


bottom corner