28017 Parallax Inc, 28017 Datasheet - Page 8

KIT DEMO ACCELEROMETER MEMSIC

28017

Manufacturer Part Number
28017
Description
KIT DEMO ACCELEROMETER MEMSIC
Manufacturer
Parallax Inc
Series
BASIC Stamp®r
Datasheet

Specifications of 28017

Sensor Type
Accelerometer, 2 Axis
Sensing Range
±2g
Interface
I²C
Sensitivity
512 counts/g
Voltage - Supply
2.7 V ~ 5.25 V
Embedded
No
Utilized Ic / Part
BASIC Stamp® or Javelin Modules
Product
Microcontroller Accessories
Flash
512 KB
Timers
10 x 8 bit
Operating Supply Voltage
5 V
Board Size
69.34 mm x 46.99 mm x 21.84 mm
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Experiment 3: Motion Detector
This experiment uses the Memsic 2125 as a movement or vibration detector. The program starts by
reading the initial state of the sensor and storing these readings as calibration values. By doing this, the
starting position of the sensor is nullified. The main loop of the program reads the sensor and compares
the current outputs to the calibration values. If the output from either axis is greater than its calibration
value the motion timer is incremented. If both fall below the thresholds motion timer is cleared. If the
motion timer exceeds its threshold, the alarm will be turned on and will stay on until the BASIC Stamp is
reset.
You can adjust the sensitivity (to motion/vibration) of the program by changing the XLimit and YLimit
constants, as well as the SampleDelay constant (should be 100 ms or greater). The AlarmLevel
constant determines how long motion/vibration must be present before triggering the alarm.
' =========================================================================
'
'
'
'
'
'
'
'
'
'
'
' =========================================================================
' -----[ Program Description ]---------------------------------------------
'
' Monitors X and Y inputs from Memsic 2125 and will trigger alarm if
' continuous motion is detected beyond the threshold period.
' -----[ I/O Definitions ]-------------------------------------------------
Xin
Yin
ResetLED
AlarmLED
' -----[ Constants ]-------------------------------------------------------
HiPulse
LoPulse
SampleDelay
AlarmLevel
XLimit
YLimit
' -----[ Variables ]-------------------------------------------------------
8
File...... MEMSIC2125-Motion.BS2
Purpose... Detects continuous motion for given period
Author.... Parallax (based on code by A. Chaturvedi of Memsic)
E-mail.... support@parallax.com
Started...
Updated... 15 JAN 2003
{$STAMP BS2}
{$PBASIC 2.5}
PIN
PIN
PIN
PIN
CON
CON
CON
CON
CON
CON
© Parallax, Inc. • Memsic 2125 Accelerometer Demo Kit (#28017) • 09/2004
8
9
10
11
1
0
500
5
5
5
' X pulse input
' Y pulse input
' reset LED
' alarm LED
' measure high-going pulse
' 0.5 sec
' 5 x SampleDelay
' x motion max
' y motion max

Related parts for 28017