Type of sensor to use for interactive target

Thread Starter

beachready83

Joined Dec 26, 2023
3
Hopefully I am posting in the right forum.
I am trying to create a light up target using some LED strips and clear thin laminate material. When a ball, tennis or golf ball hits it, I would like to trigger an LED strip and some music. What would be the best sensor to trigger the lights and music? This will spend time outside, so it might be raining at times, I am looking for something that will be accurate. We tried a proximity sensor and that did not work well. Any help is appreciated! Thank you.
 

Ya’akov

Joined Jan 27, 2019
10,226
Welcome to AAC.

Immediately, two ideas come to mind.

First, and probably my preferred solution of the two, is a sound sensormodule. This is basically a microphone and a small circuit to latch the output and some parts to adjust gain. If the microphone capsule is attached directly to the target, and the gain is set very low, only the acoustical energy of an impact will be enough to trigger it.

1703673320898.png
a very typical example of a sound sensor module
for all of these parts always buy at least two,
three is even better—nothing more frustrating
than killing the only one you have

The second is some variation of a vibration sensor. The most common type uses a switch made of a coil spring as one contact and a wire situated in the center of the spring for the other. And impact makes the spring move and collide with the wire, closing the circuit.


spring type—the blue part at the top is the sensor spring


Another variation uses a ceramic piezo disk. This is very similar to the sound sensor in that the disc produces a voltage when there is an impact and the module processes it to make it a switch closure.

1703674087786.png
piezo type—the black disk is the piezo sensor

Any of these will require handling a logic level signal that might be activated several times from a single impact. Ideally, you would use a small, simple MCU (Microcontroller Unit), like an Arduino compatible development board to handle the sensor(s) and control the lights and sound.


the LOLIN D1 Mini—for scale, the silver bit is a Type-C connector
the D1 Mini is a very popular, cheap, well supported board with
an ESP-8266 MCU so, as a bonus, it can do Wi-Fi which means
easy control with a phone or a computer—endless possibilities…


For the lights and sound, if the MCU is there, you can use individually addressable LEDs, like WS2812x variants, and do any sort of light show you desire with color and motion. These are readily and cheaply available in strips and there are a couple of excellent software libraries that make controlling them simple.

1703674908880.png
addressable LED strips come in a variety of densities up to
60 LEDs per meter, and with weather protection up to IP67
they offer independent control the R, G, and B chips for any
color you might want, and can do complex animations easily

For sound, an MP3 player module would be perfect. There are some nice ones, again readily available and cheap. My favorites are based on the JR6001 chip and allow you to load up the sounds you want played by turning into, effectively, USB drives that you can simply drag and drop files onto. You can also select from an effectively unlimited number of those based on circumstances, or at random.

1703675271804.png
MP3 player module—this one is based on the
JR6001 chip and has an excellent feature set

This isn’t going to be a plug-and-play solution, simply swapping your proximity sensor for something else, but despite the scary looking learning curve with the resources currently available in terms of parts, tutorials, and example code—and the help you can get here—it is completely attainable. And, when you are done, you get to keep all the skills you’ve learned for even better future projects.

Hard at first, it gets much simpler and quite fun very rapidly at a certain point. It also offers the chance to do so many other things, it’s a bottomless pit of really cool stuff.
 

Thread Starter

beachready83

Joined Dec 26, 2023
3
Wow thank you for the very through response. I've been all over the internet trying to get some help, and this is by far the best resources I have attained. I think I will order a sound and vibration sensor to test both, my only concern is if it rains somewhat hard, if either one of those would be triggered by the rain. The other concern is one of the targets we are planning on making is about 3m in diameter, I wonder if a single sensor could work, or would multiple be needed?
 

Ya’akov

Joined Jan 27, 2019
10,226
Wow thank you for the very through response. I've been all over the internet trying to get some help, and this is by far the best resources I have attained. I think I will order a sound and vibration sensor to test both, my only concern is if it rains somewhat hard, if either one of those would be triggered by the rain. The other concern is one of the targets we are planning on making is about 3m in diameter, I wonder if a single sensor could work, or would multiple be needed?
Glad I could help.

Rain could be a problem. If I wanted something certainly immune to hard rain I would probably arrange to have the target movable on some sort of linear bearings forming a ramp so that a strike on target anywhere would cause it to move predictably backward so it could actuate a low actuation pressure switch or switches—or perhaps an optical arrangement., and gravity would return it to the ready position.

This is obviously more complex than the other approach, and if you could shield the target itself from direct rain I believe the audio sensor would work, properly adjusted.

By solidly attaching the microphone (or piezo) directly to the target, a hit anywhere would certainly trigger either one. Both are effectively using acoustical energy for detection which is very efficiently transmitted by solid items.
 

PhilTilson

Joined Nov 29, 2009
152
A very thorough response, indeed!

My only additional suggestion would be to look at using an accelerometer module. These are very inexpensive and will interface directly to an MCU. The advantage is that sound wouldn't trigger the output and even rain falling or hitting the target should be easily 'tuned out'. The signal from the impact of a golf or tennis ball should be easily distinguishable from any 'noise'.

The other advantage is that the module could be completely sealed against the weather, but still be fully operational, which might be harder with the other options.
1703940931457.png
 

Ya’akov

Joined Jan 27, 2019
10,226
A very thorough response, indeed!

My only additional suggestion would be to look at using an accelerometer module. These are very inexpensive and will interface directly to an MCU. The advantage is that sound wouldn't trigger the output and even rain falling or hitting the target should be easily 'tuned out'. The signal from the impact of a golf or tennis ball should be easily distinguishable from any 'noise'.

The other advantage is that the module could be completely sealed against the weather, but still be fully operational, which might be harder with the other options.
View attachment 311249
An accelerometer is a potentially good method, definitely a sensible choice. I didn’t mention it because the complexity of implementing it is somewhat higher than the simpler go-no go sensors. Where the sound and vibration sensors can be adjusted so they won’t produce any output unless it achieves the level of (potentially) a positive result.

This doesn’t mean there won’t be any false positives, but filtering them should be trivial. The accelerometer starts out with a need to have some sophisticated filtering—but this could be a benefit if the other sensors do end up producing bogus positive results that aren’t easily ignored (e.g.: rain).

Even if the accelerometer registers the rain (and it will, if the amplitude is enough to make it through the attenuation applied to the sound sensor, it should be possible to characterize the rain and filter it as noise in the code that already needs to interpret the detected motion.

And, while I do believe the accelerometer will be detecting the raindrop strikes I think you are correct that it would be naturally immune to ambient sound. (Ambient sounds aren’t likely to be a problem for the sound sensor either since it will bonded directly to the target and so effectively deafened to high frequency sound, in addition to the very low sensitivity setting.)

As for as resistance to outdoor conditions, I think they are equally easy (or hard) to weatherproof. The fact the mic capsule will be attached directly to the target makes the hole in it moot.

Nonetheless, it is a good idea and should be considered.
 

Thread Starter

beachready83

Joined Dec 26, 2023
3
I will try out both methods, thank you both for the responses. Hopefully I wont run into any issues, but if i do I'll definitely come back here!
 

jiggermole

Joined Jul 29, 2016
185
with the accelerometer you can poll it and look for a significant difference in any of the axes between polls and call that an impact. And when you're done testing you can seal it in with hot glue. Don't have to get fancy.
I used a similar sensor to the spring and wire one in a can and had a small attiny micro to drive an led for a set amount of time. Used it to detect an impact on a firing range. Worked pretty good. It had its problems so testing multiple different sensors is definitely the way to go. Used a bit of epoxy to put the sensor down on the back of the heavy plate and used silicon seal it up. That's why I recommend hot glue. Its easier to clean up than silicone.
 

Ya’akov

Joined Jan 27, 2019
10,226
with the accelerometer you can poll it and look for a significant difference in any of the axes between polls and call that an impact. And when you're done testing you can seal it in with hot glue. Don't have to get fancy.
I used a similar sensor to the spring and wire one in a can and had a small attiny micro to drive an led for a set amount of time. Used it to detect an impact on a firing range. Worked pretty good. It had its problems so testing multiple different sensors is definitely the way to go. Used a bit of epoxy to put the sensor down on the back of the heavy plate and used silicon seal it up. That's why I recommend hot glue. Its easier to clean up than silicone.
I would probably counsel against potting the sensors with hot glue for at least a couple of reasons—

  • Maintenance—you can’t, but then any solution that involves potting has this same problem. I am a fan of weatherproof enclosures myself, you can even weatherproof enclosures not intended as such, but usually that requires reapplication of the treatment if you need to open them. Still, you can open them…

  • Dubious weather proofing—while it is surely possible to use hot glue to weatherproof, being sure you‘ve done it is not very easy. Water is devious, and in places with a ≥0°C winter, it‘s like it was designed to foil the best laid plans of mice and weatherproofers.

    The least (effort), best option in my experience is an electronics grade RTV. The “electronics grade” bit is important! Silicone based adhesives and sealants, not specifically made to avoid it, produce corrosive acetic acid (the source of the vinegar smell as they cure) which is not the best treatment for electronic components.

That said, hot glue could work, and I would probably try it in a pinch but not as Plan A.
 
Top