Arduino Leonardo Game Controller for Quadriplegics
by miles.boone in Circuits > Assistive Tech
187 Views, 1 Favorites, 0 Comments
Arduino Leonardo Game Controller for Quadriplegics
INTRO VIDEO: CLICK ME
Hi, my name is Miles Boone, and I am a student at Sonoma Academy in Santa Rosa, California. As a part of my AS Engineering for Social Good class, we were given the challenge to create a game controller for Quadriplegics to play a simple Space Invaders game that we made. Our goal was to create a simple yet reliable and cheap controller for families to create at home. The controller I built allows for shooting, left, and right movement all through an Arduino Leonardo Controller. The design I used allows for very adaptable mounting and a lot of customization. In this Instructable, I will show how I built my controller and explain some ways that you can adapt it for your needs. I hope my project can help many families and inspire others to create Assistive Tech.
Supplies
**YOU WILL NEED A COMPUTER OF SOME KIND, PC OR MAC DOES NOT MATTER BUT I WILL BE DOING THIS ON A MAC**
Supplies:
- A lot of cardboard and foam board (this can be scrap or bought from an office store)
- A role of tinfoil
- Masking or Duct Tape (several roles will be helpful)
- Alligator Clips (you probably want to get 2 to 3 packs as these are very useful)
- Large Velcro strips
- Some scrap wood (will explain exactly what pieces may be needed later)
- An Arduino Leonardo
- Makey Makey Controller OPTIONAL (This is an option if you don't want to solder your own board. A Makey Makey is simpler but more expensive, I will provide more details below)
- Perf Board (this one is a pack of 32 but you only need one large perf board)
- Jumper Cables (not for cars, but for the circuit)
- Extra Wire (can be harvested from small electronics or bought)
- Small Conductive Tape
- 1M Ohm Resistors (you really only need 3 or 4, but they only really sell in packs of 100)
- Zip Ties (again you will only really need a few)
- USB Micro B to USB A
- USB A to USB C (if you have an Apple Macbook is USB C)
- 1-1/4 Inch Screw (these can be any screw that is about 1-1/4 in long, you will only need a few)
Tools:
- Soldering Iron (if you don't have one, I recommend getting one from Harbor Freight as they are very cheap)
- Hot Glue Gun (and lots of hot glue sticks)
- Drill/Driver (needed for drilling holes and putting in the screws, if you don't have one you might be able to do it by hand with a hand drill and screwdriver)(I included a link to a very cheap one if needed)
- Drill Bits and the appropriate screw bit if using a Drill/Driver
- Laser Cutter (YOU DO NOT NEED THIS, but if you own one or have access to one it will be useful, I used the laser cutter to cut out a box to hold the components but you can just as easily create one out of cardboard)(see below or information on laser cutting)
- Scissors
- Box cutter
Makey Makey:
If you decide to use a Makey Makey, instead of the homemade design, you will not need:
- Arduino Leonardo
- Perf Board
- Jumper Cables
- 1M Ohm Resistors
- USB Micro B to USB A
Download Game And/Or Arduino Files
There are two files available for download. The first file, Space Invaders Game Download, is the game files. The second file, Ardunio Files Download, is the Ardunio code. YOU ONLY NEED TO DOWNLOAD THE ARDUINO CODE IF YOU ARE USING THE ARDUNIO AND HOMEMADE CONTROLLER, IF YOU ARE USING THE MAKEY MAKEY YOU DO NOT NEED TO DOWNLOAD THE ARDUNIO FILES.
To Download:
The link below will take you to a google drive folder. Simply click on either one of the folders in that main folder. Once you are in the selected folder simply double-click on the folder and click the Download Button.
Folder:
Game Files: CLICK ME TO DOWNLOAD
Arduino Files: CLICK ME TO DOWNLOAD
Arduino Software
IF YOU ARE USING THE HOMEMADE ARDUINO CONTROLLER, YOU WILL NEED TO DOWNLOAD THE ARDUINO SOFTWARE. **IF YOU ARE USING THE MAKEY MAKEY YOU DO NOT NEED TO DOWNLOAD THIS SOFTWARE!**
**ALSO THIS DOWNLOAD LINK IS FOR MAC IF YOU ARE USING A PC PLEASE DOWNLOAD THE APPROPRIATE SOFTWARE FROM THE ARDUNIO WEBSITE**
To download:
Use the link below and follow the instructions on the Arduino website. Then open the downloaded file and follow the instructions to complete the installation.
Link:
OPTIONAL: Laser Cutting Box
This step is optional. and dependent on whether you own or have access to a laser cutter. If you do have access to a laser cutter, this step requires some knowledge on how to use one. Since every laser cutter is different I can not provide exact instructions on how to cut it. I will provide the files I used to cut the box. To assemble the box I just used some masking tape but you can use wood glue or hot glue.
Link:
Creating Controller
(**This is going to be the most difficult step so pay close attention to the images and instructions. IF YOU ARE USING THE MAKEY MAKEY SKIP THIS STEP**
This step is going to use: The perf board, the resistors, the jumper cables, some alligator clips, the extra wire, and the Arduino.
The first step is going to be to solder the perf board. If you do not know how to solder I will include a tutorial here. You will need to solder 5 jumper cables to separate rows in the perf board. 1 jumper cable will connect to the 5V power on the Arduino to the first row on the perf board. You will need to run a wire length-wise across all 3 of the resistors from the power wire. The first and second images are color-coded: RED is the power; BLUE is the three separate resistors; BLACK is the ground. There are three jumper cables coming off of the Arduino: Yellow: A0; Green: A1; Orange(NOTE I USED A RED ALLIGATOR CLIP FROM THE PERF BOARD AS I DID NOT HAVE A ORANGE ALLIGATOR CLIP): A2. Each one of those jumper cables runs to a different row on the perf board. Then each one of those jumper cables connects to a different end of a resistor. The other end of that resistor connects to the power wire. From the end of the resistor that the jumper cable is connected to you connect an alligator clip, whose end was cut off. That way you have three different alligator clip wires coming off. The last step is to connect the ground wire, BLACK. Connect a jumper cable to one of the GND ports on the Arduino. From there solder that jumper cable to the far corner of the perf board, we DON'T want the ground to touch any of the wires connected to the power and resistors. From that spot solder another alligator clip, with no end.
Makey Makey Step
**ONLY DO THIS STEP IF YOU ARE USING THE MAKEY MAKEY!! IF YOU ARE USING THE HOMEMADE CONTROLLER FROM STEP 4 SKIP THIS STEP!**
If you are using the makey makey this step will be easy and quick. Simply connect an alligator clip to the SPACE port on the back of the Makey Makey. Then connect an alligator clip to one of the EARTH (Ground) ports on the Makey Makey. Then use a jumper cable to connect to the A port on the Makey Makey, then connect an alligator clip to the other end of that jumper cable. The last step is to connect a different jumper cable to the D spot and then another alligator clip to that jumper cable. After connecting the alligator clips you should have 4 alligator clips coming off of the Makey Makey; an EARTH(GROUND) wire, a SPACE wire, a A wire, and a D wire. This step is now complete
Using Laser Cut Box or Cardboard
If you used the laser cutter, in Step 3, now is the time that you will need to assemble it. Like I said above you can use anything like tapes or glues. If you do not have access to a laser cutter you can just create a box out of cardboard. The box I made was 5in wide, 6in long, and 2in tall. This box will hold all of the electronics. I then drilled 2 holes in my box, one for the alligator clips to come out and another to take the power wire out. If you are using either the ARDUNIO or the MAKEY MAKEY you will use a USB Micro B cable to connect to your computer and power.
Creating Headband
This step will show how you will make the grounding headband for the controller. This step is pretty easy!
I started off by taking a piece of foam board, about 3-4in tall, and started to bend it into a circle. Once I got a pretty good circle I fit it to my head and then taped it in place using some masking tape. Once I had by headband created the next step is to wrap it in aluminum foil. The foil will act as the conductor between the headband and the outer ring. I simply just used multiple pieces of foil until the entire outside of the headband was covered in a good layer of foil. After wrapping and securing the foil I used a piece of conductive tape to wrap all the way around the outside of the headband. This tape will ensure that when we attach the ground wire it will spread the conduciveness all around the headband.
Creating the Outer Circle
This step will show you how to make the outer circle that will house the 3 different touch surfaces.
I started this step again by taking a piece of foam board, again about 3-4in tall, you will need a longer piece for this one. I again started to bend it into a circle but this time we will not be taping it shut. Instead, you have a pretty big circle, enough room to be able to move the headband quite freely without touching any of the sides. On the two open ends, I used velcro in order to make the outer circle adjustable and easy to put over anyone. The next part is a little bit more difficult as you will need to attach three separate pieces of foil around the circle. One on the opposite end of the opening (although it is best to wait to do this one after step 9), another on the left of that first piece, and lastly one on the right of that first piece (see photos). Once you have the foil attached using some tape you will need to create a pole (see next step)
Creating Pole/connection Point.
This step is used to connect that outer circle from step 8 and make it able to attach to a chair.
I started by taking a piece of cardboard, probably about 2 or so feet in length, and folded it a couple of times to make a sturdy pole. I then wrapped it in masking tape in several areas to make it very secure. To secure the pole to the outer circle I used masking tape and wrapped it around both until it was. securely on there. I then attached that first connection point over where I had just connected the pole. See the images above to see what it should look like. I will later show how to connect it to a chair.
Attaching Box and Running Cables
This step is pretty easy but you will need to make sure you know the colors of the wires correctly coming off of either the homemade Ardunio controller or the Makey Makey.
I started by putting the laser cut box(or the cardboard one) about halfway down the pole and on the opposite side has the outer circle. I then drove in some screws from the side with the outer circle so it would go through the cardboard pole and into the box. I used pretty short screws about 1-1/4in. Once you have the box attached with either the homemade controller or the Makey Makey inside and the 4 alligator clips coming out of the box it is now time to run the wires. The GROUND(black) wire can stay loose from the box as that will be with the headband, the other three wires, Yellow, Green, and Red/Orange will be run along the pole towards the outer ring at the top. You may need to connect other alligator clips to the existing ones to lengthen them.
Once you have the three wires up to the outer circle, we will attach the Red/Orange wire to the connection point at the back of the circle, the one that is with the pole. I cut off the ends of the alligator clips in order to expose the wire and then I taped it to the foil using conductive tape and then hot glued and tape the wire to really get it secured. You can also just clip on the alligator clip to the foil, making sure it has good contact and taping/gluing that too. W will then run the Green wire to the right of that connection point so it is on the right of the outer circle. I then repeated the connection technic to attach it. Lastly, I ran the Yellow wire to the left side of the first connection point and again repeated the same connection technic to attach it.
You should now have the Red/Orange, Green, and Yellow wires attached, but NOT the Black wire.
Attaching the Ground Wire
This step will be focusing on attaching the Ground(Black) wire to the headband.
I attached several more alligator clips to the black wire in order to lengthen it has you want a lot of mobility with this piece. Once I had enough wire I, again like in step 10, removed the clip head and taped, using conductive tape, the open wire to any part of the headband. I then added lots of hot glue and tape as the headband will take a beating and we need to ensure the wire does not come unattached.
Attaching to a Chair
This step is VERY customizable and it is really important that you mount it perfectly for your needs.
I started off by lengthening the pole by using a piece of wood. I chose a pretty long but small piece and then cut it down for my height range. This piece of wood will serve as a good anchoring point for attaching. I then chose the chair I was going to use and saw that it had a lower bracket that I could use to attach. I then figured out the height that I need. I chose my height by sitting in the chair and having a friend move the outer ring and pole around until my head, with the headband, was perfectly able to hit each of the connection points. I then used a small piece of a 2inx4in piece of wood at that height point right near the bottom bracket. I then used velcro in order to attach to that bottom bracket, but you can use anything to attach it.
As is said above the step is VERY customizable and I can not provide instructions for everyone. I explained just above how to figure out the height and once you have that you can really attach it any way you want to.
Moving on I realized that once I had the pole attached that it wanted to fall back so I then used some foam board to go over the back cushion of the chair and then zip tie into place at the other end.
Running Arduino Code
This step is ONLY IMPORTANT IF YOU ARE USING THE HOMEMADE CONTROLLER WITH THE ARDUINO!
**IF YOU ARE USING THE MAKEY MAKEY SKIP THIS STEP!!**
Make sure you have the Arduino software downloaded and installed along with the Ardunio files I provided in Step 1.
You can simply open the Ardunio file, it should be called: DIY_MAKEYMAKEY_CODE, I provided and it should open up through the Ardunio software. Once you have the code open you will need to change a few settings.
PLUGIN YOUR ARDUNIO USING THE MICRO USB B TO USB A CABLE.
Start by navigating to the TOOLS menu selection in the top left, MAC users, and scroll down to Board. From there make sure you select the board: Arduino Leonardo. This should be the only setting you will have to change. If you run into any more issues please either leave a comment or research online. Once you have the setting changed go back to the main page and push the Verify button, the circle with a checkmark inside. This will ensure the code is working. Give it a couple of seconds and at the bottom, it should say: Done Compiling. Then, with your Arduino still plugged in, push the Upload button, the circle with an arrow pointing right. Again give it a couple of seconds and it should say Done. You are now done with the Arduino software, BUT please LEAVE the Ardunio plugged in.
Running the Game
Once you have everything set up with the Arduino, you can test it by opening a new tab in a search engine and touching the headband to the different connection points. The back point should activate SPACE. The left of the back point should activate A. The right of the back point should activate D. IF THIS IS NOT WORKING PLEASE MAKE SURE YOU FOLLOWED THE STEPS AND IMAGES ABOVE. A common troubleshooting trick is to swap around the jumper cables in case you accidently ran one of the wires to the wrong connection point.
If everything works, go back to the downloaded games folder, it should be called: space-invaders-master. Open the: index.html file in a new browser tab. The game should start on its own.
To play place the headband over your head and then sit into the outer circle ring. To shoot, move your head back so you make contact with the back connection point. To move right, move your head to the right so it makes contact with the right connection point. To move left, move your head to the left so it makes contact with the left connection point. When the game is over simply reload your page (CNTL R) to play again.
Enjoy!
Thank You!
If you have any questions please post them in the comments!