The Magic Wand Example
Introduction
The magic wand example shows how to detect gestures using an accelerometer. Different types of accelerometers are easily available:
- The ADXL345 is a tree axis digital accelerometer by Analog Devices
- The MPU6050 is a six axis device (Gyro and Accelerometer) from Ivensense. It is described by it datasheet and the register description.
- The LIS2dH MEMS digital output motion sensor from ST Microelectronics is an ultra low power high performance 3 axis accelerometer.
I mounted the accelerometer onto a WeMos D1 prototype board. With the triple base and the CPU this makes up for a stable assembly that can easily be moved without cable contact problems.
Hardware connections
The MPU6050 is connected to the WeMos D1 bus as follows:
XDA and XCL are foreseen to control an external I2C bus, These pins are currently not used. AD0 allows to modify the MPU6050 I2C address and is also not used.
The ADXL345 is connected as follows:
Providing a training data set
In order to provide a training data set we must be able to record gestures. Therefore a driver for the accelerometer is needed as well as a program that recognizes movement and writes the accelerometer data on a file.
--
Uli Raich - 2022-02-02
Comments