Arduino Leonardo Game Controller for Quadriplegics

by oliviaelliott in Circuits > Assistive Tech

622 Views, 5 Favorites, 0 Comments

Arduino Leonardo Game Controller for Quadriplegics

Screen Shot 2021-11-19 at 8.36.48 PM.png
Screen Shot 2021-11-15 at 10.28.17 AM.png

The objective of this project was to create a controller for quadriplegics/tetraplegics that is a cheaper alternative to controllers major companies are making. This controller uses the movement of your head and neck pressing simple buttons connected to an Arduino Leonardo. It uses mostly simple household materials or things you can find for cheap on amazon. The special case is the Arduino Leonardo or the more expensive alternative the Makey Makey. Let's get started



Instructional Video CLICK HERE

Supplies

  1. cardboard from any boxes around the house
  2. some sort of weighted material: metal pieces, bean bags, rice, anything you can find around the house
  3. tinfoil
  4. paperclips x3
  5. jumper cables
  6. resisters
  7. aligator clips
  8. box cutter
  9. wire strippers
  10. hot glue and hot glue gun
  11. solder
  12. soldering iron
  13. electrical tape
  14. micro usb cord
  15. conductive tape
  16. perf board
  17. Arduino Leonardo board
  18. Arduino Leonardo code
  19. Space Invaders HTML, CSS, JS files
  20. Moving Average Filter Library
  21. Makey Makey(more expensive but simpler alternative to Arduino Leonardo)

Wiring the Cirsuit Board

Screen Shot 2021-11-15 at 10.29.55 AM.png
Screen Shot 2021-11-15 at 10.36.44 AM.png

We start by making the circuit board that will control the whole controller and connecting it to the Leonardo

  1. First wire four jumper cables into the circuit board leaving space to add resisters next to them and solder them through to the other side of the circuit board. Use white, orange, yellow, and green jumper cables.
  2. Then put the resisters vertically across the jumper cables and stick the wires through. Lay one end of their wires so that they are touching by creating a line and solder them together. Lay the other end straight so that they are going the same direction as the resistors and touching the the jumper cable wires from step 1
  3. Strip four alligator clips and attach the stripped end to the straight end of the resistor wire where it connects to the jumper cable. Match the color alligator clip to the jumper cables. Solder the three things together. You should do this for each set of resistors, alligator clips, and jumper cables.
  4. Now take two more jumper cables and solder them through the circuit board. I used red and black. The red one needs to be connected to the resistors by soldering like we did earlier
  5. The black one is the ground and needs to go through the circuit board. Then you need to strip one end of 4 alligator clips and solder them all to where the black jumper cable comes through the circuit board.
  6. Now we need to plug everything into the Arduino. The red jumper cable goes into the port the says 5V. The black one goes into either GND port. The green one goes into A0. The yellow one goes into the A1 port. The orange one goes into the A2 port. And the white one goes into the A5 port.
  7. Plug the micro usb cord into the Arduino



Making a Box

Screen Shot 2021-11-15 at 10.31.22 AM.png
Screen Shot 2021-11-15 at 10.30.55 AM.png
Screen Shot 2021-11-16 at 9.13.07 AM.png

I laser cut a box, but it you don't have access to a laser cutter then you can just make one and hot glue it together.

  1. I made a 7.5 x 3 x 2.5 box, which is just big enough to hold both the Arduino and the circuit.
  2. On the top of the box make sure to make two 1 inch ovals so the wires can come through
  3. Hot glue it together but leave the top off so we can get things in and out if we need to.


Making the Buttons

Screen Shot 2021-11-15 at 10.30.44 AM.png

Making the buttons

  1. Cut out six three inch circle out of cardboard
  2. Take three of the circles and cover half of them with tinfoil like the one in the bottom left in the picture above
  3. Take the other 3 and completely cover them in tinfoil
  4. Glue the tinfoil down
  5. Cut a tiny hole into the middle of each of the half covered buttons, just big enough for an alligator clip to go through
  6. Next open a paperclip like in the picture above and stick one end into a circle that is completely covered and the other into one of the half covered buttons.
  7. Glue the paper clip in place


Making the Cardboard Piece

Screen Shot 2021-11-15 at 10.31.37 AM.png
Screen Shot 2021-11-15 at 10.30.36 AM.png
  1. Cut a 14 by 15 inch piece of cardboard, a 12 by 14.5 inch piece, and two 12 by 3.5 inch pieces
  2. In the 14 by 15 inch piece cut out a rainbow shape that is about 9 inches deep and 6.5 inches wide, this is for the neck but need to be able to fit over your head so you can make adjustments. Make it as small as possible while still being able to put your head and neck through.
  3. Now take the 12 by 14.5 inch piece and on each end bend a 3.5 inch ish piece inwards so it has a bend to it. Glue this down so that the bent pieces are inward about 45 degrees
  4. Now take the two long pieces (12 by 3.5) and glue the on the inside of the bent in part. Put it in the middle of the bent piece and the rainbow shaped neck hole. Do this on both sides
  5. It should now look like the picture above
  6. Glue the cardboard box from the beginning to the bottom of the back

Adding on the Buttons

Screen Shot 2021-11-15 at 10.31.09 AM.png
Screen Shot 2021-11-18 at 8.40.39 PM.png
Screen Shot 2021-11-18 at 8.40.53 PM.png

Now we need to put the buttons onto the structure

  1. Put the cardboard structure on and measure where the buttons need to go (one will be on the right, one on the left, and one in the middle for the back of your head. Make marks directly where the button needs to go and above the each button
  2. Create small holes where each mark is, and for the right and left you also need to make them through the other piece of cardboard as shown above
  3. Glue the buttons down but make sure you line up the central holes
  4. Weave the green alligator clip from the box through the right side of the structure and the button and attach it to the bottom side of the button (the one touching the cardboard structure) with conductive tape
  5. Now weave any black alligator clip through the hole above the button and attach it to the top of the button (the opposite side that you attached the green one to)
  6. Now repeat the same thing for the left side by using the yellow, and the middle by using the orange
  7. NOTE: we will not use the remaining black and white alligator clips



Adding Stability Weight and Straps

Screen Shot 2021-11-18 at 8.52.30 PM.png
Screen Shot 2021-11-18 at 8.52.46 PM.png

Now we need to add some weight to the front

  1. Get you weighted material that is relatively half the weight of the controller
  2. Create a box that your material fits in and glue it to the front bottom piece


Now for the straps

  1. I used red alligator clips but you can you string or anything that is like string
  2. Attach one end of each string and attach it to each side of the front of the controller with hot glue
  3. Try the controller on and wrap the strings across and to the back of your body and tie them
  4. Make sure they fit (adjust them if necessary)

Downloading the Arduino and Space Invaders Code

Screen Shot 2021-11-18 at 9.35.16 PM.png
Screen Shot 2021-11-18 at 9.28.58 PM.png

Arduino

  1. Download the moving average filter, the space invaders code, and the Arduino code from the supply list
  2. In your computer library search space invaders and the download should appear
  3. Open the file and double click the html to open the game
  4. Now open the Arduino that we downloaded and select sketch --> include libraries --> add .zip library, from your downloads select the moving average filter

Now plug the Arduino which should already be connected by mirco usb into your computer, you might need an adapter depending on your computer type

  1. Click tool in the navigator bar and hover over board. Select Arduino Leonardo
  2. Hover over tools again and select port --> Arduino Leonardo
  3. Comma out anytime you see any action using 3 (this simply mean to put a comma next to the end of the line)
  4. Change any output0 or output to key d, any output 1 to a, and any output 2 to a space
  5. On the main page on the Arduino click upload in the upper right hand corner (you will need to do this anytime you save the code)

Coding to Match

Screen Shot 2021-11-18 at 9.43.49 PM.png
Screen Shot 2021-11-18 at 9.44.15 PM.png

Now we need to match the arduino code to the space invaders code

  1. In your downloads find space invader folder and open it
  2. right click on script.js and from the drop down menu select open with --> text edit
  3. Find the first function moveShooter(e) and you will see it says case 'ArrowRight' and change it to d, for case 'ArrowLeft change it to a
  4. Scroll to the bottom of the code where it says switch(e.key), where is says case directly below it it might say case 'ArrowUp' or case 'ArrowDown' change it to case ' ' with a space



Congrats you have finished!! You can now help someone who is a paraplegic play space invaders. Have fun :)