Multiplexing analog inputs

I’m planning a target board for throwing a ball against a wall. My first approach was to use piezo elements to detect the hits. My second approach is using velostat sheets to detect pressure from the ball. This second approach got me to this idea, probably nothing new, but anyhow, I couldn’t quite find anything similar on this forum.

A stripe of velostat can detect pressure. Used together with a resistor, it can act as a voltage divider:

Pressing the velostat stripe will cause the voltage at A0 to drop. Then I thought of replacing the resistor with another stripe of velostat:

Pressing the other stripe will cause the voltage at A0 to rise. Sure one can add more strips to the same analog input A0, but since we’re talking about velostat sensors, there will be problems with accuracy. But as far as we have only two stripes per analog input, we should be ok. At startup, the value at A0 could be read and saved. Then, when in action, one would only have to care of voltage raise or voltage drop. It’s almost as accurate as digital input.

Pressing on both stripes at the same time will cause the resistant to drop in each stripe, which will cause the voltage at A0 to… well… be unstable and unreliable. And in a worst case the total resistance will drop and cause a near shortcut between the 5V and ground. If there’s a risk for this, an additional resistor should be placed there. Each stripe would be a ring. With 6 analog inputs, one could have 12 rings.

So the next thing would be to arrange the stripes in a target board pattern. Since 2 rings share the same analog input, each pair should be as far from each other as possible, so a ball hit would never trigger both rings in a pair. Like this:

Here I have 6 pieces of velostat, which would need three analog inputs.

press1.png

No direct experience with Velostat but it sounds like this should work, at least I can't see anything obviously wrong.

You'll have to do some testing though to find out how much it really changes resistance, and whether you may need to amplify the signal.

A potential problem I see is the detection: you have to constantly and very quickly poll all your analog ports as the impact of a ball lasts only for a very short time (I would expect a few milliseconds at most). Arduino's ADCs may be too slow for that, especially as you have to poll them one by one.

An Arduino DUE has 12 analog inputs and can perform 1 MSPS for 1 analog input. For 6 analog inputs in freerun mode, you will get 1/6 Msps conversions for each analog input.

That makes for 6 ms between polls of a strip. I'm expecting problems there, as I doubt the ball will compress the strip for that long.

You'll need to build in some form of delay - maybe a capacitor can help keeping the voltage high/low long enough somehow?

Ok, that ruins a lot. My other approach which is based on piezo sensors will include peak detectors, which hold the voltage until it is read. I found a page that tells that a typical hit on a baseball with a bat lasts some 0.7 milliseconds. A ball hitting my board might not press it any longer than that. And since this velostat approach would use voltage peaks in two directions, I'd really need some strange solutions.

Can't you do Velostat + peak detectors?

Maybe you can't multiplex your analog inputs now but instead you could add an external ADC. Or if the peak detectors give a digital output, use your digital GPIO pins with port extender(s) if not enough.

A peak detector could really solve this. But it would need lots of components per analog input. A quite different approach might work. Velostat is used as a bend resistor, too. I could place the stripes between two sheets of memory foam. A hitting ball would make a bump that lasts for a second, bending the velostat long enough to cause a voltage drop or peak that my Arduino will have time to read. Not a very electronerdy solution.

I would put the velostat on top of the memory foam, to make sure it bends at all (if the hit is not hard enough otherwise it may not bend and you don't detect anything).

On the other hand, a quick Google search turned up this circuit. It doesn't look exactly complex and should work for you: https://electronics.stackexchange.com/questions/112347/how-to-make-a-peak-detector-circuit

If I understand it all correctly it will measure both positive and negative peaks so you're still mutiplexing your signals. There should be no issue with drift in the voltage divider (that's basically a very low frequency signal - your mid voltage will never be perfectly stable), and you should quite easily detect the (high frequency pulse) ball hits. It's going to need some experimenting with R and C value though, based on how long you need the output to stay high/low and how fast your ball hits are.