IR based object counting


I am looking for comments and good ideas before i commence my small build :).

We have a conveyer belt at my work where 6000-8000 objects pass in a nice and orderly fashion (1 at a time) every hour.
I want to have an exact count of the number of objects.
So thought i would do a little build with an electric imp.

Nice and easy IR counting using the imps interrupt pin.
IR emitter which is always emitting on one side of the belt.
IR receiver on the other side of the belt, opposite to the emitter.

I am considering using one of these as receiver (because of the rugged housing and wire). However I am not sure what it outputs.

For the emitter I would like something similar in a nice housing which i can just power with a 5V supply. I know it is a very simple circuit, so i could just put it together my self. But because it is on a factory floor, it needs to be somewhat rugged :slight_smile:


Those receivers are generally for modulated IR, which is fine, but you will need to supply them power (not sure what voltage) and also modulate your IR LED.

I’ve done this but a bit more simply using a laser diode (which is nice as you can see the dot for aiming) and an LDR with a tube over it - I used this to trigger my halloween setup as people walked up the pathway to the house.

For that there’s no modulation or anything - you just have the laser diode (5 for $11! ) and an LDR (20 for $6 ).

Put a black tube over the LDR so it doesn’t pick up ambient light, and point the laser at it. Hook the LDR between ground and an imp pin, and put a 100k resistor between the imp pin and 3.3v.

When the light hits the LDR, the reading from the adc will drop down to near zero. When the beam is broken, it’ll go significantly higher.

Pololu sells a couple of different distance sensors like this one, which is .2 to 2 inches:

The output is a simple digital pulse. Because it is small, it could be build into a heavy duty metal electrical conduit strut. Only a small 3 conductor wire traveling down the strut to the imp in a plastic box. Uses the 3.3V from the imp.

If your objects are different sizes, you would pick a sensor with a longer range and move it farther from the objects. You only need the 1 sensor, because it transmits, reflects back and receives.

They cost about $6

#1 Hi Hugo

Great idea using the laser and LDR. Would love to not have to modulate IR :).

My concern about the LDR was:
1: eyes + lasers = maybe work place safety regulations issue

2: that it would not work with the interrupt pin, but I guess that is not really a problem, can just check on a regular pin with a software threshold. (or could be a photo diode?)

#2 mlseim
Hi mlseim
Thanks for the proposal. I have been considering using a reflective distance sensor, but I am worried about the counting precision with different size objects going through the machine.
As you say I guess the upside is only having to put up stuff on one side of the conveying belt :).

I will test out both your and Hugos proposal i think :).

Something like this may do the trick too (Photoelectric Detector Active IR Sensor)

This would be a class I laser so you’d have to stare directly into it. You also don’t need a laser - with the hood on the sensor, you could just use an LED flashlight on the other side of the line… it just has to be something without a lot of beam spread.

How heavy are the objects? If one conveyor roller on the production line had load cells on the shaft ends you could detect an object by the change in weight. There would be a sharp rise as soon as the object touched the roller. I’m just throwing out another idea.

Gerrikoio could work yeah.

Hugo: yeah true, i like the solution with a tube on an LDR, so will try that out

mlseim: varies in weight, but generally not that much, it’s just card board :). But I am afraid to offset the balance in the machine :slight_smile: