ECE153B-Project

ECE153B Project Website:

https://ethanlee556.github.io/ECE153B-Project/

Goal

The goal of our project is to create a laser tracking game. We will attach laser pointers onto two pairs of servos. The first pair of servos will be controlled by the computer and act as the target we are trying to track. The second pair of servos will be controlled by the player with a Wii nunchuck. In addition, we will also use a ultrasonic distance sensor to obtain the distance of the wall/surface our lasers will be shined on. Knowing the distance and the angle of the pan and tilt of the servos we can map our laser points with a simple rotation and translation matrix from the 3D world to the 2D coordinate system of wall/surface. Once we get the 2D coordinates we can easily calculate the position of the two laser points and the distance between them. This will then allow us to award points to the player if they can match their laser they are controlling to the position of the target laser within some tolerance range. We will also display game points and info to a Termite terminal.

Parts

Serial Interface Protocols

Block Diagram

Block Diagram

Weekly Updates

Week 8:

Decided to opt for a red dot laser diode instead of regular laser pointers. Smaller, lighter and simplier to attach to the servos. Both the target and player lasers, however, will have to be red. GPIO pin initalizations and timer initalization for the servos/UART/Distance sensor were completed. Basic functions to control servo positions were created. UART communication between the board and the Termite terminal was setup. Sensor measurement gathering from the distance sensor was also setup. Next weeks goals are the successful interfacing the of Wii nunchuck and servos and the implementation of the main game program(randomizing target laser movement, awarding points, start/end game, etc.).

Week 9:

Finished the “hard” part of getting the Wii nunchuck to control the servos. Wrote code to randomize target laser movement but still need to test. Wrote code to determine the area of the target laser’s bounds based off the distance from the wall. Started work on calculating a sucessful ‘hit’ by the players laser onto the target laser, but still need to refine. Next week’s goals are mostly software related: more testing/refine of the main game and target lasers movement.

CLICK image for video or “https://www.youtube.com/watch?v=wo-2JLjwcpQ”

Calculations for area of the playing zone based of a distance ratio:

Week 10:

Finished random target movement. Last step is to calculate successful hit on to target with player laser.

Demo Video:

CLICK image for video or “https://www.youtube.com/watch?v=kC_bcCdaAdo”