Posts: 1
Joined: Sat Sep 30, 2017 9:09 am

Mario "?"-box punch sensor

Sat Sep 30, 2017 9:36 am

Hi everyone, I am getting prepared for a trunk or treat event and was thinking of making a fun little Mario themed game for kids. The idea is have 4 question mark boxes hanging and having the kids punch the one that lights up.(or maybe have them hit one and see what prize they get, still undecided) Originally i thought i could do it on an Arduino, but then i thought about having it play a random Mario sound, when hit, through a speaker and it does not seem the Arduino can do that very easily, i might be wrong.

I have an original Model B pi with the 26 pins, and was thinking of getting a breadboard attachment, and using something like this fast vibration sensor https://www.adafruit.com/product/1766

or this tilt ball switch https://www.adafruit.com/product/173

to detect when the box is hit, then have the pi output the sound.(Depending on the game maybe light up the LED inside as well) The LEDs and sensors would be inside the box, the sensor probably taped to the bottom of the inside.

In my head it sound pretty straight forward, i was wondering on everyone opinion though because its easy to oversimplify something like this.

Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: Mario "?"-box punch sensor

Tue Oct 03, 2017 8:58 pm

It sounds simple enough. The one thing that may catch you out is the time the switches make contact for. It could be pretty short, so you'll need quite a high sampling rate.

Personally, I'd go for the vibration sensor and probably just keep reading the GPIO pins as quickly as possible while it's not triggered. I expect you'll only need a couple of kHz so pretty much any programming language should be fine, just don't have long sleeps.

When it's playing sounds and lighting up, you won't really need to check the switches anyway.

Return to “Automation, sensing and robotics”