The Magic Wand Example
In the Magic Wand example a "magic wand" is used to paint digits into the air. An accelerometer and gyroscope is used to record the movement and from the acceleration and gyroscope data the gesture is reconstructed.
The hardware
In order to get a stable hardware configuration we use the
ESP32-S3FH4R2 CPU in conjunction with an
LSM6DS3 accelerometer and gyroscope module. The LSM6DS3 is mounted on a WeMos D1 mini prototype board, which in turn is connected to the CPU via the triple base backplane. The backplane is attached to the magic wand with screws.
|
The magic wand On top: the LSM6DS3 accelerometer and gyroscope at the bottom: the ESP32-S2FH4R2 CPU |
|
Interfacing the LSM6DS3 to the WeMos D1 mini bus |
The magic wand example is the only one for which no ESP32 version can be found on the internet. The version available uses an Arduino Nano 33 BLE sense board with a LSM9DS1 accelerometer, gyroscope and magnetometer. This chip is substantially more expensive that the LSM6DS3, that misses the magnetometer, which however is not needed to run the example.
The LSM6DS3 has an I2C as well as an SPI interface. The connections are shown in the table below. The driver only uses the I2C interface but could be easily extended to support SPI as well.
The software
The software consists of several parts:
- a LSM6DS3 readout program acquiring the acceleration and gyroscope values from the LSM6DS3
- a data conversion program taking the raw data and extraction stroke positions
- The stroke positions are rasterized before using them as
- input to the pre-trained neural network model
--
Uli Raich - 2023-12-18
Comments