S18: Smart Rock Paper Scissors

From Embedded Systems Learning Academy
Revision as of 01:04, 9 May 2018 by Proj user3 (talk | contribs) (Implementation)

Jump to: navigation, search

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

Project Title

Hand gesture controlled rock paper scissors game.

Abstract

This project recreates the classic Rock,Paper, Scissors game using a LED Matrix to display and keep track of scoring, and wireless gloves to record the user input. The LED Matrix helps users to know what round they are on, what the score is, as well as provide prompts of when to give the Rock, Paper or Scissors signal. The Smart aspect of the system also allows users to play against a computer player. The wireless gloves utilize Bluetooth modules and flex sensors to detect the player input and feed that input into the game logic and game controller.

Objectives & Introduction

  • Create LED display to guide players through the game
  • Create wireless gloves to allow players to give input
  • Create feedback to the gloves to enhance the game experience
  • Make the game platform modular, so other games could be easily built with the system

Team Members & Responsibilities

  • Josh Skow
    • System Integration
    • PCB
  • Kaustubh Jawalekar
    • Bluetooth
    • Glove, Sensors
  • Kevin Gadek
    • LED Display
  • Akinfemi Aluko
    • Bluetooth
    • Glove, Sensors
  • Sarvpreet Singh
    • LED Display

Schedule

Show a simple table or figures that show your scheduled as planned before you started working on the project. Then in another table column, write down the actual schedule so that readers can see the planned vs. actual goals. The point of the schedule is for readers to assess how to pace themselves if they are doing a similar project.

Week# Date Task Actual
1 03/20 Submit Project Proposal Completed.

Had to modify project proposal from original submission.

2 03/27 Determine project architecture Completed.
3 04/03 Order Parts Completed.
4 04/10 Begin work on Display, Bluetooth

Begin work on PCB.

Begin testing glove sensors.

Completed.
5 04/17 Write multiple lines on Display Successfully

Set Bluetooth device to master mode

Read valid data from flex sensor

Completed.

Had to purchase a Bluetooth module that supports master mode.

6 04/24 Draw full image on Display.

Complete Bluetooth logic.

Begin working on game logic and game state machine.

Begin assembling glove and sensors to mount on wrist.

Finish PCB, and submit PCB layout to fab.

Game logic completed. Bluetooth logic working, and basic gloves put together.
7 05/01 Finalize glove design, and wrist mounting.

Finish Display logic.

Finalize game logic.

Receive PCB from fab, populate and test PCB.

Display logic still in progress due to figuring out how to best communicate with display.

PCB not sent to fab, as waiting for hardware design to finalize.

Glove drivers working and glove is physically put together.

8 05/08 Test for edge cases with game logic.

Fine tune display images for game.

Add game features if time permits.

Re-work PCB as needed based on testing.

Completed? Problems Encountered?
9 05/15 Complete final project documentation.

Prepare project for demo.

Completed? Problems Encountered?
10 05/22 Finish debugging project for demo. Completed? Problems Encountered?

Parts List & Cost

Part Name Description Link Quantity Cost
32x32 RGB LED Matrix 32x32 Matrix to display game https://www.adafruit.com/product/2026 1 $44.95
Bluetooth HC-05 Module Bluetooth module with master mode capability https://www.velleman.eu/products/view/?id=435518 2 $14.95


Design & Implementation

The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.

Hardware Design

Discuss your hardware design here. Show detailed schematics, and the interface here.

Hardware Interface

In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.

Software Design

Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.

Implementation

This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.

LED Matrix

Steps to write to LED Matrix:

  1. Set output enable HIGH to disable LED output for selected row
  2. Set latch LOW to block shift register from pushing to parallel data output register
  3. Shift in 32 bits of data for R1, G1, B1, R2, G2, B2 for rows 0/16
  4. Set addr lines A, B, C, D to select rows 0/16
  5. Set latch HIGH to move shift register data into parallel data output register
  6. Set output enable LOW to display currently selected row
  7. Repeat this process for the other rows 100 to 200 times per second

Testing & Technical Challenges

//Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? //Make a smooth transition to testing section and described what it took to test your project.


The RGB LED Matrix presented several challenges from both a hardware and software standpoint.

Several of these problems are described below:

SPI vs GPIO

The LED Matrix works by shifting in data available at its six data ports: R1, G1, B1, R2, G2, B2. Early experimentation with an SPI interface involved testing data transfer through a MOSI to B1 and SPI_CLK to SCLK connection. While this worked fine for top half control with one color, more thought had to go into being able to transfer data to the 2 other top-half color ports as well as the bottom half ports. An approach that was tried was connecting MOSI0 to one of the three top-half data ports and MOSI1 to one of the three bottom-half ports. Because the matrix takes in a single SCLK input to shift in data for both halves, a high-speed multiplexer was connected to let the SJOne board select the SPI clock that would be shifting in data depending on which half would be receiving data etc etc.

With GPIO, the issue of having to write data to 6 data lines with only two MOSI lines was solved by just using 6 GPIO ports and a GPIO clock. Multiplexers to switch between two clocks and other data lines were no longer needed.

Sensitivity

The LED Matrix proves to be extremely sensitive to input and other factors. In order to get an accurate image with minimal flickering and visual glitches, both the data lines from the SJOne board to the IDC ribbon cable as well as the power cable itself have to be positioned a specific way. Without fiddling with the position of the wires, glitches such as mislit rows and off colors are prone to happen. This problem was initially thought to be a timing issue in software when trying to shift in data through SPI or GPIO with delays placed in between important parts of the transfer sequence like row selection and latch toggling. However, the problem was eventually traced to hardware.

Conclusion

Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?

Project Video

Upload a video of your project and post the link here.

Project Source Code

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

List any references used in project.

Appendix

You can list the references you used.