Assistance with IR detector sensitivity problem.

I am in desperate need of help. I have over-promised to a group of cub scouts and now I am afraid I can't deliver. I am working on a digital timer for a pinewood derby race that is scheduled for Wednesday evening and I need to solve this problem by then.

I am using the schematics provided by Pinewood Derby Race Timer to build the hardware. It is a Arduino Uno-base timer that feeds data back over a USB port. I though everything was working great, but over the weekend in final prep, I discovered I am only getting about 3 inches of range between IR emitter and detector. I am using the emitter and detector set from Radio Shack. (276-0142 RadioShack.com Official Site - America's Technology Store)

After significant effort to debug the hardware, I think I have it narrowed down. The emitters are working as far as I can tell. The voltage and amperage on that circuit seems to be fine.

I believe the problem is the amperage on the detectors. Each detector is connected between a digital pin and ground on the Arduino. The power on that circuit is 4.4 V @ 0.2 mA according to my multimeter. The package for the detector says forward voltage should by 1.2V @ 1mA. (I am a bit surprised that the 4.4 volts haven't burned out the detectors, but they have consistenly worked as long as the emitter in within 3")

So my question is this: How do I drive the detectors at lower voltage but higher amps? Can I use a pin on the Arduino (I have 1 available pin/detector) to drive a transistor (MOSFET?) to switch the detector on a lower volt/higher amperage circuit? I believe this is possible, but I am in way over my head.

The Arduino has two always on power pins:
3.3V @ ~= 400mA
5.0V @ ~= 700mA

I am currently using the 5V pin to power my emitters as shown in the schematic referenced above. It runs through a 68ohm resistor, stepping the amperage down to about 70mA. That is also out-of-line with the spec on the package, which says it should be driven at 1.2V @ 100mA.

As I said, I am in way over my head and will need pretty explicit instructors on how to create a different circuit.

Thanks in advance!
David.

The detector setup is fine, they are phototransistors so forward voltage is not relevant.

How much range do you need? The following should improve it:

  • make sure the emitter and detector are head-on facing each other, not side-on
  • reduce the 68 ohm resistor to increase the emitter current to near the maximum rating of the emitter (the Radio Shack page says 150mA)
  • change the code so that it does not enable the internal pullup on pin 2 of the Arduino, and connect an external pullup resistor between pin 2 and +5v instead. Try 100K to start with. For maximum range, you need to make its value as high as possible while still getting 3.5v or more across the detector when the beam is broken. Wrap some tape around the sides of the detector or put it in a small cardboard tube, to shield it from extraneous IR from lighting and reflected IR from the emitter.

I took your advice and found that 400k Ohms of resistenance increases the range to 10-12" without any issues. (I could probably go even further, but that is sufficient for my needs.)

On the issue of scatter IR being detected-- this isn't an issue for my need. Because the sensor is in a hole below the surface of the pinewood derby track, only IR from directly above will hit the detector. Additionally, the beam should be interrupted successfully as soon as a car passes over the sensor--- there is less that 1/2 between the top of the IR detector and the bottom of the car.

Thank you not only for the quick response, but for providing enough details so that I was able to understand and implement your recommendation. I love it what a community comes together! Hopefully, I'll be able to help others in turn.

Thanks for the feedback; I'm glad you got it working!

why does it need a pullup resistor?

clankill3r:
why does it need a pullup resistor?

The phototransistor draws a current that increases with the amount of light it detects. The pullup resistor converts this current into a voltage drop that can be sensed by the Arduino. So the pin is at nearly 5v when little or not light is detected, and drops to around 1v when the light detected is at or above the desired intensity.