How can I detect taps on a desk without an onboard accelerometer?
Asked by
soup simmer
I'm working on a project for a Vivobook laptop. I saw a Mac detect tapping or vibrations happening on the desk near the computer, and I'd like to build something similar. My laptop doesn't appear to have an accelerometer built into its motherboard, and I'd prefer not to connect an external sensor directly to it because that undermines the purpose of the project. I also want to avoid leaving the microphone enabled, since ordinary sounds could trigger false positives and continuous audio monitoring isn't ideal for everyday use. Are there any practical ways to detect desk taps using hardware or sensors already available on the laptop?
Answers
A camera might detect larger desk movements by comparing frame-to-frame image changes, but it would be unreliable if people or objects are moving in view. Other sensors such as magnetometers could sometimes detect disturbances, but in practice an accelerometer or vibration sensor is the appropriate tool. Without adding hardware, the microphone is essentially the only realistic option.
Reply to this answer
A contact microphone or piezo vibration sensor attached to the desk would likely work much better than the laptopโs normal microphone. It detects vibrations traveling through the desk instead of airborne sound, so it can be tuned to recognize taps. A small Bluetooth or USB interface could send the signal to the laptop, although this only makes sense if the same desk will always be used.
Reply to this answer
If the laptop doesnโt expose an accelerometer or another suitable motion sensor, there probably isnโt a hidden software API that can provide this data. The microphone is the most accessible option, but youโd need signal processing such as band-pass filtering, amplitude thresholds, and possibly a short-time frequency analysis to distinguish desk impacts from speech and background noise. You could process only small audio windows rather than recording continuously.
Reply to this answer
Some manufacturers can integrate sensor data deeply into their hardware and operating system, which is why a particular laptop may support this while another does not. Even if the touchpad or other components physically react to vibrations, that information usually isnโt exposed to applications. Youโll need to test which sensors your machine actually reports, and if none are available, the project requires either audio analysis or an external sensor.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions