Magic Wand Battle Game Team 53 Shanoon Martin, Jialin Sun, Manfei Wu
Introduction Combine the technology of gesture recognition and the concept of wide- range game Implement the wireless network in the game to make it portable and flexible
Block Diagram
Wands
Wand’s Workflow
Inertial Measurement Unit (IMU) Consist of 3-axis Gyroscope and 3- axis Accelerometer Accelerometer detects static and dynamic acceleration for tilt-sensing Gyroscope senses angular velocity for motion orientation
Filtering the IMU raw data Gyroscope is less susceptible to noise on short term, but has accumulated drift over time On long term, accelerometer data is sampled accurately because it does not drift Complementary Filter and Kalman Filter
Gesture Recognition Algorithm Limitation : Arduino Uno computational time and memory Better algorithm : Trajectory estimation algorithm and Bayesian network gesture recognnition Actual implemented algorithm : Perceptron Algorithm
Multiclass Perceptron Algorithm Single layer artificial neuron network Each data input vector is processed to be a feature vector f(x) Weight vector (w): a specialized vector that used for identification for each different class Activation: the dot product between w and f(x). The result determine which class the feature vector belong to
Hit Sensor Hit Sensor = Ultrasonic Receiver + Xbee + Arduino
Ultrasonic Receiver Schematic Three stages of amplifier(2N2222) and a comparator(LM386) Capacitors are added to get rid of DC components At the input of the comparator, if V+ > V-, output is high, otherwise it is low, so we will have a square wave output
Ultrasonic Transmitter MaxSonar EZ4 narrow beam Range: meters Connect its Vdd and GND and it will send out ultrasonic wave automatically
Ultrasonic Receiver Output Oscilloscope output Arduino Serial Port Output
XBee S1 Wand Hit Sensor Receiver Xbee
Enable a wide range communication system Distance 100ft (30m) Set Transmitter Receiver XBee 1 XBee 2 ATID 40 ATID 40 Network ID ATMY 1 ATMY 2 Current ID ATDL 2 ATDL 1 Destination ID ATWR ATWR Save parameters ATCN ATCN Exit
Receive Message hello Point-to-Point Communication System is Ready
Xbee Multiple Points Communication
Multiple Transmitters One Receiver Transmitters Receiver (Wand & Hit Sensor) ATID 40ATID 40 ATMY 1ATMY 2 ATDL 2 ATDL 1 ATWR ATCN
Main Receiver: Raspberry Pi A Receiver Xbee is connected Raspberry Pi with Xbee adapter Enable Serial input of Pi Download a Serial package Test code
Game Logic Used python, especially pygame Used several local variables to distinguish different incoming signals from IMU or ultrasonic receiver class player(): hp = 100 hit = 0 move = 0
User Interface Solder the PiTFT 2.8” touchscreen from Adafruit to female header Software: Install a new Kernel package over the Paspbian Test and then edit more files to make it auto-load
Wand’s Requirements and Verification Test on IMU calibration
Algorithm Correctness
Stable connectivity between Wands and Receiver Transmit real time sampling data at once from the wand to the receiver, average data lost is less than 5%
Hit Sensor Requirements and Verifications Requirements: Ultrasonic receiver will receive ultrasonic wave 5 meters away At the longest distance, the receiver will have accuracy of 5cm Verifications: Set the transmitter and receiver in parallel and 5 meters away from each other Move the transmitter 5cm away from the line and see if the receiver gets any signals
Wireless Communication Requirements and Verifications Enable a wide range communication system Support the mesh Network for multiple users communication with one receiver
Power Budget First Design : Total power for wand: 5hr of gaming needs 812mAh Final Design Total power for wand: 5hr of gaming needs 1250mAh Current battery can sustain for 2hrs
Challenges: 1. wand Transmission rate between Xbees becomes slower when the end side is Raspberry Pi Affecting the algorithm accuracy Perceptron Algorithm can only sample limited movements
2. Hit Sensor Calibration time 3. User Interface Touchscreen is not stable
Modified Design 1. Additional Arduino in Hit Sensor Coded to enable distinguishing multiple points 2. Use Arduino Unos instead of building Arduino boards using Arduino chips Could not fix the bug of “avrdude: stk500_getsync(): not in sync: resp = 0x50”
Future Work Implementing the wand algorithm on a different processor to increase the complexity tolerance of calculation Integrate the processor and PCB of the wand to a lighter, smaller dimension for a better mobility Decrease hit sensor calibration time Make the touchscreen more stable Add more players to the game
Thank you!
Reference (2010) Accelerometer and Gyro Tutorial : Tutorial/ Ultrasound device data sheet : Raspberry Pi to Arduino : hacks.com/documentation/tutorials/raspberry-pi-to- arduino- shields-connection-bridge Ultrasound receiver information: sonic_Transducer_Receiver_DIY_Kit_w ith_Custom_PCB.html IEEE code of ethics