Best distance Sensor.

xtech007

Senior Member
Hi All!
Happy New Year!!
I want to replace some project inputs from open/close switch to something that uses less inputs. Currently it uses a 28x1 and I have 9 inputs to read from. I was wondering if A range finder can be used instead of all the switches?
The way it works it's like a bean bag toss board game, instead of one target hole it's has 9 and it uses baseballs.
When the baseball go through the target it actuates the switch adding points for that target. But becouse the way the ball is thrown to the target the switches started to fail.

So I thought why not use and HC-SR04 range finder?
Installed at one end where it can cover all 9 holes & according to the distance where the holes line up the 28x1 add up the points.

Do anyone Else have a better approach?
Maybe a better sensor?
The goal is to use the least switches possible.

Thanks!
 

Buzby

Senior Member
I think you will have lots of code to write if you use some kind of range determining device.

What about just replacing the mechanical switches with photo beams, broken as the ball enters the hole ?.

No code changes needed.

Cheers,

Buzby
 

erco

Senior Member
Wow, I love that idea, xtech007! At first I thought you meant a 3x3 (tic tac toe) arrangement, and I couldn't figure out how one sensor could cover that. But if it's an inline 9x1 "grid" and there's only one ball, that's an awesome solution to measure distance. Coding would be easy, just measure the distance and branch accordingly. Two potential issues to test:

1) Can you get enough of an ultrasonic reflection off a ball (gets worse farther away), and
2) The sensor is essentially looking down a tunnel of ball locations. Ultrasonic reflections get real weird when you try to corral/direct them, you probably have lots of little ribs and bumps which may cause problematic reflections.

Alternatively, you might try a Sharp IR distance sensor.

It sounds like your game/target is already built, so you might not want/be able to change it. But one thing that occurs to me is to catch/collect the balls in a row of thin/coarse nets (or mesh grape bags) which will hold the balls in place, but don't have enough substance or cross section to reflect much ultrasonic/IR signal.
 

Pongo

Senior Member
Two strikes against the HC-SR04, according to the datasheet:

It's not fast enough to reliably detect a thrown ball. The transmitted utrasonic pulse burst is 200 micosecond long, and the recommended minimum total cycle time is 60 milliseconds. That means it's only transmitting 1/300 of the time.

The recommended target is 0.5 square meters and flat. Online comments indicate that it does not even detect hands well.

IR sensors on each hole would be the most reliable solution in my opinion.
 

stan74

Senior Member
Tidy project idea,ultra sonic sensors need 8 mS to settle before re-triggering which slows my robot also 3M max range and 15 deg beam. A few PIR detectors might work though,as the object goes past each one..etc
 

techElder

Well-known member
A photo is worth 1000 of our words trying to guess how your target is laid out.

I don't see how you can reliably count 9 balls with one sensor. So, assume that you have to have a sensor per hole.

You say your mechanical sensors don't work reliably. Replace them with solid-state sensors.

erco, Buzby and Pongo suggested IR sensors.

I'm suggesting the same but add "ball traps" on the back of the target board. That way the ball interrupts the IR beam for a longer time making the detection more reliable.
 

xtech007

Senior Member
You Guys are awsome!

Thank you guys for the Input, and suggestions!

I will post pictures soon I get back home, currently on family reunion.
The configuration of the holes are in a 3x3 pattern. 24"X24"
0 0 0
0 0 0
0 0 0
The first layer is a net, with the holes.
When the ball do not make it through the hole it Bounces off and it's counted as an ball. When the ball do go through the hole depends on the position ,it hits a second mat that I modified to act as switch. (3 layers)
Like a sandwitch, top layer is a rubber mat with aluminum tape on the other side on the spots where the ball is to hit act as actuating switch. Each spot is attached one input of the 28x1 Picaxe.
Second layer it's like an spacer to push the layers back to position when the ball hits it.
3rd layer is also with aluminum tape but connected to common ground.

So code detects witch pin is high and displays points accordingly.

Only one ball is pitched at a time.
Reason I wants to replace it with sonar or something more durable is becouse kids are pitching harder now!
Near 70-80ish MPH and damaging my net solution, if I was to put something mechanical they will tare it up on the second pitch!
 

techElder

Well-known member
Mount a spring-loaded plastic funnel behind each hole in the net. This will help dissipate some of the energy of the balls that pass through the net. At the small end of the funnel glue/mount a magnet. Actuate a "switch" with the magnet. The "switch" could be solid-state, but an alarm system window switch comes to mind.

The funnel will also allow the ball to fall out gracefully.
 

hippy

Ex-Staff (retired)
Push buttons on pedestrian crossings take a tremendous amount of bashing but ultimately operate 6x6 mm PCB push switches. The basic trick there is similar to what Texasclodhopper describes. There is a large, strong spring holding the button or funnel and then the switch activating finger is on a softer spring ...

Code:
               |
  | /\/\/\/\/\ |
 _|           _|
| |          | |
| |\/\/\=== [| |
|_|          |_|
  |            |
  | \/\/\/\/\/ |
               |
 

edmunds

Senior Member
Take a look at VL6180X from ST

Take a look at VL6180x from ST. It can certainly see a rolling ball fast enough at any light conditions and whatever the colour of the ball is. I have code to run it (you need I2C). If max range is enough (~200mm) for your application and this is not out of budget, this is a super reliable device. Surface mount package is not too bad to solder thin wires and required passives to directly, but making and ordering a small 'breakout' PCB from some large country would also be no problem.


Good luck,

Edmunds
 

techElder

Well-known member
[rant]
Aw come on. It's a target with holes in it where kids throw baseballs (or miss.) I'm purty sure you don't need to know the speed of the ball or some kind of miraculous 3D scanning technique that requires IBM's Watson computer to analyze whether a ball went into a hole.

You don't even need electronics! (But it's much more fun with big LED numbers!) You could have the captured balls roll out into numbered (by hand) slots and have one of the kids add up the score. Than they could "transmit" (yell) it to you at the throwing line! Then you could record the score (write it down) in a recording device (spiral notebook.)

It's a simple project made more interesting and fun for all by using electronics, but jeez it doesn't need any really complicated stuff to do that.
[/rant]
 

xtech007

Senior Member
that's Funny!!

Texashopper, no need to blow a piston!
This project was more intended for pitching practice for kids between 10-12 yrs old. Accurate pitching training, where the kids would pitch to specified hole, if missed or hit the spot the picaxe program would lit the next hole
Accordingly. I Have a seperate device to measure speed of the pitch.

So it's not really just a toss game!
I added a max7219 IC to drive the LED matrix to display balls, strikes ,outs, hit on target and misses!
Might add a sound module to call out strikes, balls and so forth, maybe bluetooth for speakers!! See going overboard again!!

Kids will be pitching 40-45 feet away!
 
Top