My basic idea is to use a gyroscope sensor to recognize gestures, and simulate the switch of a Zigbee door sensor’s Hall sensor through IO. This can be used to trigger automation scenes with open/close commands.
The gyroscope sensor (I’m using MPU6050) supports reading acceleration and angular velocity in the x, y, and z axes. This means I can use this data to design triggering gestures.
To avoid accidental triggers and achieve a cool effect, I have defined several actions:
Picking up/activating the wand
Ready to accept commands
Casting a spell action (accumulating magic power)
Shooting magic power!!!
To cast a spell, there are currently two ways: one is to cast to the left, and the other is to the right. This will make the gyroscope give two different acceleration signals. I use STM32 to process these signals and use the high and low levels of IO to send commands to a Zigbee door sensor’s Hall sensor. The door sensor will send open/close commands, triggering pre-designed scenes.
For a more visual and cooler effect, I also made an LED wand with a few LEDs and silicone. I use STM32’s PWM signal to control it. Let’s check it out!
Next, I plan to make a small PCB and power it with two AAA batteries to eliminate the influence of wires and make the wand swing more freely. At the same time, I’m thinking of more triggering actions and implementation methods. I will continue to update.
To expand more trigger conditions, I tried to use wires to transmit the signal to a Zigbee wireless button to imitate “click”, “double click”, and “long press”, then trigger scenes. But not every time is successful, possibly because the level signal transmission interval was not adjusted properly.
Recently, I have been considering using a Zigbee three way switche to make it. Each switch can send “on” and “off”, which means I can design 6 triggers and the hardware should be easier.