outputs, respectively. Each diode’s brightness is affected by
changing the PWM duty cycle of the preferred channel. For
each channel, the duty cycle can range from 0xFFFF (LED
full off) to 0x0000 (LED full on), but is limited in firmware to
a minimum of 0x4FFF to help limit LED current
consumption. A single resistor, R6, serves as the current-limiting resistor for all three diodes within the package. By
doing so, I could remove the need for two additional
resistors (one resistor for each diode), but this means I can
only have one color on at a time to achieve consistent
brightness control. I used U1‘s Timer 1 to create an RGB
LED multiplexing routine which would enable each
individual LED in a cyclical fashion every 1 mS — fast
enough to be unnoticeable to the human eye.
Microphone
MK1 is a Knowles Acoustics ( www.knowles.com)
SPM0408LE5H SiSonic analog amplified surface-mount
Badge Type R1-R3 A2..A0 I2C Address
All N/A 0 (Broadcast)
Uber R1, R2, R3 000 1
Goon R1, R2 001 2
Contest R1, R3 010 3
Speaker R1 011 4
Vendor R2, R3 100 5
Press R2 101 6
Unused N/A 110 7
Human DNP 111 8
Table 1: I2C addresses of the different badge types.
MEMS microphone. Over one billion of their MEMS
microphones — mainly used in high volume consumer
products like mobile phones, laptops, digital cameras, and
headsets — have been sold since their launch in 2003. Like
D1, the package comes in a rear-mounting configuration,
so it’s mounted on the back side of the PCB, and a small
through hole is aligned with the microphone’s sound input
port. The device footprint is very small, measuring
approximately 4. 7 mm long x 3. 7 mm wide x 1.25 mm
high, and is the only part on the badge that can’t be
soldered by hand (there are no accessible pins; only solder
pads underneath the package).
The microphone features adjustable amplification
which is set with an external resistor (optional) and a
capacitor. The DEFCON 17 badge sets MK1 for its
maximum gain of 20 dB via C3. Internal amplification is
especially useful, since I avoid having to externally pre-amplify the microphone signal before passing it to the
microcontroller. The MC56F8006 does have two internal
programmable gain amplifiers that I possibly could have
used with a non-amplifying microphone, but since I was
locking in the hardware design much earlier than
completing the firmware, I didn’t want to commit to that.
MK1’s OUT pin connects directly to ANB8 of U1 — a single
12-bit A/D channel. Since the microphone requires very
little current to function (between 100 uA and 350 uA), I
used a general-purpose I/O pin, GPIOC5, connected to the
microphone’s VCC line to power the microphone directly.
This let me completely shut off power to the microphone
when it wasn’t in use, and then enable the microphone
only when the badge was awake.
DEFCON 17
badge schematic.
Complete source code,
schematics, audio, video,
BOM, and other
documentation for the
DEFCON 17 badge is
available on my website at
www.grandideastudio.com/
portfolio/defcon-17-badge/.
Additional supporting
content and graphics are
on the NV site at
www.nutsvolts.com.
Joe Grand is an electrical
engineer, hardware hacker, and
president of Grand Idea Studio,
Inc. ( www.grandideastudio
.com), where he specializes in
the invention, design, and
licensing of consumer products
and modules for electronics
hobbyists. He can be reached
at joe@grandideastudio.com.
46
July 2010