Hardware Design
Overview
Our hardware setup consists of a prototype board that hosts
the MCU and three other individual function panels. Audio
input is processed through the amplifier panel and sampled by
the MCU. The RS232 board allows the state of the MCU and user
input to be sent to the PuTTY. The last function panel allows
user to change the current operating mode of the MCU and
enables the audio input to be sampled or discarded in the
main program.
ECE 4760 Custom PCB
The prototype board we used is the mega644 prototype board
design by Bruce Land. The printed PCB layout is shown below.
The only port pins used (soldered) are C0,C1,C7 and A0. We also
had to solder RX and TX pins to enable RS232 serial communication.
Audio Amplifier Circuit Panel
The amplifier circuit used is shown below. The microphone used
in this project uses a charged capacitor to detect vibrations in
air. As a result, R2 provides the DC bias necessary to maintain
the charge across the internal capacitor of the microphone to
allow sounds to be converted to electrical energy. R1 provides
the DC bias that the microphone needs to remain functional. The
LM358 op amp operates as a 2 stage signal filter. The negative
voltage input of the op amp is first passed through a low pass
filter with a time constant of approximately 42microSec. This is the
upper bound of our audio signal filter since normal human speech
lies between 85Hz to 3kHz. The value of the parallel
resistor/capacitor feedback circuit is determined by the gain
we wanted to achieve. In our case, we chose the amplifier gain
to be 100, thus the value of R4 we chose is 1M Ohms (100 times
R3) and C2 is chosen to compliment the operating frequency of
less than 3kHz. The output of the op amp is fed to the analog
compare input of the MCU (PINA.0) and analyzed at a rate of
7.8kHz.
RS232 Serial Communciation Panel
To better user experience with our design, we decided to use
serial communication via PuTTY to inform the user of the current
operating state of the program. We also felt that it would be a
lot more convenient if the user could control the program via
both hardware as well as software. To enable serial communication
between the MCU and a PC, we used the Max233CPP level shifter
chip and the RS232 connector PCB Bruce had designed. The transmit
and receive pins on the MCU prototype board are connected to the
TR and RC pins on the RS232 board to enable communication.
Hardware User Interface (Control Buttons)
Our hardware user interface consists of 3 buttons and 3
indication lights. When a button is held down, the corresponding
LED will turn on. In our setup, pressing the green LED/button
combination displays the results summary on the PuTTY screen.
Pressing the yellow LED/button combination begins the sampling
the MCU. Analysis on the input data is performed when this button
is released (see code below for details). Each button is signaled
by a pin in PORTC. The red LED/button combination allows the
user to change the operating mode of the program between testing
mode and decoding mode. The switch/LED circuitry for 1 button is
shown to the right. When the button is pulled low (i.e. pressed)
the LED is connected to ground via a 1k resistor and lights up.