Tags:
create new tag
view all tags

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.

img_0115.png
The magic wand
On top: the LSM6DS3 accelerometer and gyroscope
at the bottom: the ESP32-S2FH4R2 CPU

accelerometer_interface.png
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.

LSM6DS3 WeMos D1 D pin GPIO on ESP32S3FH4R2
3V3 3V3  
GND GND  
SCL D5 GPIO 12
SDA D6 GPIO 13
CS D7 GPIO 11
SA0 D8 GPIO 10
DCS D1 GPIO 36
INT2 D2 GPIO 35
INT1 D3 GPIO 18

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


Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng accelerometer_interface.png r1 manage 579.5 K 2023-12-18 - 13:54 UliRaich  
PNGpng img_0115.png r1 manage 647.5 K 2023-12-18 - 13:55 UliRaich  
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2023-12-18 - UliRaich
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback