Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: liomry on October 07, 2012, 03:11:16 PM

Title: Basic IR emitter / detector with photodiode
Post by: liomry on October 07, 2012, 03:11:16 PM
Hi All,

I'm referring to the basic IR circuit here - http://www.societyofrobots.com/schematics_infraredemitdet.shtml  (http://www.societyofrobots.com/schematics_infraredemitdet.shtml)

Basically I received a pack of photodiodes instead of phototransistors. However after following the tutorial it seems that I have somehow gotten the circuit working with the photodiode. Can someone explain why this works -

I placed a 220ohm resistor for R1, then I measured the resistance of my photodiode. In one direction it was infinite( or above 20 megaohms anyway ), in the other it was 76Kohm. I had some 42Kohm resistors so I put two in series in place of R2. Other than that I kept to the tutorial.

I connected vout to the analog input pin of my arduino and ran a few tests. When the photodiode and the emitter face each other the current drops to 0v and when they are shielded from each other it jumps to 5v.

Can someone explain why this seems to be working?

Diodes I am using are the ones here - http://www.ebay.ie/itm/100-PCS-5mm-Infrared-receiver-diode-IR-LED-/300588562453?pt=LH_DefaultDomain_0&hash=item45fc797815#ht_545wt_1005 (http://www.ebay.ie/itm/100-PCS-5mm-Infrared-receiver-diode-IR-LED-/300588562453?pt=LH_DefaultDomain_0&hash=item45fc797815#ht_545wt_1005)
Title: Re: Basic IR emitter / detector with photodiode
Post by: Soeren on October 07, 2012, 04:17:15 PM
Hi,

[...] However after following the tutorial it seems that I have somehow gotten the circuit working with the photodiode. Can someone explain why this works -
The difference between photo diodes a and photo transistors is the gain - photo transistors are more sensitive, but slower reacting as well.


I placed a 220ohm resistor for R1, then I measured the resistance of my photodiode. In one direction it was infinite( or above 20 megaohms anyway ), in the other it was 76Kohm. I had some 42Kohm resistors so I put two in series in place of R2. Other than that I kept to the tutorial.
"Other than that"?
You changed 75% of the circuit, so I'd rather express it as "I kept 25%" ;)

To find the optimum resistance value, you need to measure the entire setup as it will be used, over a dark area and over a light area (in the direction where you don't get an over-range) and the two values you get, is then used to find the best value of the resistor.
Your choice of R1 only gives half the current of what can be safely handled into the LED and this will decrease the distance it will cover.
The photo diode will be more critical towards the resistor value.


I connected vout to the analog input pin of my arduino and ran a few tests. When the photodiode and the emitter face each other the current drops to 0v and when they are shielded from each other it jumps to 5v.

Can someone explain why this seems to be working?
When you use them for line sensing or obstacle detection, they only see reflected light, which will be extremely weak compared to your test set-up, so you need to test it in-situ, to see if they'll work for you at all.
When you shine an IR LED directly into them, they will conduct pretty hard, pulling to ground and while they don't see (enough) light, they'll be off (like if you cut the wire) and then the resistor(s) pulls toward +5V.
Title: Re: Basic IR emitter / detector with photodiode
Post by: liomry on October 07, 2012, 04:27:30 PM
Hi Søren,

Thanks for the great explanation, it all makes sense now  :)

I'm aware that the output is pretty terrible with a 220 ohm resistor but it's all I had in my toolbox. I'll order in some 110 ohm but I can just put another 220 ohm in parallel for now for testing.

My next challenge is getting 4 of these playing nicely together while sharing 5v with an ultrasonic ranger and a sharp IR ranger. Let the hair-pulling commence  ;)
Title: Re: Basic IR emitter / detector with photodiode
Post by: Soeren on October 09, 2012, 07:00:45 PM
Hi,

My next challenge is getting 4 of these playing nicely together while sharing 5v with an ultrasonic ranger and a sharp IR ranger. Let the hair-pulling commence  ;)
Capacitors are some of your best friends here - right over the terminals of each sensor!
Wiring each sensor directly from your voltage regulator output (which should have a cap in place as well anyway) will help too.