Fixing drifting problem for elechouse voice recog module v3.1 and MPU6050 sensor

For my head mouse project which is based on the voice recognition module V3.1 for left click, double click, right click operations, I am facing a problem. When I just use the MPU 6050 accelerometer and gyroscope for nose movement, the mouse cursor moves smoothly. But when I integrate it with the voice recognition module, the cursor starts to drift. My code is given below:

vr_click_control_22-06-19.ino (3.42 KB)

I have been using an arduino pro micro for this project. Please help. I have calibrated my MPU6050 , so it does not drift while working alone. But after integration with voice recog module (including calibration) , the drifting problem returns.

Please post a complete wiring diagram, hand drawn is fine. Image posting guide

Note that the MPU-6050 yaw will always drift to some extent, as there is no yaw reference. You need a 9DOF IMU or magnetometer for that.

This is the hand drawn figure of the circuit connections

How are you powering the setup? The gyro drift rate depends on temperature and power supply voltage.

Try calibrating the sensor with the voice module in place.