This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

interfacing nrf52840 with gy-521 and gy-89 sensor

i want to interface the nrf52840 with 2 sensors accelerometer and barometer and read the values what should i do.

Parents Reply
  • The breakout board gy-521, includes the MPU-6050 device (accelerometer and gyro), thus you can use this link to get it working.

    Follow these steps (assuming you have keil installed):

    1. Connect the MPU-6050 to the board in the following manner:
      • Pin 27 on nrf52840 → SCL on the gy-521 board
      • Pin 26 on nrf52840 → SDA on the gy-521 board
      • VDD  on nrf52840   → VCC on the gy-521 board
      • GND  on nrf52840   → GND on the gy-521 board
    2. Enter this this link
    3. Follow the steps in the link, under “How to use
      • You can start with  the mpu-simple example for simplicity
      • In your case, define MPU6050
      • Use the following definitions in the file nrf_drv_mpu_twi/nrf_drv_mpu_spi
      • #define MPU_TWI_SCL_PIN 27
        #define MPU_TWI_SDA_PIN 26
    4. Enable logging in order to see the sensor data

    I followed these steps using MPU9250, and it worked fine. However, the examples are not tested on MPU6050, but please ask if it doesn't work. This could be a start, and if you get it to work I can help you with the gy-89.

    Best regards Simon

Children
Related