1 / 7

Acquiring Data from an ADXL335 Accelerometer

living with the lab. Acquiring Data from an ADXL335 Accelerometer. Arduino Uno microcontroller board. DIGIKEY DKSB1002A Evaluation Board 3-axis accelerometer. living with the lab. DKSB1002A Evaluation Board and ADXL335 Accelerometer.

mignon
Download Presentation

Acquiring Data from an ADXL335 Accelerometer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. living with the lab Acquiring Data from anADXL335 Accelerometer Arduino Uno microcontroller board DIGIKEY DKSB1002A Evaluation Board 3-axis accelerometer

  2. living with the lab DKSB1002A Evaluation Board and ADXL335 Accelerometer • DKSB1002A is a prototyping board purchased for $20 from Digikey • Screw holes for mounting board onto “object of interest” • Board is ~ 20mm square • ADXL335 3-axis accelerometer chip • 3-axis • ±3g this small chip is the ADXL335 accelerometer(this is an older model . . . they are even smaller now) • COM - ground • VSS - power (we will provide 5V) • X - acceleration in x-direction • Y - acceleration in y-direction • Z - acceleration in z-direction z x the DKSB1002A is a board used to evaluate the accelerometer; if you were putting an accelerometer in a device like a cell phone, you would only use the ADXL335 chip (and maybe some capacitors) y

  3. living with the lab Implementing a 3-axis Accelerometer: Wiring to Arduino • COM - ground • VSS - power (we will provide 5V) • X - acceleration in x-direction • Y - acceleration in y-direction • Z - acceleration in z-direction

  4. living with the lab Programming void setup() { Serial.begin(9600); } void loop() { intxaccel = analogRead(0); intyaccel = analogRead(1); intzaccel = analogRead(2); unsigned long timevar = millis(); Serial.print(timevar); Serial.print(" "); Serial.print(xaccel); Serial.print(" "); Serial.print(yaccel); Serial.print(" "); Serial.println(zaccel); } associates a time with each set of accelerations

  5. living with the lab Calibration z x y

  6. +x qx ax qx 1g (perceived vertical acceleration) living with the lab Angle Measurement z x y θx = asin(ax/g)

  7. living with the lab Example Application The piezospeaker below outputs a frequency that varies with the acceleration in the x-direction. The equation for computing the frequency is chosen so that the device makes an audible noise that varies when rotating or shaking the device. void setup(){Serial.begin(9600); } void loop() { intxaccel = analogRead(0); int freq = 1500+xaccel*2; tone(7,freq); Serial.print(xaccel); Serial.print(" "); Serial.println(freq); }

More Related