Go Down

Topic: Detect optical pulse from water/gas/elec meters (Read 10722 times) previous topic - next topic

RichP

Hi all

Just a quick question. I'm undertaking a small project to try and 'count' the optical pulses from gas/elec/water meters. Would the Maplin SFH2030/SFH2030F (IR) sensors be sufficient for this? Ideally what I'd like to do is produce either a change to HIGH or LOW voltage whenever a pulse is detected.

Any suggestions/input on the suitability of these sensors and how they might be connected would be greatly appreciated.

Thanks! ;)

Richard.

mike_pa

Hi,

yes, connect the athode to +5V and the anode with a 47k resistor to GND. Connect the junction of the diode and the resistor to an digital or analog input of the Arduino. The digital input works only, if the light puls is intensive enough. Better use the analog input, then you can determin the switching level, hysteresis etc. by yourself.

Mike

pluggy

I'd go for something like this :

http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=4550767

Its a phototransistor rather than a diode so its more sensitive and being side looking, its a doddle to stick it on your meters with tape.   I have a similar one counting blips on a meter with a red LED, with a 100k resistor and on a digital pin using interrupts.
http://pluggy.is-a-geek.com/index.html

agent smith

Very interesting and a cheap way to measure consumption from electronic meters for electricity we have in Italy


There is a topic also for meters with reed switch like the methane gas ones.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1244509204/6#6

RichP

Hi everyone,

Thanks for your input.

I've had limited success with detecting a 50 or 100ms blink from an LED using these sensors. I've decided to give Pluggy's idea a try and placed an order with RS for some phototransistors instead, hoping that the extra sensitivity will yield better results. The idea of using it with a digital pin, too, is desirable.

Cheers

Richard

RichP

Hi

Just a quick follow-up question. For this project, the sensors will need to be approximately 10 metres from the Arduino. As a relative newbie, I'm aware that voltage will drop off over distance but I'm not sure if this will affect the outcome of my project. Is there anything I should be aware of when using the phototransistors over this distance?

Thanks,

Richard.

pluggy

#6
Nov 08, 2009, 02:52 pm Last Edit: Nov 08, 2009, 03:03 pm by stephen_t Reason: 1
The one I'm using is around 8 metres from the arduino, since its already an high impedance circuit a few extra ohms in the wiring is immaterial. if you were trying to measure a high speed signal, the capacitance of a long run might come into play, but if your meters are anything like mine they blink somewhat infrequently (at the most once a second in my case, more often than not a lot less frequently ) and the odd micro/milli second delay isn't going to be an issue.   I use a single twisted pair I pulled from a length of CAT5E cable.
http://pluggy.is-a-geek.com/index.html

Ran Talbott

Quote
Is there anything I should be aware of when using the phototransistors over this distance?


Noise:  if not properly wired,  you're basically setting up a 10-meter antenna that will try to attract electrical noise into your system.  And quite possibly succeed.

I would use a twisted-pair cable,  like telephone wire or Cat5,  and make sure all the unused wires are grounded.  Also,  use a strong pull-up,  instead of a weak one,  on the input.  Say,  1K,  rather than the 10K or so commonly used.

Try to borrow an oscilloscope to check the input to see whether you've killed the noise.  If you haven't,  you can use the "spare" conductors in the twisted-pair cable to send power out to the sensor (I would use 9-12V,  and use a local 78L05 to regulate it down to 5V),  and add a balanced line driver designed to overcome noise (like a 75176) to get a solid signal back to the Arduino.

Ran

EriSan500

Well, I'm bugged with the noise in this situation, and trying to find a sollution for weeks.

You say grounding the not used wires in cat5/6 cable, do I have to do that on both ends?

What else can be done to eliminate the noise?

Greetings,
Eric

RichP

Hi all

Pluggy - as per your suggestion, I tried some phototransistors. I ordered parts #6548031 and #6547993 from rswww.com. I'm having almost no luck at all detecting the light from a blinking LED.

Could you suggest a suitable wiring setup so that I can connect it to a digital input, and maybe get a HIGH or LOW whenever there is a burst sufficient enough?

I tried an analog setup but there doesn't appear to be a big enough difference in readings between no light and bright light, so maybe my circuit's wrong?

What resistor would be a good value to use?

Thanks,

Richard.

RichP

Hi all

Just an update. Pluggy - I'm not sure if you're aware, but I've since learned that the part numbers you suggested have their peak sensitivity in the UV range which of course isn't going to give me very good results in the visible range.

I'm trying to find some suitable parts on rswww.com to do what I need.

Thanks

Richard.

pluggy

#11
Nov 13, 2009, 11:21 pm Last Edit: Nov 14, 2009, 12:15 am by stephen_t Reason: 1
The link I posted was for IR (not UV) phototransistors although their range does extend into the visible red end of the spectrum.  From your initial post I took it as these were what you were trying to read.

The actual one I have used is

http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=654-7993  (the same one as one you've ordered apparently. )

Since the LED its watching is red.  It is wired as the right hand side of this circuit (the LH is for a LED as for a reflective object sensor and can be ignored) with a 100k resistor and the test point is connected to a digital input pin.

It typically reads 4.6 volts with a meter between blinks and drops to just under a volt when the LED flashes.  Its just taped onto the glass over the LED with black insulation tape.  It is 'handed' and only works one way, there is a small raised pimple on one side (on mine at least) which must be put towards the LED, it was practically blind stuck on the other way round.  The collector and emitter are connected to a 8m length of twisted pair pulled from a length of cat5E (it yields another 3 similar pairs ;) ) the resistor is local to the arduino.  Its in a 3 phase meter cupboard so it probably isn't the electrically cleanest environment.  Depending on your milage, you may get away with a lesser resistor (it decreases the sensitivity of the phototransistor in this instance - the lower the resistor, the brighter the blip needed to sink enough current to drop the voltage) to help if you have a noise problem.  

http://pluggy.is-a-geek.com/index.html

RichP

Hi Pluggy

Thanks for replying and for your circuit diagram - I think it's just what I need and I look forward to testing it out tomorrow and letting you know how it goes.

To test, I'll be rigging the Arduino to blink a standard red LED at 5 second intervals (to simulate the pulse from the meter) and attach an interrupt to the pin so I can hopefully blink a green LED at the same time the RED one is detected.

I'll let you know how it goes.

Thanks

Richard.

pluggy

Let us know how you get on.   I had trouble until I discovered the pimple and the one way sensitivity.  

You can see the fruit of my labours here :

http://pluggy.is-a-geek.com/majestic.html

The electricity graphs are done by the photo transistor.  I'm adding some more stuff today if all goes well.  

It has its down sides, I went round there at midnight last night to turn off some lights that somebody had left on.........
http://pluggy.is-a-geek.com/index.html

RichP

#14
Nov 14, 2009, 12:21 pm Last Edit: Nov 14, 2009, 12:51 pm by brainthings Reason: 1
Hi Pluggy

I'm trying this now and I'm still having trouble :)

In my test rig, I basically have a red LED pointing directly at the pimple on the phototransistor (the LED connected to a test switch, as in your diagram). Here's my test program:

Code: [Select]
void setup() {
 attachInterrupt(0, chg, FALLING);
 pinMode(13, OUTPUT);
 digitalWrite(13, LOW);
}


void loop() {
}

void chg() {
 digitalWrite(13, HIGH);
 delay(1000);
 digitalWrite(13, LOW);
}


Pin 13 has a GREEN led attached to it - that's supposed to FLASH whenever I press the switch to flash the RED LED (i.e. the phototransistor has dropped the voltage on digital pin 0). But it just doesn't drop it low enough. Starting to get very frustrated now!

At this point I can't seem to figure out how to wire the phototransistor properly to even test whether it's working: can you perhaps suggest how I might go about checking that?

Thanks

Richard

Go Up