The hardware list that we used:
The movement detection is done by the ADXL202AE accelerometer. Below is the pin configuration of the accelerometer:
We soldered the accelerometer on to a pcb board, and then we soldered the required capacitors and wires on it also.
T2 = Rset / 125 MW, where T2 is the period of the DCM output.
For Rset, as we are taking output from XFILT and YFILT , we have to set Rset between 500 kW to 2 MW according to the datasheet. We set it to 1 MW, which gives a T2 of 8 ms. A 1MW resistor is placed between the T2 Pin and ground to minimize parasitic capacitance at this node. For CDC, we use a single 0.10mf between Vdd and ground to decouple the accelerometer from signal and noise on the power supply according to the data sheet.
For CX and CY, we choose 0.10mf to set the bandwidth to 50Hz, which should be enough for human motion. Also, we choose analog output instead of digital output; therefore, VX and VY are XFILT and YFILT respectively.
The 2 analog outputs, XFILT and YFILT, are used for determining the 2 axes of tilt. We program the MEGA32 to perform the analog-digital conversion of the 2 analog outputs. The ADC Start Conversion bit in ADCSR is used to signal the completion of the conversion. I use pin 0 to detect x-axis voltage, and pin 1 to detect y-axis voltage; ADMUX is altered each time to change the choice of analog inputs.
With a 5V Vdd, the typical 0g bias level voltage of each axis is 2.5 V. The sensor has a workable range of –2g to 2g, while the sensitivity per g is typically 312mV, with a maximum value of 375mV. Therefore, the maximum voltage range is (1.75V,3.25V). As we designed to use the internal Vref of 2.56V for the ADC, we have to set the accelerometer output within 0V to 2.56V; and we would like to use the following setup to subtract the voltage and set the voltage within the range (0.53, 2.03)
We build a video DAC to generate three video levels for the video output; where sync level is 0V, black level is 0.3V, and white level is 1V. The DAC circuit is as follows:
We get user input from a keypad with the following configuration:
Pin 1 -- row 1 2 3 A
Pin 2 -- row 4 5 6 B
Pin 3 -- row 7 8 9 C
Pin 4 -- row * 0 # D
Pin 5 -- col 1 4 7 *
Pin 6 -- col 2 5 8 0
Pin 7 -- col 3 6 9 #
Pin 8 -- col A B C D
(a) Each switch shorts one row to one column.
(b) Each pin should be connected to one bit of an i/o port.
(c) The i/o port pins will be used both as inputs and outputs.
When they are inputs, they should have active pullup resistors.