# Sensor Switches for Carnival Game

#### Ehesner

Joined Oct 25, 2015
4
Each year at this time, I volunteer some time at one of our local grade schools helping to set up their annual Halloween party in the gymnasium. For next year, I'd like to build some sort of a new game for the event, and I've been thinking about something like a large clown face with holes in it into which the kids could try to toss balls (tennis balls maybe?). I can build some sort of wood pathways on the back side of the board to direct the balls back down to a box at the bottom front of the game, but I need to find some sort of simple sensor switches to locate inside each hole that would set off a number of colored lights (maybe in some sort of a circular pattern?) and maybe a siren or other noise-making device when a ball enters any one of the holes. The game would probably have to plug into a std 120-volt outlet, but I'd want the lights and circuitry on the back of the board to be low voltage so that there's no electrical danger to the kids. I could probably use a circuit diagram for such a game as well. Can anyone help me with this sort of a project? I'm open to any sorts of other ideas anyone might have. I wouldn't want it to end up costing a huge amount of money, but I'd be willing to put a little  into it to make something nice that the kids would get a kick out of.

#### Regular_hobbyist

Joined Mar 9, 2015
9
You could use an Arduino. How big and how heavy are the balls going to be?

The switches would be connected to the Arduino and the Arduino would set off the LED's in some fashion. You wouldn't use the entire Arduino in the project only the chip. I imagine the switches in this tutorial might work for you https://www.arduino.cc/en/Tutorial/Switch

About power supplies, you can probably use a wall wart (Like a phone charger) to power the project. Most wall warts around the house are 18 to 3.3 volts (These voltages are not lethal unless you lick the contacts). You can also build the power supply yourself. For your application the power supply would be easy to obtain, but that assumes your using led bulbs and not having any motors. This is what basically you'll be doing http://www.instructables.com/id/Make-a-simple-12-volt-power-supply/ Just replace the LM7812 with LM7805 . And make sure the pin outs are the same! Last time I checked they were.

You'll also need wood working skills to construct this unless you already have something built. It would also be a good idea to read this sites textbook on DC electricity.

#### Alec_t

Joined Sep 17, 2013
12,802
For the switches I'd use lever-actuated microswitches, which are pretty robust so would withstand a ball (e.g. tennis ball) dropping on the lever.

#### blocco a spirale

Joined Jun 18, 2008
1,546
Use long lever microswitches and fit them to the tubing with the lever protruding through a slot so that the tennis balls operate the switch as they roll through.

As for the electronics, you should look at off-the-shelf light chaser and noise maker modules and kits (plenty on ebay and Velleman have a good range). Buy or salvage a suitable regulated power-supply (12VDC at a few amps will suit most requirements), there is no point in making one. You will probably need to add timer modules to the switches to provide a long enough pulse to operate the effect and then you can hook up whatever you want. You won't really need any electronics knowledge, just the basics so that you can wire it all together.

Start by deciding exactly what you want.

#### AnalogKid

Joined Aug 1, 2013
10,051
Nothing guarantees success like a decent question. Since you have a year, take some time to figure out exactly what you want to do. This is a relatively simple problem to solve, so don't focus on what might or might not be possible electronically. I suggest breaking up the project into three areas, working out first the ones defined by external parameters, then letting the third one clean up the mess.

1. Inputs - overall game board (size, target locations and spacing, etc.), type of projectile (tennis balls + 6th graders don't automatically mix well), etc. Don't worry about the sensors yet.
2. Outputs - lights, sounds, locations (reinforcement lights around each target hole?).
3. Control - too early to tell. Arduino's are small, cheap, and give you a ton of logic horsepower. But do you need it? For example, target-specific lighting is a switch or optical sensor and a 555.

Overall, the project requirements and design decisions sound to me to be much more mechanical than electronic. I recommend assuming that there is no possible combinations of features that can't be solved by this forum with something within your skill set (BTW, what is your skill set?), work up your dream design, and then we can dig into the details of sensors and display controls.

ak

#### Ehesner

Joined Oct 25, 2015
4
Thanks, ak. I'll try to put together some solid ideas of what I want it to look like and what I want it to do, and then I'll get back to you.

#### Bernard

Joined Aug 7, 2008
5,788
Just for ideas: A ring of flashing LEDs about US $2.75 + the LEDs which run from .10 to .50 ea. Chasing LEDs about$ .75 more.

#### JohnInTX

Joined Jun 26, 2012
4,665
If you're going to interface with a uC, consider using an infrared detector. Maybe something like one in the attached datasheet.
The sensors see modulated IR light. Maybe a simple flood light (a few IR LEDs at the top inside the box) and each sensor near the hole so that the ball blocks the light momentarily when it goes through the hole. The arduino would scan the detector outputs (in a tight loop), do the score then wait awhile (to avoid false triggering from other sensors that may also see the ball later). Rack it up!
To generate the light, use a PWM running at 50% duty cycle at 38KHz (or whatever your particular sensor wants).
The nice thing about it is that the sensors are physically small (epoxy to the edge of the hole) and do not have any contact bounce issues.
A potential downside is that with a floodlight source, you have to ensure that only one hole gets hit first.

Thoughts?

BTW The datasheet describes old parts. If you like the idea, we'll find you some current ones..

#### Attachments

• 231.4 KB Views: 1

#### Bernard

Joined Aug 7, 2008
5,788
A snug fit of ball to hole is not desired, maybe hole diameter 1.5 X ball diameter which might make a mechanical switch unreliable. IR interrupter would be a good choice with either Mc or discrete IC's. For short separations ( 1 ft. or under) unmodulated IR works quite well and might be less expensive than switch.

#### AnalogKid

Joined Aug 1, 2013
10,051
If the target hole has a piece of PVC tubing to create a short tunnel, simple optical beam sensing would be very reliable without having to use beam modulation, and immune to contamination by adjacent sensors. I strongly recommend visible, not infrared, beams. A 90 degree pvc elbow would get you even more isolation, plus change the projectile trajectory toward the ball return without needing a giant backboard.

ak

#### Bernard

Joined Aug 7, 2008
5,788
Might have different hole sizes with smallest having highest score value.
Hole ring of LED's might have low level illumination always on with bright flashing on hit ( breaking beam).
Gilding the lily: Have a LED bar graph to track score.

#### Bernard

Joined Aug 7, 2008
5,788
Another ball source: Plastic balls as used in " Magic Castle", found two sizes, 2.21 in., & 2.49 in.
Put a pin, like finishing nail, at the top of each hole so that a ball rolling down from above will not register as a hit.