ICM20649 and nrf52840 requiring serial to start

Hi, im using a seeed nrf52840 and adafruit ICM20649, i can get it to work no problem whilst connected to serial, however when i start it with no serial (from battery it doesnt work).
i am using the LED to check where its upto: it flashes at the start during setup and then ticks on and off if i exceed 6deg/sec on the gyro.

if i upload the code via usb and run it it works, if i unplug and replug it stops working

if i upload via usb and then turn on the battery it still works, if i remove the usb it still works.

if i power it with the lipo i get the start up sequence but no gyro detection.

im using i2c and powering via the 3.3pins from the Seeed, i measure 3.3v if im using lipo and/or usb power.

edit:::
i have added code so that it flashes if i2c fails on start up - it fails on all but initial upload. reconnecting or lipo start fails the sensor connection.

#include <Adafruit_ICM20649.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>

Adafruit_ICM20649 icm;
float gyroAvY;
int avNum = 10;

void setup(void) {
  pinMode(LED_BUILTIN, OUTPUT);

  if (!icm.begin_I2C()) {   //try and connect using i2c, if this doenst work, flash the LED
    for (int i = 0; i < 50; i++) {
      digitalToggle(LED_BUILTIN);
      delay(50);
    }
  }


  for (int i = 0; i < 10; i++) {      //show that start up is taking place
    digitalToggle(LED_BUILTIN);
    delay(500);
  }
  icm.setGyroRange(ICM20649_GYRO_RANGE_2000_DPS);
}

void loop() {

  //  /* Get a new normalized sensor event */
  sensors_event_t accel;
  sensors_event_t gyro;
  sensors_event_t temp;
  for (int i = 0; i < avNum; i++) {
    icm.getEvent(&accel, &gyro, &temp);
    gyroAvY += gyro.gyro.y;
  }

  gyroAvY = gyroAvY / avNum;
  if (gyroAvY > 6) {
    digitalToggle(LED_BUILTIN);
  }
  Serial.print(gyroAvY);
  Serial.println();
}

if anyone knows anything id love to hear it as im really scratching my head.

many thanks

Perhaps issue is not in Serial, but in power?
Please show your detailed connection diagram

thanks for your quick response, heres there connections - i have a lipo onto the battery pins of the seeed

the 3.3 doesnt change on my multimeter whether its on lipo or usb.

plus it seems to have issue relaunching the icm.begin on usb reconnect. ive looked into the .h file and theres nothing about serial there. seems like something need resetting / reconnecting on the sensor perhaps to clear its memory?

If you supplying the ICM by 3.3v from the Seeed - why did you put it to VIN pin and not to 3.3v ?

ICM20649 VIN pin input voltage MUST be more than 4v 3v5 for stable work.

(corrected input voltage of ICM LDO)

i think your information is incorrect sorry:

taken from adafruit site:

  • Vin - this is the power pin. Since the sensor chip uses 3 VDC, we have included a voltage regulator on board that will take 3-5VDC and safely convert it down. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V microcontroller like Arduino, use 5V
  • 3Vo - this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you like
  • GND - common ground for power and logic

Ok, I am partially mistaken.
But any voltage regulator has a drop. If your supply voltage is 3v3 and a nominal voltage of ICM chip is a 3v3 too - I don't see why do you need a regulator at all.

By the way, how the Seeed board powered?

im using usb or lipo.
i dont think the power is the issue since it happens with ubs too

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.