Jump to content
I2Cdevlib Forums
Sign in to follow this  
nikel1992

Mpu6050 motion interrupt

Recommended Posts

Hello guys.

 

I am trying to make an alarm for a moving object using mpu6050. I connected the sensor to Arduino and tried to attach it to an object from my house, in case someone moves it, even very slowly, I want to know. The problem is that i made the motion interrupt setting but if i move the object slowly, it does not detect anything, whereas If i tap it, I get imediately an alarm. What you think, what should I tune? Does it have a connection with the accelerometer range or sample rate? Thanks.

// Here it is set the motion detect routine . You are able to set the sensitivity of the module.
    // The values motion duration and motion threshold sets the sensitivity of the module.
    mpu6050_writeByte(MPU6050_RA_INT_ENABLE, 0x40);

    //MOTION DURATION
    mpu6050_writeByte(MPU6050_RA_FF_DUR, 1);

    //MOTION THR
    mpu6050_writeByte(MPU6050_RA_FF_THR, sensitivity);
    mpu6050_writeByte(0x68, MPU6050_PWR1_CYCLE_BIT);
    mpu6050_writeByte(0x6C, 135);
    _delay_ms(1);

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...