This is a quick and simple tilt sensor using copper tape, screws, and a metal marble that should only take you a few minutes to build, so you can concentrate on coding a really fun tilt game! This sensor design is courtesy of Aaron Graves!
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Create Earth
To create EARTH, use copper tape to wrap from end to end. Make sure you have tape on all sides of your pipe, but leave space between the tape, so when you insert the screw for left and right, they will not come in contact with the copper tape and register a false key press.
Since a ball will be making the connection, you will want your tape pieces placed really close together! Plus, you will want tape traces on the top, bottom, sides of the inside to ensure connections when people are tilting the pool noodle!
Once the screw is in place, the metal ball inside will connect the EARTH connections made with the tape to the left or right key press connected to the metal screws.
Step 2: Insert Marble
Place a screw through the pipe on one end of your pipe, and then place the metal marble inside.
Step 3: Create Left and Right Connections
Place another screw on the other end of your pipe and make sure the marble will make contact with each screw when you tilt left and right.
Use an alligator clip to connect one screw to the left arrow input on your Makey Makey and another alligator clip from the other screw to the right arrow key input on your Makey Makey.
Connect the white hook up wire that is connected to the copper tape to an alligator clip from the white wire to an EARTH input on your Makey Makey.
Step 4: Insulate
To ensure that hook up wire stays in place and to insulate the center of your sensor, use masking tape to cover the connection.
Then place your entire sensor inside a pool noodle! The alligator clips can come out one end or both ends, that is up to you! If you have the extra long alligator clips from the STEM pack, they are a great way to get more mobility and movement with this project.
Step 5: Design a Tilting Game
Now that you've made a tilt sensor, it is time to design a rad game in Scratch!
You'll want to make your main sprite to tilt left and right when the left and right arrows are pressed.
If you want to add scoring, you'll want to set the score to ZERO when the green flag is clicked.
You'll want to make a couple of sprites of falling things for your main sprite to catch (or avoid!) The third picture of code is the code we used to make raining tacos. This code will make a sprite appear in a random location at the top of your screen, and fall to the bottom, but return to the top in a random spot once it reaches the bottom of the screen. If you duplicate this sprite, you'll have more objects falling from the sky. Or you can move this same code to your backpack and add other sprites that will drop for your main sprite to catch.
We've also added the "increase variable" here, so that in our game if the taco touches the chick, your score will increase! In our game, we also made a cloud that falls and if the chick runs into the "falling sky" the score variable will decrease.
Here is our example project to get you started!
As a teacher, this project would be a great way to add coding to story project. You could also use this as an analysis tool. What other stories could be turned into a catching or chasing game? Or you could have students think about objects that might increase or decrease the main character's mood? Or you could have the objects that fall from the sky be plot points. There are lots of ways to use coding to emphasis concepts from literature!
What story will your students hack?