LED light gate

Hello all!

I am thinking about using the LED-as-light-sensor trick to create a through-beam gate similar to what is done commercially with lasers.

I propose to have two LEDs, one as a light source (emitter) and the other as a sensor (receiver). Each LED would be shaded with a small metal tube to inhibit interference from ambient light. The inside of the tube around the emitter would be polished to increase light concentration; the tube around the receiver would be buffed inside to prevent light entering the sensor LED sideways.

The Arduino would only need to detect three different light levels i.e. fully blocked beam, partially blocked beam (for a predetermined translucent object), and fully open beam.

I would appreciate any thoughts on this.

Thank you.

Why use an LED as a sensor when there are devices designed for this purpose? You are looking for something called a “phototransistor” or “photodiode”. The former is better for yes/no decisions regarding whether light is hitting it or not, the latter for more analog/continuous readings of light level.

It’ll work much better than an LED as a sensor.


Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

You can not build something for as low a cost as that gadget shield and it is quite cool.

If that's too much dough you can steal the solar cell from some broken junk and use that with the arduino's analog inputs but without scaling using an op amp you will probably not like it.

Why use an LED as a sensor when there are devices designed for this purpose?

I was thinking that I only need something cheap and basic, something that will work with a fixed light source and stable ambient conditions, and I am not familiar with other solutions.

You are looking for something called a "phototransistor" or "photodiode".

Thanks. Do you have any models that you would recommend?

...without scaling using an op amp you will probably not like it.

Forgive my ignorance, but what is an op amp?

Thank you.

Although you are discussing more basic issues at the moment - but before I forget this thread: It is a good idea to not just emit light from the LED to be detected, but send “pulses” (which is called “modulation” in the academic world…) Dtecting that pattern - which in the simplest situation can be the distance between pulses - is a very good protection against scattered light…

Thanks. Do you have any models that you would recommend?

If you don't actually have to see visible light then I'd recommend an infrared emitter/detector since they will be more immune to ambient light. The Lite-ON LTR-4206E is a good choice. As for an emitter, any infrared LED will do, like the Vishay TSHF5410. At less than $1 each, I think they qualify as "cheap" :)

-- Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

Hi Rugged, thanks for your help. You certainly seem to know your stuff!

Can I ask what resistor I should use to reduce Arduino 5v to 1.5-2.0v to power the emmitter?

It depends how much current you want to drive (thus how much light power you want). If you are only pulsing the LED on for brief periods of time (say 10% duty cycle) then you can use high-current pulses (see Fig. 3 of the TSHF5410 datasheet for example).

Here's a circuit for another person's question that shows how you can drive high-current pulses for an IR LED and use a detector too:

The LTE-4208 represents your IR emitter (what I recommended as a TSHF5410....they're pretty interchangeable). The key resistor that controls the current is the one labelled 160. If you know the typical forward voltage Vf of your IR emitter (the TSHF5410 has a forward voltage of about Vf=1.4V) then you can calculate the size of this resistor based upon how much current you want in the LED:

Resistor = (4.2-Vf)/Current

For example, if you want 50mA of current then you'd select:

Resistor = (4.2 - 1.4)/0.05 = 56 ohms

Don't be surprised if your actual current is +/-10 mA from this.

-- Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

Thank you Rugged.

I think I am all set now.