user54650: I want to connect 3 MPU9250 sensors, but since there is just one I2C bus, so there are another 2 sensors I want to connect through SPI.
Library used - https://github.com/bolderflight/MPU9250/blob/master/examples/Basic_SPI/Basic_SPI.ino
There is an SPI example code written, but I don't know about the connections. There are no MISO and other pins on the sensor which i use but its SPI compatible. How do I connect 2 MPU9250 to NodeMCU with SPI?
If SPI connection is not possible then please post about I2C slave connection.


user31105: To connect multiple SPI components, you only need 4 pins on each 'slave' (thus sensors): SLCK, MOSI, MISO and SS (Slave Select).
The Slave select pin depends to which the master (NodeMCU in your case) is 'talking too'. So on your NodeMCU you will have 3 SS pins (one for each slave sensor). The NodeMCU should talk exactly to one slave device at the same time by setting that SS pin LOW (while the other SS pins are high).
See for the full article: Multiple-SPI-devices-to-an-arduino-microcontroller.


user56153: The MPU-9250 pins should be connected as:
--Vcc: this should be a 2.4V to 3.6V power source.
--GND: ground.
--FSYNC: not used, should be grounded.
--SDA / SDI: connect to MOSI.
--SCL / SCLK: connect to SCK.
--AD0 / SDO: connect to MISO.
--nCS: connect to chip select pin (Any digital pin but in your example is PIN 10).
Also, you can check the connection from:
https://learn.sparkfun.com/tutorials/mpu-9250-hookup-guide?_ga=1.139382715.926858641.1470020364

user63264: If you want to use SPI-
The homepage of the library you mentioned, clearly explains the circuit connections.-
The MPU-9250 pins should be connected as:

VDD: this should be a 2.4V to 3.6V power source.
GND: ground.
VDDI: digital I/O supply voltage. This should be between 1.71V and
VDD.
FSYNC: not used, should be grounded.
INT: (optional) used for the interrupt output setup in
enableDataReadyInterrupt and enableWakeOnMotion. Connect to
interruptable pin on microcontroller.
SDA / SDI: connect to MOSI.
SCL / SCLK: connect to SCK.
AD0 / SDO: connect to MISO.
nCS: connect to chip select pin. Pin 10 was used in the code snippets
in this document  and the included examples, but any digital I/O pin
can be used.
AUXDA: not used.
AUXCL: not used.

Each sensor's nCS (chip select pin) needs to be connected to a slave select pin (any digital pin) on the NodeMCU. This allows the NodeMCU toselect which sensor it wants to talk to.
Another easy way of connecting multiple sensors with the same I2C address is by using an I2C multiplexer like the Adafruit TCA9548A

This would allow you to connect up to 8 sensors having the same I2C address. Here's a youtube video explaining how to do so.
However, if you just want connect two MPU9250s, you dont need to do any of this, as the board offers two unique addresses via the AD0 pin-

0x68 if AD0 is grounded
0x69 if AD0 is pulled high


54650: <p>I want to connect 3 MPU9250 sensors, but since there is just one I2C bus, so there are another 2 sensors I want to connect through SPI.</p>

<p>Library used - <a href="https://github.com/bolderflight/MPU9250/blob/master/examples/Basic_SPI/Basic_SPI.ino" rel="nofollow noreferrer">https://github.com/bolderflight/MPU9250/blob/master/examples/Basic_SPI/Basic_SPI.ino</a></p>

<p>There is an SPI example code written, but I don't know about the connections. There are no MISO and other pins on the sensor which i use but its SPI compatible. How do I connect 2 MPU9250 to NodeMCU with SPI?</p>

<p>If SPI connection is not possible then please post about I2C slave connection.</p>

<p><a href="https://i.stack.imgur.com/oOU7I.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oOU7I.jpg" alt="enter image description here"></a></p>
 31105: <p>To connect multiple SPI components, you only need 4 pins on each 'slave' (thus sensors): SLCK, MOSI, MISO and SS (Slave Select).</p>

<p>The Slave select pin depends to which the master (NodeMCU in your case) is 'talking too'. So on your NodeMCU you will have 3 SS pins (one for each slave sensor). The NodeMCU should talk exactly to one slave device at the same time by setting that SS pin LOW (while the other SS pins are high).</p>

<p>See for the full article: <a href="http://www.learningaboutelectronics.com/Articles/Multiple-SPI-devices-to-an-arduino-microcontroller.php" rel="nofollow noreferrer">Multiple-SPI-devices-to-an-arduino-microcontroller</a>.</p>

<p><a href="https://i.stack.imgur.com/7YtWd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7YtWd.png" alt="enter image description here"></a></p>
 56153: <p>The MPU-9250 pins should be connected as:</p>

<p>--Vcc: this should be a 2.4V to 3.6V power source.</p>

<p>--GND: ground.</p>

<p>--FSYNC: not used, should be grounded.</p>

<p>--SDA / SDI: connect to MOSI.</p>

<p>--SCL / SCLK: connect to SCK.</p>

<p>--AD0 / SDO: connect to MISO.</p>

<p>--nCS: connect to chip select pin (Any digital pin but in your example is PIN 10).</p>

<p>Also, you can check the connection from:</p>

<p><a href="https://learn.sparkfun.com/tutorials/mpu-9250-hookup-guide?_ga=1.139382715.926858641.1470020364" rel="nofollow noreferrer">https://learn.sparkfun.com/tutorials/mpu-9250-hookup-guide?_ga=1.139382715.926858641.1470020364</a></p>
 63264: <p>If you want to use SPI-</p>
<p><a href="https://github.com/bolderflight/MPU9250" rel="nofollow noreferrer">The homepage of the library you mentioned, clearly explains the circuit connections.</a>-</p>
<p>The MPU-9250 pins should be connected as:</p>
<ul>
<li>VDD: this should be a 2.4V to 3.6V power source.</li>
<li>GND: ground.</li>
<li>VDDI: digital I/O supply voltage. This should be between 1.71V and
VDD.</li>
<li>FSYNC: not used, should be grounded.</li>
<li>INT: (optional) used for the interrupt output setup in
enableDataReadyInterrupt and enableWakeOnMotion. Connect to
interruptable pin on microcontroller.</li>
<li>SDA / SDI: connect to MOSI.</li>
<li>SCL / SCLK: connect to SCK.</li>
<li>AD0 / SDO: connect to MISO.</li>
<li>nCS: connect to chip select pin. Pin 10 was used in the code snippets
in this document  and the included examples, but any digital I/O pin
can be used.</li>
<li>AUXDA: not used.</li>
<li>AUXCL: not used.</li>
</ul>
<p>Each sensor's nCS (chip select pin) needs to be connected to a slave select pin (any digital pin) on the NodeMCU. This allows the NodeMCU toselect which sensor it wants to talk to.</p>
<p>Another easy way of connecting multiple sensors with the same I2C address is by using an I2C multiplexer like the <a href="https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/overview" rel="nofollow noreferrer">Adafruit TCA9548A</a>
<a href="https://i.stack.imgur.com/1jAwG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1jAwG.jpg" alt="TCA9548 I2C multiplexer" /></a>
This would allow you to connect up to 8 sensors having the same I2C address. <a href="https://www.youtube.com/watch?v=vV42fCpmCFg&amp;ab_channel=DroneBotWorkshop" rel="nofollow noreferrer">Here's a youtube video explaining how to do so.</a></p>
<p>However, if you just want connect two MPU9250s, you dont need to do any of this, as the board offers two unique addresses via the AD0 pin-</p>
<ul>
<li>0x68 if AD0 is grounded</li>
<li>0x69 if AD0 is pulled high</li>
</ul>
