ESP32 ICM426XX driver
Posted: Mon Jun 07, 2021 5:13 am
Hi Guys,
I have ported the InvenSense's official driver to the ESP-IDF platform, for ICM426XX 6-axis motion sensors.
The port is not 100% yet, as there is a pre-built lib that needs to be integrated, but other than that, it works nicely.
https://github.com/VaderMester/ESP32-ICM426XX-driver
I made it so that you can easily plug in your SPI or I2C drivers, as it is not tied to the driver itself.
At the moment only reading from FIFO is made to work using interrupts.
So far, I only was able to test this with an ICM42605, which is one of the cheapest one, but with a good feature set.
I'll use that as a substitute for the MPU6050.
Some things that needs implementation, and in the works:
- Usage of DMP features like Apex, Tilt detection, Significant Motion detection, pedometer, etc.
- Making functions to configure internal hardware filters of the device.
- Calibration and self test so that output is properly zerod, and storing calibration values into NVS.
- Raw data readout without using FIFO.
Footnote: One remark of the InvenSense prebuilt lib, is that InvenSense was kind enough to pre-build it for me with IDF.
Hopefully it'll work, once integration is complete.
There is a handly .exe file for Windows provided by InvenSense, and an example that uses this pre-built lib, which supposed to communitcate with via a COM port through UART, and it visualizes motion sensor data. I hope I can make that work as well.
If you have any questions, feel free to ask below.
Regards,
Vader(Ben)
I have ported the InvenSense's official driver to the ESP-IDF platform, for ICM426XX 6-axis motion sensors.
The port is not 100% yet, as there is a pre-built lib that needs to be integrated, but other than that, it works nicely.
https://github.com/VaderMester/ESP32-ICM426XX-driver
I made it so that you can easily plug in your SPI or I2C drivers, as it is not tied to the driver itself.
At the moment only reading from FIFO is made to work using interrupts.
So far, I only was able to test this with an ICM42605, which is one of the cheapest one, but with a good feature set.
I'll use that as a substitute for the MPU6050.
Some things that needs implementation, and in the works:
- Usage of DMP features like Apex, Tilt detection, Significant Motion detection, pedometer, etc.
- Making functions to configure internal hardware filters of the device.
- Calibration and self test so that output is properly zerod, and storing calibration values into NVS.
- Raw data readout without using FIFO.
Footnote: One remark of the InvenSense prebuilt lib, is that InvenSense was kind enough to pre-build it for me with IDF.
Hopefully it'll work, once integration is complete.
There is a handly .exe file for Windows provided by InvenSense, and an example that uses this pre-built lib, which supposed to communitcate with via a COM port through UART, and it visualizes motion sensor data. I hope I can make that work as well.
If you have any questions, feel free to ask below.
Regards,
Vader(Ben)