I am considering making a mouse that you can essentially use in the air. It would be wirelessly connected to a computer/laptop, and you could move it through the air to track motion in the mouse. It’s more of like a fun project I just felt like doing, there’s no like real purpose to it. For moving it through the air, I thought using a motion sensor to track its movements would be possible. Can I do this with a motion sensor inside the device?
1 Answers
If you are looking for a motion sensor really inside the device, then the only sensor I see for a fun project is an IMU (accelerometer + gyro (+ maybe magnetometer)). If you want to keep this as simple as possible, then take one with AHRS feature (ie that computes internally its 3D orientation, which is quite a pain to do yourself). Be warned that it will drift, so you will have to compensate for that in software.
If it were for a high budget project, there might also be solutions based on Doppler effect/speed of light, but it's a whole different level to try to do so yourself.
If you accept to have some external parts to your system, you can go for differential GPS/GNSS (quite expensive, won't work well inside). But you can also build your own system with fixed emitters (for example ultrasound) and a receiver in your mouse. It's not easy, but feasible on a hobby level.
If you accept sensors on the outside of your mouse, then you can use various distance sensors/lidars/...
In your place, if I wanted accurate detection of small fast movements (without caring much about position drift or absolute position), then I would look into AHRS. If you want lower accuracy, but absolute position and no drift, the best solution is probably a GPS like system based on ultrasound (you need your own fixed emitters ("satellites")). If you want both (good short term accuracy and absolute position without drift), then you can combine AHRS+ultra-sound, using data fusion (ex: Kalman filter).
NB: it all depends also on your knowledge in electronics, mathematics and programming. You will need some decent background to implement some of the suggestions