Help with a phototransistor and an arduino

Discussion in 'The Projects Forum' started by rsp, Nov 12, 2009.

  1. rsp

    Thread Starter New Member

    Nov 12, 2009
    3
    0
    Hello all,

    I'm new here and fairly new to the world of electronics in general. I'm trying to teach myself a lot of the basics so please bear with me. :)

    I'm trying to use my arduino to detect a 'pulse' of light from an LED, housed in an electricity meter. The LED in the meter pulses once for about 250ms for every 100watt of electricity used.

    I want to use my Arduino to 'count' those pulses.

    I've been trying to wire up a phototransistor to both an analogue and a digital input (though, not at the same time!). Ideally, I'd like it to be wired to a digital input so that I can use a hardware interrupt but that is not essential.

    Currently, I've been experimenting with the following components from RS (www.rswww.com):

    654-8031 Phototransistor,5mm,Half Angle 25deg
    654-7993 Phototransistor, Sidelooker,35deg,LPT80A

    What I need to understand is the basics of phototransistors and how to improve the sensitivity of the devices - and how I might go about wiring them to the arduino to get the results I desire. I gather that changing the resistor to ground can increase the sensitivity, but also lower the response time. I don't know if that's correct, or what the relationship is between those two circumstances but I'd be very eager to learn if anyone can offer some advice?

    Many thanks in advance,

    Richard.
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Hello Richard,
    I'm afraid that your URL for RS didn't work; this one does: http://uk.rs-online.com/web/

    I pulled up the datasheets for those phototransistors. Their peak sensitivity is in the UV range; roughly 850nm to 880nm. Their sensitivity drops way down in the visible light spectrum. Have a look at the graphs in the charts.

    You don't mention what color that pulse of light is from the meter, or even if it's visible light. It would help a good deal if you could give us that tidbit of information.
     
  3. rsp

    Thread Starter New Member

    Nov 12, 2009
    3
    0
    Hi SgtWookie,

    Thanks for the quick reply and apologies for the broken URL.

    There are two types of meter I will be working with: those that emit IR pulses, and those that emit pulses in the visible range (i.e. a simple blinking red LED). Ideally, I'd like to try and construct a circuit whereby I can just change the sensor element according to the type of metering application.

    Is it possible that either the website description or the datasheet is wrong? When I call up the web page for the 6548031 part (http://uk.rs-online.com/web/search/...hod=searchProducts&searchTerm=6548031&x=0&y=0) I see this description:

    Type: Visible light
    Wavelength Range: 450 → 1100nm

    Of course if I'm using a sensor that can only detect UV light with a standard LED, I'm doomed to fail before I even begin! Your help is much appreciated.

    Thanks
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    No. The website description does give the range of wavelengths covered, but it omits the information that the sensitivity graph looks like a mountain peak. Have a close look at the graphs in the datasheets; a picture tells a thousand words.

    For example, the 2nd phototransistor you posted;
    Wavelength maximum sensitivity: 850nm; (720 to 920; 80%) 430 to 1070nm
    The peak sensitivity occurs at 850nm; the 80% sensitivity window is from about 720nm to 920nm. By the time you get down to 430nm or up to 1070nm, there is very little response. This makes it difficult to discern a valid signal input from ambient noise.

    Now if you're talking about the 1st LED, using an LED that emits light of 880nm in length, the transistor will sink about 4.8mA current with a collector voltage of 5v in normal light.

    So, 5v/4.8mA = 1,041 Ohms (rounded off); if you used, say, a 1.1k Ohm resistor from the phototransistor's collector to +5v, and the emitter was grounded, and you were measuring the voltage on the collector, you'd see about 200mV when it saw 880nm wavelength light, and nearly 5v otherwise - except for that ambient light level thing.

    Infrared remotes transmit in a range of 36kHz to 42kHz; they have a base frequency, and then there are commands sent along with the base frequency. The 36kHz to 42kHz carrier signal helps to compensate for ambient light interference; the receiver "looks" for that carrier signal, and adjusts it's upper and lower thresholds to compensate.
     
  5. rsp

    Thread Starter New Member

    Nov 12, 2009
    3
    0
    Hi SgtWookie

    I see. So, according to Wikipedia (that all time reliable source!), the wavelength of light in the visible spectrum is 380nm-750nm. With that information in mind, for my visible light pulse detector I would need to find a phototransistor (or a photodiode?) with it's maximum sensitivity in that range.

    Heading back to uk.rs-online.com, part #6548918 is listed as having sensitivity in the 350 → 950nm range, and looking at the datasheet has it's peak sensitivity at around 650nm. According to a quick search, red light is in the range 622nm-780nm, so this device should be most sensitive to red visible light?

    Am I on the right track here?

    Thanks,

    Richard.
     
Loading...