2
\$\begingroup\$

I have an anemometer which outputs current pulses. I can't take it apart but I know there is a phototransistor and LED in parallel shining through holes to it. I was told that with 30m/s wind there will be 3uS long current pulses over the normal current (through the LED).

My problem is to transfer these pulses to an Arduino or convert these pulses to voltage 0/1. Arduino is no problem for me, but I am inexperienced in circuit design.

\$\endgroup\$
  • 1
    \$\begingroup\$ Do you have a link to the anemometer so the spec can be analyzed? Do the pulses remain constant width but the pulse rate increases with wind speed? \$\endgroup\$ – Andy aka Apr 4 '13 at 11:51
  • \$\begingroup\$ Current -> voltage translation can be done crudely with a resistor, or if the current is very small done properly with a "transimpedance amplifier". \$\endgroup\$ – pjc50 Apr 4 '13 at 12:05
  • \$\begingroup\$ Andy aka: Unfortunately no, its some proprietary old piece \$\endgroup\$ – user22108 Apr 4 '13 at 12:27
  • \$\begingroup\$ Question cannot be answered without details of the "pulses" - what is the amplitude? \$\endgroup\$ – Leon Heller Apr 4 '13 at 13:18
  • \$\begingroup\$ @Leon Heller: I have no equipment to meassure pulses - but like i said, it works like this yoctopuce.com/pubarchive/2013-01/impulse_counter_1.jpg (phototransistor is parallel to led and resistor, so its connected with one pair wire) \$\endgroup\$ – user22108 Apr 4 '13 at 15:29
3
\$\begingroup\$

You don't want a "frequency to voltage" conversion. That tends to be tricky, error prone, and generally a hack of a solution.

What you really want is to run the pulses directly into the MCU and measure the frequency directly.

Here is an app note on exactly how to do that with the AtMega MCU's. How you actually do it with the Arduino software is something I can't answer.

AVR205: Frequency Measurement Made Easy with Atmel tinyAVR and Atmel megaAVR

\$\endgroup\$
  • \$\begingroup\$ Apparently, I stand corrected. \$\endgroup\$ – angelatlarge Apr 4 '13 at 18:21
  • \$\begingroup\$ @angelatlarge <grin> :) \$\endgroup\$ – user3624 Apr 4 '13 at 19:25
2
\$\begingroup\$

Without specs, we don't know if there's a one-shot making 3us(?) pulses twice per revolution (based on the mechanical diagram) or the pulse entirely controlled by disk cutouts. But what you can count on is two pulses per revolution.

It's unlikely that the pulse frequency would overwhelm an Arduino (if it does, you've got bigger problems than electronics!) so you could count pulses in a simple loop. Take a f'rinstace: a 1KHz pulse train means 1ms interval between pulses. Remember, we're just counting them, not measuring them, so a grossly inefficient loop could certainly keep up with it. 1000 Hz would imply an anemometer speed of 500 RPS = 30000 RPM! Your anemometer would disintegrate before then.

So pulse counting won't be a problem. You can decide whether you only need the Arduino to count pulses or to do some heavier processing with the result.

In the latter case, read the the data sheet about counter-timers (chapters 15-17 for the ATmega328p, f/ex). By using a counter timer, the hardware will count for you while your program only has to read the counter value every so often to find the speed, and its entire processing power is available for whatever else you want to do with the data.

\$\endgroup\$
0
\$\begingroup\$

There is some confusion here so I looked at the picture linked to by the OP(below) enter image description here

If the duty period of "something" is 3us then it just can't be caused by the gaps in the spinning wheel - it has to be that the led is pulsing as a means of providing a counter-measure to normal sunlight getting in. That's the only explanation I can think of.

Given also the assumption that the LED is driven with an asymmetrical duty cycle up to possibly 100 times the mark period, it might be feasible to construct a circuit that converts the pulse trains into a positive voltage and when the opto is "shut" it returns 0V. Maybe something like this: -

enter image description here

Therefore I would (given all the assumptions and reading between the lines) propose that the photodiode in the opto-coupler is buffered with a transimpedance amp and then its output feeds a conventional AM detector built around a diode, resistor and capacitor. This output then feeds a comparator/data slicer and is then suitable for an Arduino input

To make things less hardware intensive on the analogue side the pulse train from the transimpedance amp could directly feed an Arduino input and the software can "construct" a demodulated version which can be counted.

The counter would be two pulses per rev (assuming the picture is representative) and this should translate to wind-speed. I say "should" because there is likely to be a non-linear relationship between wind-speed and rotational speed. Good luck with this project.

\$\endgroup\$
  • \$\begingroup\$ At hurricane-force winds, assuming the wheel to spin at windspeed, a 1mm slit will take 0.008uS to pass, according to my back of the envelope calculations \$\endgroup\$ – angelatlarge Apr 4 '13 at 20:26
  • \$\begingroup\$ @angelatlarge - they don't look like 1mm slits to me - i think the opto is positioned over the long slots. Hey it's a 2D versus 3D thing!!! \$\endgroup\$ – Andy aka Apr 4 '13 at 20:49
  • \$\begingroup\$ Sure, but that means a 35cm slit will give you 3uS pulses in a hurricane, assuming my math is correct. Just sayin' that 3uS doesn't seem insane without the LED pulsing. \$\endgroup\$ – angelatlarge Apr 4 '13 at 20:53
  • \$\begingroup\$ If the slit/slot is 1mm wide and it is at a radial distance of (say) 10cm, the circumference at this distance will be about 630mm and this means, using 0.008us per mm, 360 degrees converted to time = 5.04us or 200,000 revs per second. I'll give ya ten minutes to figure out where ya went wrong LOL \$\endgroup\$ – Andy aka Apr 4 '13 at 21:02

protected by clabacchio Apr 4 '13 at 18:29

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.