How hard would it be to make a simple light beam based counter?
I'm thinking laser diode or infrared beam that counts by ONE whenever something interrupts the beam.
A simple LED display and a reset button to reset to zero each push.
How hard would this be?
Software side: very simple.
Hardware side: that's where the challenges are (especially on how to prevent false triggers/missed triggers due to ambient light).
super-duper simple
let's try it out.
count beams = 1
there, done.
of course if you mean number of interupts of the one beam...
that depends on what breaks the beam
across a door way and single stream of people is not hard
across a door as the movie theater lets out, that one break of the beam might be 50 people over 5 minutes.
one lane of a car, say into a parking lot counts a car and trailer as 2
across a roadway might have cars passing so 2 count as 1.
Hi Bittsen,
It would very much depend on the application.
Like wvmarle said the challenges are in the hardware depending on what you are trying to count.
Counting slow moving milk cartons on a conveyor belt under perfect lighting is rather easy, but counting cars on a road both at day and night can be much harder.
Can you tell a bit more about what you are counting, how it is moving and what the conditions are?
And also what your budget and desired accuracy would be (that always helps in finding a good solution).
Regards,
Teunman
Thanks so far.
I would be setting up a basic counter that will count single items as they pass through a channel. Basically a conveyor belt system with product passing by about once every few seconds. Lots of time between product. Product would only be visible, however, for a fraction of a second. Like, 0.01 second.
Product would only be visible, however, for a fraction of a second. Like, 0.01 second.
It sounds like product is either a very narrow object moving slowly, or a wide object that is moving very quickly.
Or something in between. Am I close?
Various sizes moving quickly. Nothing over 20 inches long though.
Hmm, 20 inches wide, crossing the line in 10 milliseconds.
That would be moving at 51 meters per second, or 183 km/hr, or 115 mph. That is one hell of a conveyor belt!
jremington:
Hmm, 20 inches wide, visible for 10 milliseconds.
That would be moving at 51 meters per second, or 183 km/hr, or 115 mph. That is one hell of a conveyor belt!
Not exactly. The smallest item would be about 3 inches, visible for 10 milliseconds.
The item would be counted during being blown past by a jet of air. The purpose of the counter is to determine how many product made it past that spot.
Yes, pretty much exactly, for a 20 inch wide object.
However, it is no problem for the Arduino to detect a 10 millisecond pulse.
Hi Bittsen,
Okay, so as long as the objects are not translucent and you are absolutely sure they will pass the beam of light it should be relatively simple. Like jremington said, it is no problem for the arduino to detect a 10 ms pulse. So this is what I would do:
-
look for a light (or laser) and sensor combo (like the ones some stores have to let them know someone enters (and to annoy you mom when you play with them as a kid))
Preferebly this has either an analog output or something that is easy to interface an arduino with (SPI or some other protocol). Make sure that the sensor is fast enough to sense the object.
-
Get an arduino compatible LCD and a button.
-
Read datasheets for everything
-
Hook up stuff
-
Write code (which should be simple) that does:
read sensor
if sensor gives pulse: add to 1 to counter
display number of counter on lcd
if number pressed: set counter to 0
-
Post photo's of your project here so we can see 
just out of curiosity what is the project for exactly?
Regards,
Teunman
Ambient light is a common problem. Modulated IR (typical 38 kHz) is the general solution.
teunman:
just out of curiosity what is the project for exactly?
Regards,
Teunman
I haven't played with analog inputs but, yeah, it shouldn't be much different than a pushbutton is.
I have only played with a display once. I think maybe I can figure that out. MAYBE.
What is the project for?
I manage a manufacturing department. The entire life of this company they have supplied the workers with X-amount of material and hoped to make count at the end. They've never actually had a bean counter at the end other than whoever puts the product into a box. This works except that some products are multiple components and since they just go into a catch bin, they often end up with too many of one component and too many of another.
If each machine could have a counter at the end point then they can match quantity during production which would reduce waste from product made in overrage.
Bittsen:
I haven't played with analog inputs but, yeah, it shouldn't be much different than a pushbutton is.
Reading an analog signal and reading a push button are two VERY different things.
Bittsen:
I manage a manufacturing department. The entire life of this company they have supplied the workers with X-amount of material and hoped to make count at the end. They've never actually had a bean counter at the end other than whoever puts the product into a box. This works except that some products are multiple components and since they just go into a catch bin, they often end up with too many of one component and too many of another.
Sounds like you're counting at the wrong point.
Count at the machine's side: the number of parts it produces (most machines can do just that already), and make sure when you need 100 parts it produces 100 parts (plus compensation for any rejects) instead of produce produce produce oh, time to stop, never mind what's still on the belt.
wvmarle:
Sounds like you're counting at the wrong point.
Count at the machine's side: the number of parts it produces (most machines can do just that already), and make sure when you need 100 parts it produces 100 parts (plus compensation for any rejects) instead of produce produce produce oh, time to stop, never mind what's still on the belt.
That's what I'm trying to accomplish. The counter would be placed at the point on the machine where a "finished" component passes. The machine operator already removes rejects so only the "good" component gets to the count point.
Doesn't the machine offer some form of counting output that you can tap in?
At least it sounds like you get one and only one type of object per sensor, that should make the job of a break beam sensor easier. Many such sensors are commercially available. Some have the transmitter and receiver on either side; others in a single package with a reflector on the opposite side. Normally using modulated IR, to provide good immunity against ambient light (as you're presumably work indoors that should be good enough - you need lots of ambient IR, such as direct sunlight, to mess up such sensors).
The product changes from time to time but at any given "session" the product would be the same for hours on end.
There isn't any device on the machine that can be utilized for counting. It's an old machine. VERY old.
OK, break beam sensor it is. Lots of those around - have a look at what Adafruit and Sparkfun have and see which one would fit on your machine.
Now the problem is how to install it. It's got to be somewhere that you can be sure to get a count for each product - one count, and one only, for each product. Even if there's a hole in the product (though you can filter that out in software: beam must make for a certain time before the product is considered completely crossed).
Place it at the output, where the product comes flying by is one option. Can you guarantee the trajectory well enough? Maybe you can place it near the lever that throws it out - sense the lever movement?
I can guarantee the trajectory. And sensing the lever won't work because the lever works whether or not there is product. These machines are very archaic. Part of why I need an "exit" counter to sense product.
The reason this is needed is because we have up to 4 components being made for a product at any given time. At the end we typically have more of one component left over. I would like to decrease the amount of mismatched final components. We have so many boxes with hundreds of components that have no mate.
When a component is finished there's only 2 or 3 left in process. I can live with junking a couple components. The time from entry to exit is a very brief time. No machine has more than a 6 product assembly going, meaning on the belt there's never more than 6 components partly done.