Top Banner
DIGIKEY DKSB1002A 3-axis accelerometer Arduino Uno microcontroller board Parallax USB Oscilloscope measure voltage vs. time Acquiring Data from Accelerometers living with the lab http://www.analog.com/static/imported-files/data_sheets/ ADXL335.pdf data sheet for accelerometer is available at . . .
7

DIGIKEY DKSB1002A 3-axis accelerometer Arduino Uno microcontroller board Parallax USB Oscilloscope measure voltage vs. time Acquiring Data from Accelerometers.

Dec 23, 2015

Download

Documents

Lawrence Wade
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DIGIKEY DKSB1002A 3-axis accelerometer Arduino Uno microcontroller board Parallax USB Oscilloscope measure voltage vs. time Acquiring Data from Accelerometers.

DIGIKEY DKSB1002A3-axis accelerometer

Arduino Unomicrocontroller board

Parallax USB Oscilloscopemeasure voltage vs. time

Acquiring Data from Accelerometers

living with the lab

http://www.analog.com/static/imported-files/data_sheets/ADXL335.pdf

data sheet for accelerometer is available at . . .

Page 2: DIGIKEY DKSB1002A 3-axis accelerometer Arduino Uno microcontroller board Parallax USB Oscilloscope measure voltage vs. time Acquiring Data from Accelerometers.

• DKSB1002A is a prototyping board • $20 from www.digikey.com • Screw holes for mounting board onto “object of interest”• Board is ~ 20mm square• ADXL3355 3-axis accelerometer chip

• 3-axis• ±3g

• COM - ground• VSS - power (we will provide 5V)• X - acceleration in x-direction• Y - acceleration in y-

direction• Z - acceleration in z-direction

Implementing a 3-axis Accelerometer: Hardware

xy

z

living with the lab

Page 3: DIGIKEY DKSB1002A 3-axis accelerometer Arduino Uno microcontroller board Parallax USB Oscilloscope measure voltage vs. time Acquiring Data from Accelerometers.

COM - groundVSS - power (we will provide 5V)X - acceleration in x-directionY - acceleration in y-directionZ - acceleration in z-direction

Implementing a 3-axis Accelerometer: Wiring to Arduino

living with the lab

Page 4: DIGIKEY DKSB1002A 3-axis accelerometer Arduino Uno microcontroller board Parallax USB Oscilloscope measure voltage vs. time Acquiring Data from Accelerometers.

void setup(){ Serial.begin(9600);}

void loop(){ int xaccel = analogRead(0); int yaccel = analogRead(1); int zaccel = analogRead(2); Serial.print(xaccel); Serial.print(" "); Serial.print(yaccel); Serial.print(" "); Serial.println(zaccel);}

Implementing a 3-axis Accelerometer: Programming

living with the lab

Page 5: DIGIKEY DKSB1002A 3-axis accelerometer Arduino Uno microcontroller board Parallax USB Oscilloscope measure voltage vs. time Acquiring Data from Accelerometers.

Implementing a 3-axis Accelerometer: Analysis of Output

• Output from accelerometer will vary from 0 to 5 V• Output when +x points upward: __________• Output when +x points downward: __________• Difference: _______• Change in acceleration = 2g • Change in accelerometer per g: ___________• Output when accelerometer is flat: _________

xy

z

living with the lab

Page 6: DIGIKEY DKSB1002A 3-axis accelerometer Arduino Uno microcontroller board Parallax USB Oscilloscope measure voltage vs. time Acquiring Data from Accelerometers.

Implementing a 3-axis Accelerometer: Angle Measurement

xy

z

1g (perceived vertical acceleration)

ax

x

x

+x

θx = asin(ax/g)

• Expected output of Arduino when accelerometer is flat: _________• Expected output of Arduino when accelerometer is at 45 degrees? ________• If the Arduino output is 350, then what is the angle? ___________

living with the lab

Page 7: DIGIKEY DKSB1002A 3-axis accelerometer Arduino Uno microcontroller board Parallax USB Oscilloscope measure voltage vs. time Acquiring Data from Accelerometers.

living with the lab

Measuring Output of Accelerometer with Parallax Scope

• Attach channel 1 leads between x-acceleration signal and ground• Oscilloscope plots voltage vs. time• Export data to a file to acquire voltage (or acceleration) vs. time data• Example of how a switch circuit is used to trigger data acquisition 10k

5V

switch

trigger input