Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Custom PCB of BNO055 not working

    Custom PCB of BNO055 not working

    I have recently created a custom PCB which includes a 16mhz atmega32u4 at 5v, a BNO055 (over i2c, with 32.768 KHz external crystal). I am having a problem with the BNO055 in that the adafruit library is not working nor the custom code written by my end. But when I use the same code on the ADAFRUIT module it works like a charm. The self-test always reports that everything works the system does not report any errors. I am attaching my Ckt diagram please do help me out here.

    10 REPLIES 10

    I got this from the custom board

    ID.png

    Hello subhajit_sarkar,

    Could you read data from sensor next step?

    No that's the problem all I am getting  Zeroes at the output

    Hello subhajit_sarkar,

    You could start capture waveform with logic analyzer before you run read sensor data code. And check if actual waveform matchs with your running code.

    Hii  ,

    Thanks for your replies I have finally started getting data but there is still one problem that persists.. Below is the code I am using to get the data Register By register without any library but what happens is that even if I put the sensor in NDOF mode I still get the z-axis in a continuous Rotation mode from 0-360 degree which doesn't happen in the ADAFRUIT Module. Can you point me in the right direction... Thanks in Advance..

    #include <Wire.h>

    uint8_t Roll_HSB, Roll_LSB, Pitch_HSB, Pitch_LSB, Yaw_HSB, Yaw_LSB;
    int16_t rawRoll, rawPitch, rawYaw, rawTemp;
    float Roll, Pitch, Yaw, Temp;

    void setup() {

    Serial.begin(115200);
    Wire.begin(0x28);

    setupIMU();
    }

    void loop() {

    getDataIMU();
    serialOut();

    }

    void setupIMU() {

    //Configure Power Mode.
    Wire.beginTransmission(0x28); //Begins transmission with BNO IMU at devices address.
    Wire.write(0x3E); //Sends for the PWR_MODE register.
    Wire.write(0x00); // Sets PWR_MODE register to NORMAL MODE. This is the defualt anyway.
    Wire.endTransmission(); //Ends transmission.

    //Configure Operating Mode.
    Wire.beginTransmission(0x28); //Begins transmission with BNO IMU at devices address.
    Wire.write(0x3D); //Sends for OPR_MODE register.
    //Wire.write(0b00001000); //Sets OPR_MODE to IMU only FUSION
    Wire.write(0b00001100); //Sets OPR_MODE to Absolute 9dof (NDOF) FUSION.
    Wire.endTransmission(); //Ends transmission.

    //Configure Axis Orentation.
    Wire.beginTransmission(0x28); //Begins transmission with BNO IMU at devices address.
    Wire.write(0x41); //Sends for the AXIS_MAP_CONFIG register to configure the axis orentation.
    Wire.write(0x21); //Sets the Axis configuration to "P0" configuration. See datasheet page 24-25.
    Wire.endTransmission(); //Ends Transmission

    //Configure Axis Signs.
    Wire.beginTransmission(0x28); //Begins transmssion with BNO IMU at devices address.
    Wire.write(0x42); //Sends for the AXIS_MAP_SIGN register to adjust the signs of the axis.
    Wire.write(0x04); //Sets the axis signs. See datasheet page 24-25.
    Wire.endTransmission(); //Ends transmission.

    //Configure ACCEL, GYRO, MAG. When in fusion mode these are auto configured. See datasheet page 28.

    //Configure Data Units.
    Wire.beginTransmission(0x28); //Begins transmission with BNO IMU at devices address.
    Wire.write(0x3B); //Sends for UNIT_SEL register to configure outputed units.
    Wire.write(0b00010000); //Configures ACC: m/s^2; Gyro: deg/s; Euler Angles: Deg; Temp: F.
    Wire.endTransmission(); //Ends transmission.

    //Configure External Crystal.
    Wire.beginTransmission(0x28); //Begins transmission with BNO IMU at devices address.
    Wire.write(0x3F); //Sends for SYS_TRIGGER register to configure external crystal.
    Wire.write(0b10000000); //Flips bit 7 in register to enable external crystal.
    Wire.endTransmission(); //Ends transmission.

    }

    void getDataIMU() {
    Wire.beginTransmission(0x28); //Begins transmission with BNO IMU at devices adress.
    Wire.write(0x1A);
    Wire.endTransmission();
    Wire.requestFrom(0x28, 6); //Requests 6 bytes from the IMU.
    while(Wire.available() < 6) {};

    Yaw_LSB = Wire.read(); //Reads Euler angle about X-axis least significant byte. (EUL_DATA _X_LSB register)
    Yaw_HSB = Wire.read(); //Reads Euler angle about X-axis most significant byte. (EUL_DATA _X_MSB register)
    Pitch_LSB = Wire.read(); //Automatically continues to the EUL_DATA _Y_LSB & EUL_DATA _Y_MSB registers to get roll.
    Pitch_HSB = Wire.read();
    Roll_LSB = Wire.read(); //Automatically continues to the EUL_DATA _Z_LSB & EUL_DATA _Z_MSB registers to get Yaw.
    Roll_HSB = Wire.read();

    rawPitch = ((Pitch_HSB)<<8)| Pitch_LSB; //Or the Low byte with the High byte.
    rawRoll = ((Roll_HSB)<<8)| Roll_LSB;
    rawYaw = ((Yaw_HSB)<<8)| Yaw_LSB;

    Pitch = rawPitch/16.0; //Divide by the LSB factor (16 LSB/1 Degree).
    Roll = rawRoll/16.0;
    Yaw = rawYaw/16.0;

    void serialOut()

    {
    Serial.print(Roll);
    Serial.print(',');
    Serial.print(Pitch);
    Serial.print(',');
    Serial.println(Yaw);

    }

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist