Maker Pro
Maker Pro

Ball wall target board

Johan_Ha

Apr 26, 2017
13
Joined
Apr 26, 2017
Messages
13
I thought of creating a target board for kicking soccer balls or throwing tennis balls. It would use three piezo sensors placed equilaterally under a thin plywood board. The purpose of the plywood board would be to distribute the impact force to all piezos. Then I'd measure each sensor. Determining where the hit occurs and the magnitude of the hit is all mathematics and calibration. Each piezo would charge a capacitor when a ball impact happens. A microcontroller would measure the length of the discharging of the capacitor.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
Welcome to EP, Johan.

Nice idea. Any questions?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Yeah, I've seen the same technique used as a method of determining where you poke a screen (with sensors under the base of the monitor)

For a really large board, you may also have to consider the time delay of the impulse reaching the sensors (effectively giving you two ways to locate the impact.

I think you'll probably want to damp any vibration or constructive/destructive peaks caused by the vibration bouncing off the edges resulting in peak forces possibly occurring at places other than at the closest sensor.
 

Johan_Ha

Apr 26, 2017
13
Joined
Apr 26, 2017
Messages
13
My questions come later. I'm quite a novice with electronics, but not with programming. I know what the components do, but I know nothing about the values of the components that I should use for this. I know from examples that piezos can be used as press switches, but I'm interested in measuring the actual force of the impact. That's why I had the idea of charging a capacitor and measuring the time it discharges. Everything needs resistors and whatnot. And the logic would poll three different ports. When one goes up, I know the nearest piezo. Then the logic checks the time for the second and third piezo port to go up. And finally records the time for all three to go down.

Good point about the damping. Probably a thin foam plastic film between the plywood and the piezos. As well as a similar film under the piezos and a thicker plywood.
 

AnalogKid

Jun 10, 2015
2,893
Joined
Jun 10, 2015
Messages
2,893
A peak detector circuit per sensor would capture the peak signal voltage associated with the initial impact in real time, then hold it for the controller to come along and read. The multiple detector circuit outputs can be threshold-detected and OR-ed to form a single trigger signal to tell the controller there has been an impact somewhere. The controller then polls the sensors rapidly to capture the timing information.

Hmmm... Given that the timing differences will be in the low milliseconds, polling might not be fast enough, so you might need three stopwatch circuits. Easy to do in hardware, or sprinkle around three PICs at the sensors and one PIC as the controller/display driver, and everyone talks over I2C.

ak
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Have the three or four sensors trigger interrupts. This should allow you to get highly accurate timing.

Beware that if your surface is non uniform, the propagation through it may not be linear. The grain in wood is one example.

Assuming the surface is vertical, there may also be some non linearities caused by the varying load.

Even with this, you might be able to "train" the device by hitting it in a grid, then looking for the best fit for a random strike, interpolating if necessary.
 

Johan_Ha

Apr 26, 2017
13
Joined
Apr 26, 2017
Messages
13
Here's a circuit I had in mind.
piezo.png
The piezo charges the capacitor C1, which discharges through R1. R2 might be needed to avoid high peaks from the piezo to go further. This is just a wild guess and something I know very little of. Maybe an inductor is what is needed. While there's a charge on C1, the potential at P0 is zero. When C1 is discharged (threshold yadda yadda), the transistor closes and the potential at P0 becomes 3 V.

So it became a bit backwardish. P0 holds a logic 1 when no activity, then it goes 0 for a moment. At this point I have absolutely no clue of how fast the controller can count and how long discharging times for C1 I need for the logic to be accurate enough. Of course I could incorporate circuits that handle this, but a part of the fun is handling all this with just simple components and simple logic. I don't know all the capabilities of Micro:bit. I know that P0 can read analog values, too. And it might be able to read pulse lengths, too, which would make it a bit simpler.
 

Johan_Ha

Apr 26, 2017
13
Joined
Apr 26, 2017
Messages
13
And it would be even more fun to re-use some piezo elements found in some trash electronics. Perhaps a microphone from an old wire telephone.
Yes, I'm most sure I have to develop some testing and calibrating. I checked the ports of Micro:bit and it seems it has no inner circuit for measuring pulse length, though it can generate pulses of a precise length from simple commands. If measuring the pulse lengths just by looping and counting will lead to too inaccurate results, I guess I have to use the peak detector circuit approach.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
That circuit will give you the timing of the pulse, but not the magnitude. However it is simple.

Piezo transducers have been used with microcontrollers to detect things being struck, so googling "piezo input Arduino" might yield some useful results.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
This thread has some interesting information on how to detect the time between 2 inputs changing.

They note that a resolution of a couple of millionths of a second is relatively easy, and with some devices a small fraction of a millionth of a second can be achieved. Other microcontrollers may vary.
 

Johan_Ha

Apr 26, 2017
13
Joined
Apr 26, 2017
Messages
13
That circuit will give you the timing of the pulse, but not the magnitude
We have the original pulse at the piezo. It has a peak of some height. It may oscillate a bit on the positive side. Sure the peak height on itself would be enough information for me. But my hope was that the capacitor turn the whole pulse -- the height and the length, or the area actually -- into a length. In the end, all that I want is a measurement of how fast a ball hits the wall. Not in m/s, but any linear or nonlinear value, as long as a fast ball gives a higher value than a slow ball. Using different balls would give different values for same speed, but that's no problem. Though if calculation of the location of the ball hit relies on the magnitude of the three piezos, I might have to calibrate the calculation for diffferent types of balls.
 

Johan_Ha

Apr 26, 2017
13
Joined
Apr 26, 2017
Messages
13
I skipped the idea of measuring the time for the pulse to discharge. I tested a simple peak detector circuit and it seems to work. Thanks for the tip, AnalogKid.
It's enough for me to be able to measure voltages from three identical circuits. I don't mind having voltage drops over diodes and other inaccuracies, as long as I get three values that can be compared to each other. I probably don't need a common signal to make the controller read the three circuits. It can read them continuously, and when one of them raises, it should wait for a moment then read all three circuit voltages, then trigger each circuit transistor to discharge. And wait forthe next impact to happen.
 

Johan_Ha

Apr 26, 2017
13
Joined
Apr 26, 2017
Messages
13
Shocky.png
Something like this. A peak comes from the piezo. It charges C1. D1 prevents it from discharging. P0 has an analog input, which reads the voltage. After that, P3 triggers Q1 to discharge C1. I've tested this without a transistor, just a jumper wire to do the discharging. There's a voltage drop at D1, but I don't mind that. I'll have three identical circuits (connecting to analog inputs P0, P1 and P2, as well as similar digital outputs as P3). And what I care of is comparing the three inputs with each other.
I have no oscillograph, instead I just plot the value at P0 to figure out how the signal looks like. Without D1 it just made small bumps. With D1 it took steps up for each shock on the piezo. But hitting on the piezo several times made it go up several steps. I need to put in more resistors and use a smaller capacitor to make it charge faster to the maximum. One single hit on the piezo should raise the voltage immediately to the top. Not just one small step at a time.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
You're probably better off with Q1 being a mosfet
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
It acts like a low value resistance when turned on, rather than having a small voltage drop across it. This means the capacitor will be more completely discharged.
 
Top