# Scan I2C register of MPU6000 module through node red

**URL:** <https://discourse.nodered.org/t/scan-i2c-register-of-mpu6000-module-through-node-red/7661>\
**Category:** General\
**Created:** [6 February 2019 13:50 UTC](https://discourse.nodered.org/t/scan-i2c-register-of-mpu6000-module-through-node-red/7661 "2019-02-06T13:50:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fredy76](https://avatars.discourse-cdn.com/v4/letter/f/ce73a5/32.png) [@fredy76](https://discourse.nodered.org/u/fredy76)\
**Post date:** [6 February 2019 13:50 UTC](https://discourse.nodered.org/t/scan-i2c-register-of-mpu6000-module-through-node-red/7661/1 "2019-02-06T13:50:30Z")

</div>

I have Mpu6000 which is connected to [I2C shield](https://store.ncd.io/product/i2c-shield-for-raspberry-pi-3-pi2-with-outward-facing-i2c-port-terminates-over-hdmi-port/) mounted on Raspberry Pi 3 B+.  
I have installed the node-red and I2C node in raspberry pi, but to scan the I2C data, do I have to write the code or is there any other way to scan I2C register?

Like In Raspberry Pi command shell I am using the cmd - 'i2cdetect -y 1'

I just start with this node still not able to find anything useful

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [6 February 2019 14:24 UTC](https://discourse.nodered.org/t/scan-i2c-register-of-mpu6000-module-through-node-red/7661/2 "2019-02-06T14:24:37Z")

</div>

You have to set the device address, the command to get the data you want and set the number of bytes that will be returned in the I2C node. The node will return a buffer that you have to extract the data from. Show us a little more of what you are trying to do.  
i2cdetect -y 1 will only give you the address of the device.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 February 2019 14:44 UTC](https://discourse.nodered.org/t/scan-i2c-register-of-mpu6000-module-through-node-red/7661/3 "2019-02-06T14:44:25Z")

</div>

If you really do want to scan it from within node-red, which seems an odd thing to do, you can execute the detect command using an Exec node.

---

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [23 August 2020 19:26 UTC](https://discourse.nodered.org/t/scan-i2c-register-of-mpu6000-module-through-node-red/7661/4 "2020-08-23T19:26:49Z")

</div>

Just a footnote... Just this morning I hit a case of i2c scan failing to see a device on the i2c bus, that i2cdetect -y 1 found just fine. I even tested the sensor via python3 just fine as well. It was a HTUD21 sensor at address 0x40. The i2c scan node reported and empty array of devices on output 1, and absolutely nothing came out of output 2 when the issue occurred I swapped in a BME280, and i2c scan node worked fine. So it might be an issue specific to only some sensors? I tested with BMP280, BME, MCP9808, etc., no issues. But i2c scan still can't seem to see an HTU21D or SI7021 sensors, at least on my setup that is. They use the same command set, so the same python3 script can read either, interesting that the i2c scan node fails to see either of them so something about the address being 0x40 or that they have the same command set maybe part of the issue?
