In this instructable I would like to introduce the Magic Bracelet. Actually, it is a gesture recognition device with Infrared Emitter& Receiver. Magic Bracelet makes it possible to control(turn on/off basically) your appliances(such as TV/ air-condition/ fan and other types of remote control devices) with gesture movement.
In order to achieve the gesture recognition, we use 3-Axis Digital Accelerometer module to get acceleration value of gesture motion and then process data with our tidy but efficient algorithm.
Now, I will make a detailed explanation about the steps of making a Magic Bracelet, including the hardware connection and software implementation.
Step 1: Bill of Materials
1. Xadow Main Board
2. Xadow 3-Axis Accelerometer
3. Xadow Vibrator Motor(or Grove - Vibrator)
4. Xadow OLED
5. Infrared Emitter
6. Infrared Receiver
All Components are here.
Step 2: Hardware Connection
Step 3: Structure Design
Step 4: Software Design
1. gesture recognition algorithm
what we used is a simplified but efficient gesture recognition algorithm.We have upload it to github, you can find it here. In order to improve the recognition rate, we have defined 16 kinds of gesture movements as shown in the graph, these all are very simple gesture that it is easier to remember. You can define one of the gesture movements to the electrical appliance that you want to control remotely.
2. Send/Recv infrared signal
In step 2, A5 pin has been used as a infrared Receive pin and MOSI pin has been used as a infrared emitter pin. We import a IRSendRev library, and you can also find it in github, the link is here. In fact, we have to modify this library to make Magic Bracelet work because that MOSI pin is not a PWM pin, we have to realize software PWM on digital pin.
we have uploaded all the source code to github, you can find it here.
Step 5: Test and Play
1. Power On
Power on our bracelet, the OLED panel will show "Gesture&Walker"(Walker is still in development) .
2. Wake Up
Swing your arm to wake up the Magic Bracelet. we use accelerometer to detect the movement of arm, when in high speed vibration mode, we will wake up Magic Bracelet. You can define the swing time by yourself, but here, it is 3 seconds.
3. Switch Mode
After wake up, the vibrator will vibrate for 3 seconds to remind you of selecting mode. you will see "Switch mode" interface in OLED panel. here we offer two modes: 1. Gesture 2. IR Record. the former is used for gesture recognition and the latter is used to store the infrared signal of household appliances. You can tilt your arms to the left or right to choose your model. As a rule, tilting left stands for Number 1 and tilting right stands for 2.
4. Draw gesture
If you choose the gesture mode, you can swing your arm to draw the gesture. Magic Bracelet will wait till your arm stop moving,then it will calculate the matching gesture according to the movement of your arm and show the matching result on OLED panel.
5. Launch Infrared Signal
Once the matching is successful, Magic Bracelet will read the infrared signal according to the matching result, then infrared emission will launch the infrared signal. so you should aim at the household appliance which you want to power on or power off.
Here is our brief demonstration video