# Characterize The Performance Of The Accelerometer Biology Essay

A development system, Widget # 387, is designed and built in order to qualify the public presentation of the accelerometer ADXL322 and the extra hardware and package necessary to back up the accelerometer. The design will be prototyped and demonstrated in 3 stages. This papers describes Phase III of the paradigm doodad. The followers is an overview Phase III block diagram:

## Figure

Overview of Entire Widget circuit & A ; Personal computer interface

The end products X and Y of the accelerometer are sent through signal conditioning to acquire the full graduated table electromotive force scope of the microcontroller. The electromotive force tracks of the accelerometer were between 0.1 and 3.2 Vs after signal conditioning as shown in Figure-1. The codification implemented, synchronized the hardware and the package of the microcontroller such that it works as an ADC. The microprocessor shall run in two manners: manual and rhythm manner. Three switches must be used. One switch to choose the manner, manual or cycling and another switch is to choose the channel from which the signal it is to be sampled ( either ‘x ‘ or ‘y ‘ ) . A 3rd switch, new for Phase III, selects whether to try or convey informations. The microprocessor will put up the A/D to try at a rate of 4.5 times or more than the maximal bandwidth of each accelerometer axis. The trying rate of our microprocessor is 774Hz. The microprocessor will hive away 0.5 seconds of informations in memory, and instantly convey the informations to Matlab one time all the information has been collected. When the control input = 1 the microprocessor sends the stored sampled informations to the Matlab and the Matlab will give the needed secret plans as discussed in the consequences subdivision. Test circuits are maintained, for a fast debug in instance of failure of any of the different constituents of the system.

Phase III Requirements: Discussion of demands matrix

As shown in the demands matrix in Appendix A, there are several demands to carry through Phase III. “ Shall # 1 ” provinces that the informations will be serially transmitted to the Personal computer with 9600 baud rate. “ Shall # 2 ” requires that the overall doodad operate within a 4 % mistake border. In order to make so, the signal status has to be checked every bit good as the trying rate. Besides, 0.5 second of informations will be captured and stored in memory. A switch will be used to choose whether to try or to convey informations. The microprocessor shall run between two manners, rhythm and manual ( shall # 3 ) . In manual manner, there shall be sinusoid confirmation so that MATLAB plots the input sinusoid on a individual axis. Besides, the tilt experiment shall be done in manual manner where at a given Vref the board will be tilted to a specific angle and Matlab will auto-calculate the angle at which the LED will illume up. In rhythm manner, similar sinusoid confirmation shall be included except the X and Y values have to be parsed and so reconstructed to organize the sinusoid on MATLAB. The inertial acceleration experiment besides shall be done in rhythm manner. As shown in the demands matrix, the distance traveled across a sheet and a half of paper should be derived from the acceleration secret plans. Another cardinal demand is the auto-detect ( shall # 4 ) . The microprocessor shall merely try when greater than +/- 10 grades when making the tilt experiment. Likewise, for the inertial acceleration experiment, the microprocessor shall try merely when the sample electromotive force goes over the threshold decided by the applied scientist. The auto-detect characteristic should be off when the input is a sinusoid. The concluding demand ( shall # 5 ) trades with the MATLAB interface. MATLAB should have consecutive informations from the accelerometer, clip and frequence secret plans should be automatically plotted, the concluding resting angle should be automatically determined during tilt measuring, and the acceleration, speed, and distance secret plans should be automatically plotted during the inertial acceleration measuring.

## Microprocessor

Micro-code Flow Chart

Figure 2a below shows the flow chart of the microprocessor codification. The microprocessor selects whether to run in manual or rhythm manner foremost. If manual manner is chosen, the axis so has to be selected. Then, it selects to try informations or to convey informations to MATLAB. If trying information is chosen, the accelerometer has to be +/- 10 grades. To carry through this, the informations sampled is compared to the binary value at the electromotive force. The codification subdivisions to hive away the informations into port B registries and memory. The codification so branches back to the chief cringle. However, if transmit information is chosen, informations will be pulled from memory and transmitted to MATLAB. The inertial acceleration experiment was non finished on clip. However, it should be implemented the same manner as the tilt experiment by puting a threshold for a small force on the accelerometer. The higher the push will take to a higher electromotive force, so if the informations sampled from the push is higher than the threshold, the informations will get down acquiring captured.

Manual ( 0 ) or Cycle ( 1 ) Manner

0

Ten ( 0 ) or Y ( 1 ) axis

1 0

Sample ( 0 ) or Transmit ( 1 )

0 1

Sample ( 0 ) or Transmit ( 1 )

Compare if higher than1.8 V ( +10° )

( +10° )

Transmit to MATLAB

Compare if lower than 1.5 V ( -10° )

Delay

Shop Ten

Compare if higher than1.8 V ( +10° )

0 0

1 0

1

Transmit to MATLAB

Compare if lower than 1.5 V ( -10° )

1 0

1

0 1

Delay

Shop Ten

Delay

Shop Yttrium

1

1

Sample ( 0 ) or Transmit ( 1 )

Compare if higher than1.8 V ( +10° )

Transmit to MATLAB

Compare if lower than 1.5 V ( -10° )

Delay

Shop Ten

0

0

1

1 0

1

## Figure 2a – Micro-code flow chart

Multiplexing and Sampling Theory & A ; Impact of Memory Restrictions

In Phase III, it is required that the A/D sample both the Ten and the Y axes continuously so that both sinusoids can accurately be reconstructed. In order to accomplish this, there are a twosome of constructs. In order to choose which axis to try, a multiplexer is needed to take either the Ten or the Y axis. To find its frequence at the end product of the MUX, Nyquist rate demands to be considered. Harmonizing to Nyquist, the Nyquist rate should be twice the highest input frequence to avoid aliasing. Consecutive estimate of the A/D multiplies the Nyquist rate by 64 clock rhythms. Since the A/D gives eight digital informations end products, the clock of the registry needs a hold to split the clock by 16. Figure 6a shows this state of affairs.

0

1

D Q

## & gt ;

50 Hz

A/D

200 Hz 8

50 Hz

Clk ( Fo x 2 ten 64 ) Clk/16

## Figure 2b – Mux to choose which axis to try

200 Hz

In Figure 2b, since the modification factor is 50 Hz, the Nyquist rate is 100 Hz. However, the switch has two inputs so the mux exchanging rate is two times the Nyquist rate. This makes the mux shift rate 200 Hz. For Phase III, the two inputs to the MUX are the X and Y axis. The bandwidths for both axes are 50 Hz. The trying rate must be between 4.5x the Nyquist rate which makes it between 450 and 900 Hz.

The microprocessor accomplishes trying by taking a sample every rhythm of the coach clock. Therefore because of memory limitations, to put the sampling rate for the microprocessor, a hold needs to be added every rhythm. This hold can be achieved though the construct of decimation. Figure 6b shows the construct of decimation.

SEL 1 0 1 0 1 0 1 0

## Figure 2c – Decimation diagram

0.625 ms 0.3125 MS

Using the hold cringle from [ 2 ] programmed in the assembly linguistic communication by reiterating a NOP cringle of 24 rhythms ‘N ‘ sum of times. The N chosen was 497 loops. This led to an existent sampling rate of about 774 Hz.

## Data Collection and Results

MATLAB interface to widget

For Phase III, one of the chief aims is to let consecutive transmittal between the microprocessor and the Personal computer ( MATLAB ) . When the microprocessor samples informations from the input, a consecutive 8 spots is returned in the collector. This information is so stored in memory for 0.5 seconds. When ready, the microprocessor appends a start spot to the informations byte along with a para spot even and a stop spot as shown in figure 3a.

Start bit 8 information spots para bit stop spot

## Figure 3a – Consecutive transmittal timing diagram

The transmittal was foremost tested on HyperTerm. The microprocessor waits for a button to be pressed on the keyboard. When the microprocessor receives the bid, informations will be transmitted back to the Personal computer and displayed on the proctor. When the transmittal through HyperTerm was confirmed, transmittal to MATLAB was tested. When the microprocessor transmits informations to MATLAB, the informations will be stored in an array in double star. In this instance, the input is a 50 Hz sinusoid with 3.1V extremum to top out and 1.65V beginning. The information sampled will be converted by multiplying the binary value by 3.3V and spliting it by 255. This will alter the array to the existent electromotive force values. The array is so plotted against clip for ‘N ‘ samples. The sum of samples taken was 38. When plotted in MATLAB, two rhythms of the sinusoid are auto-plotted which confirms that consecutive transmittal between the microprocessor and MATLAB succeeded.

Joust

One of the demands as shown in the “ Test Procedure ” papers is the tilt experiment. A comparator and LED are used to compare the Vref to the DAC end product so that when the accelerometer is tilted to an angle that is equal to the Vref, the LED will illume up. However, another demand is that the microprocessor should get down trying when the board is over +/- 10 degree angle. To accomplish this, a twosome of values need to be known: the electromotive force end product of the accelerometer at +10 and -10 grades. The electromotive forces were measured to be about 1.8V and 1.5V severally. As shown in the trial process, the informations sampled is compared to the binary value of these electromotive forces. If it is higher than 1.8V or lower than 1.5V, the informations will be sampled. This manner, since merely 0.5 second of informations is captured, the information will merely be sampled when the tilt measuring demands to be conducted. The manner of the values will so be taken utilizing MATLAB bid manner ( ) since it will most probably be the value of the angle that the LED will illume up. The angle will so be calculated utilizing equations from Phase I and II.

The following tabular array shows the Vref and its corresponding angle:

Angle

Vref ( Air Combat Command )

Vref ( DAC )

Angle ( MATLAB )

-22.5

1.47V

2.03V

-21.4

-45

1.32V

1.63V

-43.2

-67.5

1.22V

1.37V

-64.3

22.5

1.83V

2.89V

22

45

1.98V

3.36V

43.2

67.5

2.08V

3.63V

65.9

## Table 3b – Vref for demo angles

The center left column is the end product electromotive force from the accelerometer from either the Ten or the Y axis since the scope is about the same. The in-between right column is the electromotive force needed after the signal conditioning which set equal to the mention electromotive force needed by the power supply so that the comparator will put the LED on. This is done by multiplying the electromotive force from the accelerometer by the addition and switching it by the beginning. Given an angle, the mention electromotive force of the comparator is set by the power supply so that when the bread board is tilted to the angle, the LED should be on. The MATLAB consequences were close to what the angles were expected to be.

Due to problem with consecutive transmittal in manual manner ( HW9 ) , the inertial acceleration experiment was non completed on clip.

HW10 and theory & A ; graphical analysis to find distance from angle

The end of HW 10 is to plot a sinusoid from rhythm manner by parsing the Ten and Y values into two separate vectors. Data will be stored for 0.5 2nd as in manual manner. Since Ten will be sampled foremost and so Y, all uneven samples will be Ten values and the even samples will be the Y values. With this in head, X and Y values are parsed into two separate vectors by taking merely the uneven figure samples for Ten and merely the even figure samples for Y. X will so be plotted as in manual manner which will ensue in a reconstructed sinusoid for two rhythms. When plotting the DFT of the sinusoid, 7.111 rhythms are used to find the figure of samples. The figure of samples can be found by spliting the trying rate by the input rate and so multiplying it by the figure of clock rhythms. This leads to a consequence of ( 774 Hz * 7.111 rhythms ) /50 Hz which equals to about 110 samples. Figure 3c shows the reconstructed sinusoid.

## Figure 3c – Reconstructed Sinusoid Plotted in MATLAB

The intent of the inertial acceleration experiment is to find distance traveled due to the acceleration. When the accelerometer is set on a bench with both the Ten and Y axes parallel to the Earth ‘s surface, the construct of inertial acceleration can be tested. When the accelerometer is pushed across the bench the aforethought graph with regard to clip shows a sinusoid since acceleration additions and so decreases as the board comes to rest. To derive speed from this, the integral of the sinusoid is taken. One manner to make this is to utilize Riemann amounts to cipher the country under the curve of the acceleration secret plan. Using trapezoidal method would be more accurate in which trapezoids are used to come close the country under the curve. To happen distance, the integral of the speed with regard to clip is taken. The graphs below show an illustration of this:

a ( T ) V ( T )

T T

( vitamin D ) ( vitamin E )

vitamin D ( T )

T

( degree Fahrenheit )

Figure 3 vitamin D, vitamin E, f – Acceleration, Velocity, and Distance secret plan severally

Since the acceleration is a sine moving ridge, its built-in is -cos ( x ) + C. The integral of that is -sin ( x ) + Cx which is shown in the graph above. If the inertial acceleration experiment was completed, the consequence would look similar to the consequences shown above in figures 3d-f.

## Decision

In Phase III, MATLAB interface with the doodad was accomplished. Almost all demands were met except for inertial acceleration. The doodad was a great experience to work with and introduced many constructs. The doodad consisting of an accelerometer, signal conditioning circuit, microprocessor/ADC, DAC, and comparator gave an chance to look at these electronics more in item. We learned about how utile trial circuits are as they can assist debug jobs more easy. Besides, a batch about tilt measuring and comparator were learned and even though we were non able to finish the inertial acceleration experiment, we had learned a batch on finding distance traveled from acceleration through research. Lessons about consecutive transmittal were besides learned and a basic UART was implemented. Knowledge of informations transmittal will be really helpful in a calling with signal processing. The accelerometer has been to the full characterized and we can see that the accelerometer is a really utile tool utilizing tilt and inertial acceleration constructs and is no admiration why they are used in many current engineerings such as touch phones and the Wii. However, the most of import lessons learned from the doodad are its many constituents that will decidedly turn out utile in future work and even in future callings.