High-Frequency Reed Switch

Hi, I'm new to using the Arduino. I have a reed switches I'd like to read, one at a time. The frequency for each switch can vary between ~12 to ~120 pulses per second. Can the Arduino reliably read the upper range of that?

I've seen this example: http://openenergymonitor.org/emon/buildingblocks/12-input-pulse-counting Low-level digital input registers are used in this example, and it seems a little less straightforward than it can be. Also, 1. I think this is for reading multiple inputs accurately. 2. In the benchmarks, they only tested it to go up to ~12 pulses per second, for 12 inputs.

And, generally, what would my code look like? digitalRead() or analogRead()?

Thanks!

yes it can , but depending on what the Arduino has to do more you can 1) use polling == checking the status of a pin "manually" OR 2) use interrupts == let the hardware of Arduino help you get every pulse

For the latter check the attachInterrupt examples that comes with the IDE.

To me, the question would be "can a reed switch reliably open and close at 120Hz"..... can they?

there always exists hall sensors ...

I randomly found this reed switch. It says it has an operating time of 0.6ms and release time of 0.1ms for an operate / release cycle of 0.7ms. Let's call that 1ms, 1000Hz.

I'm amazed actually....

Hall sensor... do you really want to rely on a mechanical switch?

JimboZA: I randomly found this reed switch. It says it has an operating time of 0.6ms and release time of 0.1ms for an operate / release cycle of 0.7ms. Let's call that 1ms, 1000Hz.

I'm amazed actually....

given the life time of 50 million switches @ 120Hz (from OP) would be about 5 days 12Hz ==> 50 days