Interrupt detection

Hi,

I am interfacing a Wind sensor to an UNO board. The wind sensor generates 5 Volt pulses. The pulses frequency depends on the speed of the wind. If speed of the wind is 5 mph then it will produce two pulses per second.

I want to detect these pulses using an interrupt that will increment a counter. Please tell if this is the right way to go. How can I implement this in software? Any examples source code etc.

John

I think the IDE has some interrupt examples, but for the sort of rates you're talking about, I can't really see that interrupts are necessary.

Start by reading this:

http://www.gammon.com.au/interrupts

Does the wind sensor include pulse debounce hardware?

aarg: Does the wind sensor include pulse debounce hardware?

I do not know. The sensor is as below

http://www.inspeed.com/anemometers/vortex_wind_sensor.asp

If the reed switch is all that's in there, you need to debounce it somehow, or you will get incorrect pulse counts. It can be done in hardware or software.

If you're going to use interrupts to read it, I would suggest a hardware debounce. Much easier than software debouncing in an interrupt. Just two capacitors and be done with it.

Delta_G: If you're going to use interrupts to read it, I would suggest a hardware debounce. Much easier than software debouncing in an interrupt. Just two capacitors and be done with it.

You meant a series RC circuit. If yes, what time constant would you recommend?

MKJohn: You meant a series RC circuit. If yes, what time constant would you recommend?

I never thought about it that deep. I always just sort of experimented with increasingly larger caps and my scope until I found one that worked.

Delta_G: I never thought about it that deep. I always just sort of experimented with increasingly larger caps and my scope until I found one that worked.

Cool! I will experiment with it too. I am also planning to use Arduino Zero. It comes with SAMD21G18A-AUT.

Do you know how many UARTs does this micro controller offer?

Plus I also plan to put this processor on my own board. And I was wondering what would be the issues regarding programming it using Arduino IDE. I do not want to put USB chip on the board that zero board uses to get programmed.

Presently I am running code using Arduino UNO. Is the code be transferable to Zero?

Any suggestions.

jess