Pages: [1]   Go Down
Author Topic: Infrared sensor - I am lost  (Read 1138 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, I'm trying to build a unit with twelve infrared sensors using radioshack paired emitters and phototransmitters.  I have a arduino that will be reading on/off from the pins and then generating a midi signal up to a controller.

To prototype I built the following two circuits

  5V ----- /\/\/\/ ---- emitter ---- LED ---- Gnd  (LED stays on so we're getting power)

  5V ---- /\/\/\/ -- photransister --- LED --- Gnd  (LED never comes on)

The emitter is rated to 5V 150ma and I'm in spec.  I did have two of them where the smoke came out as I miswired this very easy circuit.

HELP! What on earth am I doing wrong?  It's driving me screwy.

Colin

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The first resistor is 280Ohm

The second is 1K ohm.
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try it with the phototransistor connected to an arduino input pin.  Take the LED out of the circuit and connect it  up like this:

  5V ---- /\/\/\/ -- wire to Arduino input pin---- phototransister --- Gnd

Run one of the switch test sketch's, the wire to the phototransistor will act like a switch and make the digitalRead  go low and high as IR light level reaches the correct level for the  phototransistor.
« Last Edit: May 08, 2008, 12:46:05 pm by mem » Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 854
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is this the item you're using? http://www.radioshack.com/product/index.jsp?productId=2049723&cp=&sr=1&origkw=ir+emitter&kw=ir+emitter&parentPage=search

It says the emitter is 2V, 40mA.   Assuming about 2V for your LED, you have 1 volt dropped across the resistor, which means you have 3.6mA through the LEDs (using ohm's law and kirchoff's current law).  I would imagine the visible LED is fairly dim, and the IR LED is even dimmer.

Edit:  This might be a stupid question but are you sure you have the polarities right on the IR components and don't have the emitter and detector reversed?
« Last Edit: May 08, 2008, 01:25:06 pm by Oracle » Logged

Las Vegas, NV
Offline Offline
God Member
*****
Karma: 0
Posts: 507
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Try it with the phototransistor connected to an arduino input pin.  Take the LED out of the circuit and connect it  up like this:

  5V ---- /\/\/\/ -- wire to Arduino input pin---- phototransister --- Gnd

Run one of the switch test sketch's, the wire to the phototransistor will act like a switch and make the digitalRead  go low and high as IR light level reaches the correct level for the  phototransistor.

In picture form, you want to wire your emitter/phototransistor circuit something like:



You'll want to tweak the two resistor values to achieve the ideal response curve for your particular emitter-detector pair.

- Ben
« Last Edit: May 08, 2008, 02:15:06 pm by bens » Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes! It worked. Thanks for the advice.

It's very sensitive to ambient light.  I need to tweak my resistors some I guess.

Colin.
Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 854
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It's very sensitive to ambient light.  I need to tweak my resistors some I guess.

They way commerical remote controls solve this is when they want the LED to be "on" they strobe it on and off and around 40kHz.  When they want it off, it's just off.

Then the receiver filters out everything that is not strobing at around 40kHz, and since ambient light doesn't strobe like that, it is ignored.
Logged

Pages: [1]   Go Up
Jump to: