# Accelerometer and gyroscope

**URL:** <https://forum.xod.io/t/accelerometer-and-gyroscope/3087>\
**Category:** Uncategorized\
**Created:** [December 18, 2019, 9:11pm UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087 "2019-12-18T21:11:19Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [December 18, 2019, 9:11pm UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/1 "2019-12-18T21:11:19Z")

</div>

does anyone know if this module works with xod and how do i make it when it tilts to say 30 degrees to light my LED for example …

 ![k1](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/8/8dfb37ca0ec7c7caab244fcc7216d56146460780.jpeg) ![k2](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/8/87857549b37c8ea107a8d503ec92c242b68b67b8.jpeg)

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [December 18, 2019, 9:36pm UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/2 "2019-12-18T21:36:32Z")

</div>

The board uses I2C communication, so it will work with XOD. The only question is how easy it will be to use. One of the built-in accelerometer nodes might work if this board returns the same data as one of the existing devices. If not, the existing nodes could be used as a template for building one that works with this hardware. There is also a library for another type of accelerometer, but it is only 2-axis.

Once you have a node that returns tilt information, turning on an LED is just a matter of using greater or less node to determine when you have tilted far enough to turn it on.

---

<div class="post-metadata">

**Author:** ![robertspark](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@robertspark](https://forum.xod.io/u/robertspark)\
**Post date:** [December 19, 2019, 6:35am UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/3 "2019-12-19T06:35:33Z")

</div>

Gy-521 is an mpu-6050

You can try this library… I think there is another for the mpu6050 but I cannot find it

[https://xod.io/libs/yzheka-m/mpu-9250/](https://xod.io/libs/yzheka-m/mpu-9250/)

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [December 19, 2019, 7:32am UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/4 "2019-12-19T07:32:42Z")

</div>

ok, I’ll try … do I only connect 5v, GND, SCL and SDA? or something else?

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [December 19, 2019, 7:33am UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/5 "2019-12-19T07:33:52Z")

</div>

is there any specific example of connecting and working with xod for that module or something?

---

<div class="post-metadata">

**Author:** ![robertspark](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@robertspark](https://forum.xod.io/u/robertspark)\
**Post date:** [December 19, 2019, 7:56am UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/6 "2019-12-19T07:56:24Z")

</div>

AHH here it is

> [@Library for Mpu 6050 (gy-521)](https://forum.xod.io/t/library-for-mpu-6050-gy-521/1177):
>
> Hello, can I use some node for mpu6050 (board gy521)? I try to use this [https://xod.io/libs/gabbapeople/mbot-lib/](https://xod.io/libs/gabbapeople/mbot-lib/) , but it doesn’t work. I can’t find and do this step : “To add an Arduino library open the place where XOD is installed and copy the library folder to packages/xod-client-electron folder.” I think, now i have library (via gabbapeople/mbot-lib ) in my XOD, but I can’t upload it upload to arduino, there is some error. Can you help my please? I will by very glad. Thx

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [December 20, 2019, 7:52am UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/7 "2019-12-20T07:52:58Z")

</div>

does the accelerometer / gyroscope measure only acceleration or constant speed?

---

<div class="post-metadata">

**Author:** ![robertspark](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@robertspark](https://forum.xod.io/u/robertspark)\
**Post date:** [December 20, 2019, 10:22am UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/8 "2019-12-20T10:22:53Z")

</div>

It does not measure **linear speed** if that is what you are asking

**Gyroscopes** , or gyros, are devices that measure or maintain **rotational** motion. MEMS (microelectromechanical system) gyros are small, inexpensive sensors that measure **angular velocity**. The units of **angular velocity** are measured in degrees per second (°/s) or revolutions per second (RPS).

**Accelerometer**. An **accelerometer** is a device that measures proper acceleration. Proper acceleration, being the acceleration (or rate of **change** of **velocity** ) of a body in its own instantaneous rest frame, is not the same as coordinate acceleration, being the acceleration in a fixed coordinate system.

An accelerometer makes a gyroscope more accurate in its reading… but the reading is **angular velocity** not linear velocity

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [December 20, 2019, 12:24pm UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/9 "2019-12-20T12:24:49Z")

</div>

ok, thanks a lot for the explanation.

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [December 20, 2019, 12:27pm UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/10 "2019-12-20T12:27:03Z")

</div>

then what i need is probably some gps module to read my speed for arduino …

---

<div class="post-metadata">

**Author:** ![robertspark](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@robertspark](https://forum.xod.io/u/robertspark)\
**Post date:** [December 20, 2019, 2:54pm UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/11 "2019-12-20T14:54:50Z")

</div>

Or a wheel speed sensor input… (Motor speed, pulse etc) GPS does not always work

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [December 21, 2019, 9:50pm UTC](https://forum.xod.io/t/accelerometer-and-gyroscope/3087/12 "2019-12-21T21:50:36Z")

</div>

ok i understand, thank you all
