Go Down

Topic: Feasibility of reading 72 photoresistors on Uno (Read 1 time) previous topic - next topic

jqlee85

Hello all. I'm working on a community art project which will require me to determine where a flying object crosses a plane (looking for x,y coords). I had an idea to use a row of photoresistors along each of the x and y axes, then have corresponding rows of LEDs across from them. Then I would want to read data from the photoresistors to determine which LED beams have been broken, so I can plot the position of the object.

Is it feasible to read data from 72 photoresistors with an Uno?

If so, can I do it quickly enough to detect object moving quickly through the plane?

 I guess I would need to use something like shift registers daisy-chained to use that many inputs. I have a bunch of these shift registers. Some people have told me it's doable, and some said I'll need to figure out a different way to go about it. I found this thread that seems like a similar issue, but I'm new to hardware and still pretty unclear on if that would work, so any guidance is much appreciated. Thanks.




Let's make stuff.

johnwasser

Photoresistors are relatively slow to respond.  You should probably use phototransistors to get quick response.

A set of nine Parallel to Serial shift registers will allow you to read 72 digital inputs via SPI at about 8 million bits per second.  As you read the nine bytes you can check to see if any bits have been set.  If none, there is nothing to do but scan again.  If any bits have been set you can then look at the nine bytes to get the horizontal and vertical coordinates.

You might need to use lenses to limit the field of view of each sensor.

If the object is too small or too fast you may need pulse stretching on the sensors to allow the object to be reliably detected.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

mikb55

How big is the flying object? How fast is it moving?
In other words, how long does it take to pass through the plane?

If you don't know how fast it's moving, some phone cameras have a slow motion feature that should give you a rough idea of the speed. 

jqlee85

#3
Oct 25, 2015, 10:18 pm Last Edit: Oct 25, 2015, 10:20 pm by jqlee85
@mikb55: We'll probably be using a tennis ball, about 2.8" diameter, the speed will vary, but it'll be blocking the led beams for about 1\1000th second at its quickest.

@johnwasser: I'll look into the photo transistors, thanks.

 I was thinking of setting each of the photoresistors (or photo transistors) back a couple inches into tubes to cut out peripheral light, might this work in place of lenses?

And if the ball is passing the plane for about .001s would I need the pulse stretching?

Does anyone have a suggestion where to start looking online to figure out how to wire up that many shift registers?

Thanks for the help!
Let's make stuff.

DrDiettrich

IMO you should start finding out more yourself. Start with a single cell, and find out whether the passing object will provide a logic level signal at all. If not, you have to add an amplifier (another transistor or comparator), that also may do the pulse stretching. Because signal conditioning is required for every single cell, this is the most important (costly...) part of your project, worth some experiments with different approaches (mechanics and circuits).

TomGeorge

#5
Oct 26, 2015, 08:58 am Last Edit: Oct 26, 2015, 09:00 am by TomGeorge
Hi,

2.8" = 2.8 * 2.54 = 7.112cm in 1/1000sec
7112 cm / sec
71,12 m/s
71.12 *60 *60 = 256032 m/hr
256.032 kph

Nadal, Groth, Roddick, Williams ????????
Air cannon...
Mythbusters??????
LDRs will definitely not be fast enough.

You would need to have a flipflop on each Rx.
Master RESET them, then scan them.
When a ball goes through the plane a flipflop is SET,  the scan will see the SET flipflop.
Just scan x axis, when you have found a set output then go and find its mate on  y axis.

Then master RESET and scan x axis for next ball.

How quick do you need to know when and where the ball crossed the plane?

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

dave-in-nj

look into shooting chronographs.
we know what you want is possible, as we can detect a bullet, albeit through a specific flight path, up to about 7,000 feet per second. and up to 1,800 rounds a minute.

all you need to do if figure out how to narrow your beam, not just put it into a tube for shade.so your beams create a grid of a fashion.

I have always thought that they could do with with a baseball in a stadium because of the fixed location of home plate


jqlee85

Haha, Tom, no unfortunately no tennis pros or cannons. People will be throwing the ball, so max speed would probably be about 80 mph, since the beams would be spaced, the full diameter of the ball might not pass through the beam, so I'm being conservative and estimating the .001s. In most cases it would be more than that.

After a throw I would want a few seconds to reset so the thrower could get ready for the next one, I could take as much time as needed to process and reset.

Thanks Dave, Yeah I wonder how they plot position for MLB pitches, probably comparing multiple camera angles or something. I'll look into shooting chronographs.

People would be throwing against a board, so I could use some sort of pressure sensor in the board I guess. If anyone's heard of some sort of good durable pressure sensing pad I might consider that option. But I was thinking using a plane of beams like this a couple inches off the board might be good because we wouldn't actually hitting the sensing equipment with the balls (less chance of breaking stuff). Also if I can figure out how to do it with beams like this, I could eventually add another sensing frame halfway through the throwing path and track ball movement, which could be pretty cool.
Let's make stuff.

CrossRoads

So are you thinking a set of detection lines, vertical or horizontal, spaced close enough that a ball will pass thru at least one line, and a 2nd set in parallel, so the time can be measured between the 2 crossings and its speed determined?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

zoomkat

You might consider using the inexpensive laser modules to make light beams. You need to get a photo transistor and experiment to see if it has the reaction time you require.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

jqlee85

@CrossRoads, maybe in the future for a phase 2 I'd want to measure speed, but at this point I'm really just concerned with the position of the ball.

So I was thinking 36 pairs of light beams and sensors along the x-axis, and another 36 along the y-axis, creating a grid of beams on the same point on the z-axis. If one or more of the x-axis beams is blocked, check the y-axis to see if any have been blocked as well, if so, plot the x,y position based on the blocked beams.

Ideally the code would be a little more complex than that, because the more beams that are blocked, the more accurately I can estimate the position of the ball. So if possible I'd want to record a series of readings starting when the first beam is blocked, then when all the beams are unblocked again, use the reading with the most blocked beams to plot the ball's position. But to start with, if I can just get one beam on each axis tripped at the same time that's plenty of precision for now.

@zoomkat: Lasers was my original idea, but someone told me I could get away with LEDs instead and it'd be much cheaper. I was skeptical because the light source and the sensors will be about 4' from one another, but he insisted. I guess I'll have to run some tests with both a laser and an LED before I go ahead and buy everything.

Let's make stuff.

johnwasser

You have 36 sensors spread along 48" so they are about 1-1/3" apart.  You need to restrict the field of view of the sensors to about 2" at 48".  That would be the same view as 0.25" at 6" (divide both sides by 8) so if you put your sensor at the bottom of a 6" hole that is 1/4" in diameter you should get the right field of view.  The inside of the hole should be as non-reflective as possible.  Putting the LED at the bottom of a similar hole should help avoid interference with adjacent sensors.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

zoomkat

Quote
@zoomkat: Lasers was my original idea, but someone told me I could get away with LEDs instead and it'd be much cheaper. I was skeptical because the light source and the sensors will be about 4' from one another, but he insisted. I guess I'll have to run some tests with both a laser and an LED before I go ahead and buy everything.
Light scatter from the other LEDs might be a problem. I think the below laser modules are the same as I bought in the past. You get 10 for $3.13 including shipping. You probably can get a small laser pointer for testing. DollarTree has them for $1, and I've seen them in the walmart checkout lane.

http://www.dx.com/p/12mm-5mw-red-laser-diode-modules-black-dc-4-5v-165078#.VjDjrFWFPiw
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

jqlee85

I think the below laser modules are the same as I bought in the past. You get 10 for $3.13 including shipping.
That seems pretty reasonable, I'll get some of those and test em out, thanks!
Let's make stuff.

jqlee85

You have 36 sensors spread along 48" so they are about 1-1/3" apart.  You need to restrict the field of view of the sensors to about 2" at 48".  That would be the same view as 0.25" at 6" (divide both sides by 8) so if you put your sensor at the bottom of a 6" hole that is 1/4" in diameter you should get the right field of view.  The inside of the hole should be as non-reflective as possible.  Putting the LED at the bottom of a similar hole should help avoid interference with adjacent sensors.
Thanks John, I ordered a few test parts, going to do some tests, I'll start with a 6" hole, matte black.
Let's make stuff.

Go Up