Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Reading electricity meter IR impulses

Status
Not open for further replies.

e1ioan

New Member
Yesterday I was triyng to read the infrared impulses from my electricity meter. The phototransistor I'm using, can see the IR from all the remotes in the house... but doesn't read the blink from the electricity meter. I can see the IR blink of the meter with any camera, is bright and powerful enough. I wonder why the phototransistor doesn't see it?

I'm using this schematic to read the IR beam and, like I said, works with all other IR sources I found around the house:

**broken link removed**

Any ideas?
 
I was questing your resistor. I would have a 1k to +5V.
BUT:
It is working on TV remotes and their format is known. What transistor are you using? Most are wide band so almost any type of IR will work.
 
You see the remotes since they put out a long train of pulses, the meter is apparently only putting out one short pulse. So either the frequency response or the sensitivity of the phototransistor is too low. Do you have an oscilloscope that you can view the signal with?
 
Radio Shack doe not have much information.
The input pin 2 must be a digital input.
If I could see the waveforn on pin 2 I would know if the transistor is too slow or there is a sensitivity problem.
 
You see the remotes since they put out a long train of pulses, the meter is apparently only putting out one short pulse. So either the frequency response or the sensitivity of the phototransistor is too low. Do you have an oscilloscope that you can view the signal with?

No, I don't have an oscilloscope.
If I understand right what you are saying, my test code, should take care of the very short impulses, in my code I have:

void IRDetected()
{
digitalWrite(statusPin, HIGH);
delay(500);
digitalWrite(statusPin, LOW);
}

[...]

attachInterrupt(0, IRDetected, FALLING); //Interrupt 0 is digital pin 2 on Arduino

[...]

so whenever a short IR impulse is detected, the statusPin should go HIGH (turn on a LED) for a half second.
 
Radio Shack doe not have much information.
The input pin 2 must be a digital input.
If I could see the waveforn on pin 2 I would know if the transistor is too slow or there is a sensitivity problem.

Hmm, didn't think that the transistor could be too slow to detect the short IR impulse. Any advice on *what* transistor to get? :)
 
Without an oscilloscope it's difficult to know the problems cause.

But I don't really understand your circuit. You have a 10k resistor going from the PT to pin 2 of the Arduino. So how does the Arduino bias the PT? What is the mode of pin 2? It would seem that you would want the resistor going to +5V and the junction of the PT and the resistor going to pin 2.
 
I have the pin 2 on HIGH and I'm using attachInterrupt on the pin 2 with FALLING for when the pin goes from high to low.

Just saw in Arduino's documentation that I actually have a problem in my code. I'm trying to turn the status LED on and off there... and that's not possible with a delay (just learned that delay doesn't work in the function called by attachInterrupt: https://www.arduino.cc/en/Reference/AttachInterrupt). You were right, the impulse probably is too short and I don't have a blink and with remote control works because they put out a long train of pulses. I should modify the code to:

volatile int state = LOW;

void IRDetected()
{
state = !state;
}

[...]

attachInterrupt(0, IRDetected, FALLING); //Interrupt 0 is digital pin 2 on Arduino

[...]

void loop()
{
digitalWrite(statusPin, state);
delay(500);
}

I'll have to test this when I get home.
 
Without an oscilloscope it's difficult to know the problems cause.

But I don't really understand your circuit. You have a 10k resistor going from the PT to pin 2 of the Arduino. So how does the Arduino bias the PT? What is the mode of pin 2? It would seem that you would want the resistor going to +5V and the junction of the PT and the resistor going to pin 2.

Yes, I asked from the start about the 10k resistor. There must be a pull up resistor on the Arduino. It is probably 100k. To get speed I think the pull up to +5V resister must be much smaller than 100k. There are some unknowns here.
 
This is not the right part but close.
See Fig9 Switching time and current.
If there is a 100k pull up resistor then the current is 50uA and the speed = SLOW.
 

Attachments

  • bpw85.pdf
    97.5 KB · Views: 293
Last edited:
According to the µP data sheet the pullup resistor is 20-50kΩ. This makes the PT operate rather slowly. That's why we say you need an external pull-up resistor to 5V.
 
Yes, Keep in mind that more current = fast. but it will take more light. 10K or 2.2k ????
For now keep the IR LED and the photo transistor close together untill we prove speed is the problem.
 
See if you can read the remotes outside, possibly the sunlight outside is saturating the phototransistor.
 
could be
I use the photo transistors with a IR filter. They are not clear but black. This blocks the visible light. Really helps.
 
See if you can read the remotes outside, possibly the sunlight outside is saturating the phototransistor.
Try reading the meter after dark.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top