Stupid Pet Trick: I box, you box

So I had this grandiose plan for building a boxing trainer. It had different rounds, it had a switch for lefty and righty configuration, it split out random combinations, and then could tell if you entered the combination correctly.

I ran into a lot of bumps along the road of this project. The biggest one was working with the piezos themselves. They are so delicate that the legs broke off nearly right after purchasing them. And soldering those suckers was a pain in the arse! I think half the time I spent on this project was either soldering the peizos or fiddling with them when on of the legs broke off.

I was also nervous about physically building an interface. I was in the shop when I noticed a lot of students using the laser cutter, so I drew up a simple interface reflecting my grand dreams of the project and had it etched on a piece of wood I found in the unclaimed scraps.

I began with a small circuit: 2 analog sensors (what i  had with me at home at the time; pressure sensor and on piezo), and 1 LED. From there I started badding more LEDs: 3 red ones for the rounds and a bigger blue and green ones to represent each punch.

Then i dove straight into the programming logic and things got a little complicated. I found that though i would hit the sensor once I would get several “knocks!” over the threshold I set and Arduino would understand it as 2 punches. To get around this, I delayed the program for one millisecond and that seemed to work.

While I ultimately wanted the arduino to show a random combination of varying lengths for each round, I started out with a fixed combination for each. Then to test if the user inputted the same combinationi used nested if-statements. That didn’t really work.

I met with our instructor Scott during office hours. I wished I was a bit more prepared and organized with specific questions. I felt like i had most of the pieces but things hadn’t really come together. Just talked it out with him was really helpful. His advice: start small, get one thing at time working, then build on top of that.

I took his advise, went home and started over. By starting over I was able to figure out how to save a sequence of punches to an array. And that’s how I ended up with this little, “stupid” application.

You punch a combination and it’ll show it back to you. That’s it. There are still three rounds. Round one will wait until you input 3 punches; round two, 4 punches; and round three 5 punches.

Stupid Pet Trick: Boxing Trainer, setup

I’m preparing my project the Stupid Pet Trick. First I want to get the circuit ready before building the interface (the part I’m most nervous about).

My plan is to use two piezo elements to detect knocks on the focus mitts. I will be using 8 LED lights for indicators:

The Rounds
1. Round 1
2. Round 2
3. Round 3
The Punches
4. Jab
5. Cross
The Feedback
6. Nope
7. Not Bad
8. Knock Out

If I have time, I will also include a switch for making the game lefty or righty.

Stupid Pet Trick Ideas

For my stupid pet trick assignment, I have two ideas I would like to discuss in class.

The first is a boxing trainer. I will hook up two Peizo elements, one to each focus mitt. The output will  be a box with some words cut out. There will be lights behind the words that will light up depending on the output. The Arduino will keep track of rounds, punch combinations, and amount of pressure received from the punch.

The game will look something like this:

Round one begins.
Arduino spits out a random combination of jabs and crosses (up to 4 punches total), always beginning with a jab (because in training and in fighting, you would never start a combination with a cross).
Lights turn on to show the combination to the player.
The player then punches that combination on the focus mitts.
The output lights up to tell the player whether they were successful or failed.
There’s also an output for a successful combination If the player failed, the same combination is displayed; the round continues.
If the player successfully completes the combination, the next round starts.
There are three rounds. Round 2 has a combination of 5 punches. Round 3 has a combination of 7 punches.
There’s a switch on the display for choosing lefty or righty. Choosing lefty will switch the sensors for a jab and a cross.

The second idea is a contraption that attaches to your feet and it will measure how much pressure is applied to your step. The output is a series of lights. If all the lights light up, your step is too hard and the neighbors downstairs are grumbling. This is similar to the Strength-o-meter.

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.