Web Site: www.parallax.com Forums: forums.parallax.com Sales: sales@parallax.com Technical: support@parallax.com Office: (916) 624-8333 Fax: (916) 624-8003 Sales: (888) 512-1024 Tech Support: (888) 997-8267 Memsic 2125 Dual-Axis Accelerometer (#28017) The Memsic 2125 is a low-cost thermal accelerometer capable of measuring tilt, collision, static and dynamic acceleration, rotation, and vibration with a range of 3 g on two axes. Memsic provides the 2125 IC in a surface-mount format. Parallax mounts the circuit on a tiny PCB providing all I/O connections so it can easily be inserted on a breadboard or through-hole prototype area. Features Measures 3 g on each axis Simple pulse output of g-force for each axis Convenient 6-pin 0.1" spacing DIP module Analog output of temperature (TOut pin) Fully temperature compensated over 0 to 70 C operating temperature range Key Specifications Application Ideas Power Requirements: 3.3 to 5 VDC; < 5 mA supply current Communication: TTL/CMOS compatible 100 Hz PWM output signal with duty cycle proportional to acceleration Dimensions: 0.42 x 0.42 x 0.45 in (10.7 x 10.7 x 11.8 mm) Operating temperature: 32 to 158 F (0 to 70 C) Dual-axis tilt and acceleration sensing for autonomous robot navigation R/C tilt controller or autopilot Tilt-sensing Human Interface Device Motion/lack-of-motion sensor for alarm system Single-axis rotational angle and position sensing Theory of Operation The MX2125 has a chamber of gas with a heating element in the center and four temperature sensors around its edge. When the accelerometer is level, the hot gas pocket rises to the top-center of the chamber, and all the sensors will measure the same temperature. By tilting the accelerometer, the hot gas will collect closer to some of temperature sensors. By comparing the sensor temperatures, both static acceleration (gravity and tilt) and dynamic acceleration (like taking a ride in a car) can be detected. The MX2125 converts the temperature measurements into signals (pulse durations) that are easy for microcontrollers to measure and decipher. Copyright (c) Parallax Inc. Memsic 2125 Dual-Axis Accelerometer (#28017) v2.1 9/28/2012 Page 1 of 3 Pin Definitions For Memsic MXD2125GL pin ratings, see the manufacturer's datasheet posted on the 28017 product page at www.parallax.com. Pin Name 1 2 3 4 5 6 Tout Yout GND GND Xout VDD Function Temperature Out Y-axis PWM output Ground -> 0 V Ground -> 0 V X-axis PWM output Input voltage: +3.3 to +5 VDC Communication Protocol Each axis has a 100 Hz PWM duty cycle output in which acceleration is proportional to the ratio tHx/Tx. In practice, we have found that Tx is consistent so reliable results can be achieved by measuring only the duration of tHx. This is easy to accomplish with the BASIC Stamp PULSIN command or with the Propeller chip's counter modules. With Vdd = 5V, 50% duty cycle corresponds to 0 g, but this will vary with each individual unit within a range of 48.7% to 51.3%. This zero offset may be different when using Vdd = 3.3 V. See the manufacturer's datasheet for details. Example Circuit The example schematic and wiring diagram below are for the BASIC Stamp and Board of Education. The program below, SimpleTilt.bs2, simply measures the pulse width, that is, the duration of tHx, for each axis. The raw values are displayed in the BASIC Stamp Editor's Debug Terminal. If you run the program, then tilt the accelerometer, you should see the values for each axis change. Copyright (c) Parallax Inc. Memsic 2125 Dual-Axis Accelerometer (#28017) v2.1 9/28/2012 Page 2 of 3 ' Smart Sensors and Applications - SimpleTilt.bs2 ' Measure room temperature tilt. '{$STAMP BS2} '{$PBASIC 2.5} x y VAR VAR Word Word DEBUG CLS DO PULSIN 6, 1, x PULSIN 7, 1, y DEBUG HOME, DEC4 ? X, DEC4 ? Y PAUSE 100 LOOP Programming Resources and Downloads BASIC Stamp Stamps in Class Mini Projects -- The BASIC Stamp example above is taken from the Stamps in Class Mini Projects, which feature many topics specifically for the Dual-Axis Accelerometer. Some are for the Board of Education or BASIC Stamp HomeWork Board alone; while others use a Boe-Bot Robot or SumoBot. Look for the Stamps in Class Mini Projects sticky-thread in the Education forum at forums.parallax.com. Also, look for more projects at learn.parallax.com. The Memsic 2125 Demo Kit BASIC Stamp Source Code -- this source code contains conditional compile directives that allow it to be used with the BS2, BS2e, BS2sx, BS2p, and BS2pe. Look for this on the 28017 product page at www.parallax.com. Propeller Objects Several Memsic 2125 Accelerometer code objects and applications for the Propeller chip are available in the Propeller Object Exchange (http://obex.parallax.com). Below is a photograph of the high-speed Memsic MXD2125 Accelerometer Demo in action. This application "provides a high speed assembly driver, and separate-cog and same-cog Spin versions of the MXD2125 Dual Axis Accelerometer. The high speed version displays the data on a television as a 3D wireframe plane with normal vector. Other Microcontrollers Check for links to Memsic 2-axis Accelerometer demo code for the Arduino and other microcontrollers and languages in the Resources section of the 28017 product page at www.parallax.com. Copyright (c) Parallax Inc. Memsic 2125 Dual-Axis Accelerometer (#28017) v2.1 9/28/2012 Page 3 of 3 Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Parallax: 28017