In this tutorial, I would like to introduce the Magic Bracelet, a gesture recognition device with Infrared Emitter & Receiver. Magic Bracelet makes it possible to control (turn on/off) your appliances (such as TV/ air-condition/fan and other types of remote control devices) with gestures.
In order to achieve the gesture recognition, we use a 3-Axis Digital Accelerometer module to get acceleration value of gesture motion and then process data with our tidy but efficient algorithm.
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
The materials that you needed depends on what you want to do. To realize gesture recognition, you just need the first four module list as follow, but if you want to control your household appliances, all list is in need.
- Xadow Main Board
- Xadow 3-Axis Accelerometer
-
Xadow Vibrator Motor(or Grove - Vibrator)
- Xadow OLED
- Infrared Emitter
-
Infrared Receiver
Step 2: Hardware Connection
In order to make your bracelet work properly, you have to do some welding. The principle diagram of the hardware connection is as follows.
As described in the figure, Infrared Emitter's TX pin has been connected to MOSI pin (we use the MOSI pin as a normal digital output pin to realize infrared signal output) and Infrared Receiver's RX pin has been connected to A5 pin (we use A5 pin as a normal input pin to realize infrared signal input). Physical connection is as shown in the picture, here we use Grove-Vibrator rather than Xadow Vibration Motor, but it makes no difference!
Step 3: Structure Design
The Magic Bracelet is now connected to hardware, but it is still not a really bracelet. We must put these assembled modules into a bracelet. Here, we secure these modules in a cloth belt ring. It looks a little crude, right?
Step 4: Software Design
The Magic Bracelet contains two parts of software:1. Gesture recognition algorithm We use a simplified but efficient gesture recognition algorithm. We uploaded 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 gestures, easy to remember. You can attribute a given gesture to the electrical appliance you want to control remotely.
2. Send/Receive infrared signal In step 2, the A5 pin is used as an infrared Receiver pin and the MOSI pin is used as a infrared emitter pin. We import a IRSendRev library, that you can also find on github, here. Though we need to slightly modify this library to make the Magic Bracelet work because the MOSI pin is not a PWM pin: we have to realize software PWM on a digital pin--again, all the source codes are available on github, 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 an accelerometer to detect movements of the arm: in high speed vibration mode will wake up the Magic Bracelet. You can define the swing time by yourself, but here, it is 3 seconds.
3. Switch Mode After waking up, the vibrator will vibrate for 3 seconds to remind you to select a 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, swing your arm to draw the gesture. Magic Bracelet will wait till your arm stop moving and calculate the matching gesture according to the movement of your arm, and show the matching result on the 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.
http://v.youku.com/v_show/id_XNjYxOTAwNDcy.html
Step 6: Next steps
To make the magic bracelet a better product, I want to extend its functionality. The direction that I can think of include "walker","sleep quality monitoring","trajectory tracking". I need more ideas and would like more people to join me!
lawliet zou
Comments
Please log in or sign up to comment.