2 Axis Accelerometer

As a tilt sensor, the Memsic 2125 detects when the module is not level. The output of the sensor indicates the amount of inclination. As a acceleration or vibration sensor, the sensor measures the g-forces acting on it. The greater the g-force, the higher the acceleration or vibration.

For use in Embrio, the measured g-forces are transformed to the range of -1 to 1. The measured range for the input pulses was 3800 to 6280 microseconds. If your hardware results in different measurements, change the values in the Every Update code block.

To use this pre-made group of nodes, create a new Agent called Accelerometer and leave it at the default 32 refresh rate. This group contains 4 nodes; a custom Arduino node that reads and process the connected pins, a lag setting, and two lag nodes to smooth out the activation values. The lagged values are exposed for access by other agents in the project, you should not add more nodes to this agent unless they are specifically related to encapsulating the sensor.

Note that the custom Arduino node alternates between reading the two pins, so each pin is read 16 times per second on a refresh rate of 32. This is done because doing two pulseIn calls in a row without a delay between them causes problems.

Supported Products

  • Memsic 2125 Dual-axis Accelerometer

No required source files.

To use this node in your Embrio project, either add it from the Library toolbar or copy the XML in the below box and paste it into a node screen.

View Comments (0)