Digital input frequency

Hello everybody.

I am an engineering student(mechatronics, 3rd sem) and i am just looking for a solution to count pulses at a "high" frequency. 250-500 Hz actually. It is not very "high frequent" but the hardware (some selfmade controlling unit) we got in the company i am actually working for, is not able to count that fast.

would one of the arduino boards be able to do this? I wasn't able to gather informations about this specific question (but if people measure their rpm of the engine...) i am just asking to be sure about this.

The pulse will be counted by a simple "if -> oh, well then x+1 -> treshhold reached -> x=0" routine or sth like this.

Could you suggest a specific one? I need to count 16 to 32 input ports (so i guess i need a board, delivered with 16 to 32 digital input ports)

Greetings qasl

There is a library I have used before - Freqcount. Google it or you can get a copy from the TCS sensor library at my site (see below in the signature block).

I think this means "yes - use this library to make it happen"

I am sorry to tell you, that the library you are talking about is not available following the link in your signature.

Take a look at this:

http://www.pjrc.com/teensy/td_libs_FreqCount.html

This is excacly what i found recently, thanks a lot!

Is this library neccesary for just counting pulses? There is a flowmeter bouncing signals to my control unit and i need to close the valve when the "needed" ammount of liquid passed the flowmeter. The information i got from the description is, that this is needed for high frequencies (2kHz and up) i don't think that i will be in the need for such high frequencies. 1khz is the upper Limit for sure. (and this will be far too much as well)

get a copy from the TCS sensor library at my site

Maybe that was not clear, but it is bundled in my library for the TCS230 color sensor. Anyway, looks like someone else found it as well.

that this is needed for high frequencies (2kHz and up) i don't think that i will be in the need for such high frequencies

In the same place there is library called FreqMeasure that is for lower frequencies. How you count changes in order to retain accuracy.

Is this library neccesary for just counting pulses?

Not at all. You can just count pulses either by polling the I/O and detecting rising or falling edges, or you can use an interrupt to do the counting work in the background. The point is that your 'high' frequecy is actually not that high and the Arduino is more that capable of doing what you need (which answers your original question).

Your application is actually not a frequency count application but just a straightforward pulse count of the flowmeter for valve control, so use of the frequency counting libraries is probably not what you need anyway.