Hi everyone,
I'm currently working on a M.Sc. project to measure the impact of wind on the movement of single trees. So far was using the raw data from MPU6050 (GY-521) sensor and everything works well using a Wemos D1 mini controller. Now I want to integrate some Data Fusion algorithms, to reduce noise and data drift of accelerometer and gyroscope. I will use Complementary or Kalman filter for post processing of the data I already have.
But to improve the overall system and data quality I will make use of the sensor build-in DMP (Digital Motion Processor) of the MPU6050, so for new data no Data Fusion would be necessary anymore. So far everything worked just perfect, using the example sketches from Jeff Rowberg reading raw data, using the DMP etc. on an Arduino Uno (i2cdevlib/Arduino/MPU6050/examples at master · jrowberg/i2cdevlib · GitHub)!
But when I try to use the DMP (MPU6050_DMP6 sketch or other DMP related sketches) on the Wemos D1, the connection to MPU6050 fails (error: MPU6050 connection failed). The MPU6050_raw sketch runs perfect and the data makes sense, but there seemes to be some issue using the DMP related sketches on the Wemos D1.
The MPU_6050_raw sketch makes use of the MPU6050.h library whereas MPU6050_DMP6 sketch uses also the MPU6050_6Axis_MotionApps20.h. Would there any need to make some adjustments in one of the sketches?
So far I lowered the FIFO division rate to 25 Hz, changed MPU6050 mpu to MPU6050 mpu(0x69) just to be sure, without results. The interrupt pin is on pin 15 (D8) of Wemos.
Does anybody have some suggestions or experiences about what I could try to make the MPU6050 with DMP on the Wemos D1 working?
I would really appreciate to get some support on that issue!
Thanks a lot, cheers Sven
I had no trouble getting this ESP DMP demo to work but it was about 6 months ago.
gbafamily:
I had no trouble getting this ESP DMP demo to work but it was about 6 months ago.
i2cdevlib/Arduino/MPU6050/examples/MPU6050_DMP6_ESPWiFi at master · jrowberg/i2cdevlib · GitHub
Yeah I have also worked on this MPU6050 Library and it works really fine. You can easily control three acis orientation with it.
jackthom41:
Yeah I have also worked on this MPU6050 Library and it works really fine. You can easily control three acis orientation with it.
Thanks a lot for your support! I was almost giving up, but now it is running
!
Not sure what finally made the difference! Probably the issue was an old jumper cable on the interrupt pin or a wrong pin for the build in LED_PIN hoe was interfered with something else. I was now noticing that I occasionally also get connection errors to the MPU6050 when I use the reset button! Dis- and reconnecting to power solves this problem!
I tested now an example sketch from MPU-6050 Redux: DMP Data Fusion vs. Complementary Filter – Geek Mom Projects hoe compares DMP and Complementary filter! Few days ago this sketch was not working on my ESP8266 Wemos D1. Data on serial output was missing for some axes and I got no results on the Processing sketch from the same tutorial.
The following modifications of the code “mpu_6050_i2cdevlib.ino” made it working for my ESP8266:
Added one line to define the pin for the interrupt:
#define INTERRUPT_PIN 15
and modified the code somewhere around line (235):
//attachInterrupt(0, dmpDataReady, RISING); // commented out this line and replaced it with the line below.
attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);
Also the Processing sketch (MPU6050_DMP_vs_ComplementaryFilter_ESP8266.pde) from the same tutorial was not working immediately! The proper serial port was not be identified by the pre-defined “portIndex” of 0 or 1.
I added the line below to print all the serial ports and changed the portIndex according to the port number to which my ESP8266 was connected, which was in my case port 32.
println(Serial.list());