MakerGram Logo

    MakerGram

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups

    Max30102,MPU6050 and Esp8266

    ESP32
    3
    3
    42
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Adithya SM last edited by

      I am having some trouble connecting both the MAX30102 and MPU6050 sensors to my ESP8266 board. Both sensors use the I2C communication protocol to interface with the microcontroller.

      I have tried writing some baremetal code to read data from both sensors, but I am not getting any output values from either of them. I have also checked my wiring connections and confirmed that the sensors are receiving power.

      I would really appreciate any suggestions or advice on how to troubleshoot and resolve this issue. Specifically, I would like to know if there are any common issues that arise when using I2C communication with multiple sensors on an ESP8266 board. Additionally, if anyone has successfully interfaced these sensors with an ESP8266 board and can share their code or any tips, it would be greatly appreciated.

      salmanfaris 1 Reply Last reply Reply Quote 0
      • saheen_palayi
        saheen_palayi last edited by

        Hey @Adithya-SM
        Could you drop your code here?

        1 Reply Last reply Reply Quote 1
        • salmanfaris
          salmanfaris @Adithya SM last edited by

          @Adithya-SM Can you confirm the I2C address is correct? You can use this I2C Scanner to program to find the correct address

          
          // --------------------------------------
          // i2c_scanner
          //
          // Modified from https://playground.arduino.cc/Main/I2cScanner/
          // --------------------------------------
          
          #include <Wire.h>
          
          // Set I2C bus to use: Wire, Wire1, etc.
          #define WIRE Wire
          
          void setup() {
            WIRE.begin();
          
            Serial.begin(9600);
            while (!Serial)
               delay(10);
            Serial.println("\nI2C Scanner");
          }
          
          
          void loop() {
            byte error, address;
            int nDevices;
          
            Serial.println("Scanning...");
          
            nDevices = 0;
            for(address = 1; address < 127; address++ ) 
            {
              // The i2c_scanner uses the return value of
              // the Write.endTransmisstion to see if
              // a device did acknowledge to the address.
              WIRE.beginTransmission(address);
              error = WIRE.endTransmission();
          
              if (error == 0)
              {
                Serial.print("I2C device found at address 0x");
                if (address<16) 
                  Serial.print("0");
                Serial.print(address,HEX);
                Serial.println("  !");
          
                nDevices++;
              }
              else if (error==4) 
              {
                Serial.print("Unknown error at address 0x");
                if (address<16) 
                  Serial.print("0");
                Serial.println(address,HEX);
              }    
            }
            if (nDevices == 0)
              Serial.println("No I2C devices found\n");
            else
              Serial.println("done\n");
          
            delay(5000);           // wait 5 seconds for next scan
          }
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Recent Posts

          • A

            @Richu-Bini I'm not sure if this is the root cause but normally, you should add an RC delay on the EN pin. This is because the BOOT pin should reach 3.3V before the EN reaches 3.3V hence, the RC delay on the EN pin. A 10K resistor and a 1μF Cap should do it. Here's a sketch on how it should look like:
            RC delay on ESP.jpg

            Here is the part in the datasheet of the WROOM32 that tells you to do it:
            WROOM_Data.PNG

            • read more
          • R

            @Richu-Bini am using an Arduino uno as ttl module

            • read more
          • Hi @Richu-Bini , What kind of UART/FTDI programmer you are using? Could also share the connection diagram to the module with the programmer?

            and in the diagram I see, you already twisted Rx and Tx, so you should connect the FTDI with the module Esp32 Rx - FTDI Rx and Esp32 TX - FTDI TX.

            7c84a195-7185-4c07-ab28-7270a9017db7-image.png

            • read more
          • R

            WhatsApp Image 2023-05-10 at 12.37.42.jpg

            Showing this message from serial monitor .... i have used an arduino as a TTL module by shorting the GND and reset pin
            WhatsApp Image 2023-05-10 at 09.14.46.jpg

            when i tried to upload the code it is showing this error

            956c990f-9b85-44a5-8c27-1b02402eae4c-image.png

            This is the schematic i used

            • read more
          • @Adithya-SM Can you confirm the I2C address is correct? You can use this I2C Scanner to program to find the correct address

            // -------------------------------------- // i2c_scanner // // Modified from https://playground.arduino.cc/Main/I2cScanner/ // -------------------------------------- #include <Wire.h> // Set I2C bus to use: Wire, Wire1, etc. #define WIRE Wire void setup() { WIRE.begin(); Serial.begin(9600); while (!Serial) delay(10); Serial.println("\nI2C Scanner"); } void loop() { byte error, address; int nDevices; Serial.println("Scanning..."); nDevices = 0; for(address = 1; address < 127; address++ ) { // The i2c_scanner uses the return value of // the Write.endTransmisstion to see if // a device did acknowledge to the address. WIRE.beginTransmission(address); error = WIRE.endTransmission(); if (error == 0) { Serial.print("I2C device found at address 0x"); if (address<16) Serial.print("0"); Serial.print(address,HEX); Serial.println(" !"); nDevices++; } else if (error==4) { Serial.print("Unknown error at address 0x"); if (address<16) Serial.print("0"); Serial.println(address,HEX); } } if (nDevices == 0) Serial.println("No I2C devices found\n"); else Serial.println("done\n"); delay(5000); // wait 5 seconds for next scan }

            • read more
          By MakerGram | A XiStart Initiative | Built with ♥ NodeBB
          Copyright © 2023 MakerGram, All rights reserved.
          Privacy Policy | Terms & Conditions | Disclaimer | Code of Conduct