On Mon, Oct 10, 2011 at 10:49 PM, Philippe Habib <phabib@well.com> wrote:
> **
>
>
> I have a bunch of 4 wire fans to monitor. These are fans that take a PWM
> input for speed, and have a tach output in the form of a square wave with a
> frequency proportional to speed. A stopped fan puts out a constant low.
>
> At low speed, the period is about 80ms, at full speed, about 9ms.
>
> The tachs are connected to general purpose I/O so I can't just set a
> counter going to determine frequency and check up every so often.
>
> To monitor them my first thought was going to wait until the signal level
> changed (or 50ms) and then wait for the signal level to change again (or
> 50ms) and figure if it changed twice the fan is turning. Worst case that
> would take me about 40ms, with an average wait of 20ms.
>
> Next idea was to read the input and figure any high means the fan is
> turning, then if the fan is low, wait up to 50ms for a high before declaring
> the fan dead. Worst case is still 40ms, but the average wait drops because I
> only need the first wait 1/2 the time.
>
> I don't need to monitor them very often. Once a minute is plenty.
>
> What are some other ways I can monitor these things with minimal overhead?
> __._,
>
You don't mention which AVR you want to use. It also appears that you
don't care about the speed, just the fact that the fan is spinning.
Anyhow, I'd just use a simple pin change interrupt if it was available.
Set a flag bit in the pin change ISR (or increment a counter) , test it in
your main code.
-carl
[Non-text portions of this message have been removed]Message
Re: [AVR-Chat] Monitoring 4 wire fans
2011-10-11 by H. Carl Ott
Attachments
- No local attachments were found for this message.