Reading fan rpm/tach with Attiny85 (PCINT0)?

Hi folks. I am completely new here and curious if the PB0 (i.e. PCINT0) pin on the ATTiny85 is capable of measuring/detecting the yellow wire tach signal on a typical PC fan; or do I need to use another pin for detecting the rpm?

Thanks!

Any of the pins on the ATTiny85 can be used for that task, if you're doing it with a PCINT - if using INT0, you need to use the INT0 pin, PB2.

Even if the fan was spinning at 6k RPM, that's 100 RPS, so 200hz, which is not so fast that it would require extreme care to measure, so there are a lot of ways to do this...

Thanks much. What is the best/easiest way to read the tach with PB0? Is there another thread on this or is it simple code you happen to know?

Thanks again :slight_smile:

Note that the fan is running from 12 V but you need to constrain it to 5 V for the MCU input. A 22k resistor and a 4.7 V Zener for example.

This makes sense, got it :slight_smile:

Paul__B:
Note that the fan is running from 12 V but you need to constrain it to 5 V for the MCU input. A 22k resistor and a 4.7 V Zener for example.

It looks like the tach output on three wire computer fans is open drain / open collector, with no internal pullup (presumably for exactly this reason), so I don't think you even need the protection....

DrAzzy:
It looks like the tach output on three wire computer fans is open drain / open collector, with no internal pullup (presumably for exactly this reason), so I don't think you even need the protection....

Which makes sense since the logic it is monitored by is essentially 5 V.

Best check of course. Simply put a voltmeter on it while the fan is running - if no voltage at all, it must be open collector.