Read 16 or more RPM status!

Hi,
I just need to know how can I read 16 or more RPM sensors (Hall effect sensor on PC fan) with one Arduino?

There is a lot of examples out there, I looked into most of them, and all of them are just for one PC fan!
So how can I read multiple RPM sensors at once?

is it possible to use one of those Analog input multiplexer?
I need it because of logging :slight_smile:

Thanks a lot

AFAIK a Hall effect sensor provides a digital output so why would you be considering an Analog input?

You could use Pin Change interrupts to have extra interrupt pins. HOWEVER ...

How many pulses per second will each fan be generating? I wonder if a 16MHz Arduino would be fast enough to measure time between pulses on 16 fans.

...R

Robin2:
How many pulses per second will each fan be generating?

Most PC fans generate AFAIK two pulses per revolution (four state changes).
Case fans could be 800-1200 RPM, performance fans could be 1800RPM or more.
1800RPM * 4 /60 = ~120 state changes per sec, per fan.
Leo..

Wawa:
1800RPM * 4 /60 = ~120 state changes per sec, per fan.

Thus, for 16 fans there could be nearly 2000 changes per second or one every 500 microsecs. That may be possible with an Uno or Mega. However it may not leave a lot spare CPU cycles for the Arduino to do other stuff.

...R

Robin2:
Thus, for 16 fans there could be nearly 2000 changes per second or one every 500 microsecs. That may be possible with an Uno or Mega. However it may not leave a lot spare CPU cycles for the Arduino to do other stuff.

...R

They could say interface 2 MCUs?

One dedicated to measuring "pulses per second" for each pin...
Then using say I2C, SPI or UART, it can then send the latest readings to the main MCU when requested.

So yeah...depending on what you want to squeeze in to ~500uS...but 500uS is quite a long time still!
500uS in 16MHz ticks = 8000 clock cycles.
You may need to use them wisely...but depending on what you want to do with all these values it is possible.

Robin2:
AFAIK a Hall effect sensor provides a digital output so why would you be considering an Analog input?

You could use Pin Change interrupts to have extra interrupt pins. HOWEVER ...

How many pulses per second will each fan be generating? I wonder if a 16MHz Arduino would be fast enough to measure time between pulses on 16 fans.

...R

My fans at maximum speed have 2200 RPM, this means 4400 pulse per minute! its means 1173 pulse per second.
and each fan can Generate 73 pulse per second.

Wawa:
Most PC fans generate AFAIK two pulses per revolution (four state changes).
Case fans could be 800-1200 RPM, performance fans could be 1800RPM or more.
1800RPM * 4 /60 = ~120 state changes per sec, per fan.
Leo..

Thanks :slight_smile:

Robin2:
Thus, for 16 fans there could be nearly 2000 changes per second or one every 500 microsecs. That may be possible with an Uno or Mega. However it may not leave a lot spare CPU cycles for the Arduino to do other stuff.

...R

But the wiring diagram still remains a problem for me :frowning:

Johnny010:
They could say interface 2 MCUs?

One dedicated to measuring "pulses per second" for each pin...
Then using say I2C, SPI or UART, it can then send the latest readings to the main MCU when requested.

So yeah...depending on what you want to squeeze in to ~500uS...but 500uS is quite a long time still!
500uS in 16MHz ticks = 8000 clock cycles.
You may need to use them wisely...but depending on what you want to do with all these values it is possible.

Yep, This is what I planned. use one or two arduino mini to measure only fans speeds and read them through i2c.

sonixax:
But the wiring diagram still remains a problem for me :frowning:

Can you do it with a single fan?

If so post the program and the wiring diagram you have used.

If not, that's the place to start.

...R

This is what I planned. use one or two arduino mini to measure only fans speeds and read them through i2c.

The problem with that is that I2C communications is under interrupts and that will stop or disrupt the speed measurements.

If you use Serial communication you can simply send the data every now and then. The sending part will just send it out, regardless of whether the receiver is actually listening or doing anything with the data. Then when you need this data, instead of requesting a transmission, you can just read the latest - that is, assuming you don't care about the data being a couple dozen milliseconds old.

Robin2:
Can you do it with a single fan?

If so post the program and the wiring diagram you have used.

If not, that's the place to start.

...R

Hi,
Yep, I managed to read one fan RPM status using this Wiring diagram and sketch:

http://www.theorycircuit.com/reading-dc-fan-rpm-arduino/

very nice tutorial :slight_smile:

So now how can I read multiple? what is the right wiring diagram and sketch changes?

Thanks a lot and Happy New Year :stuck_out_tongue:

Very crude way or measuring RPM. It may work.

So what you have to do:

  • connect the multiple fans on different pins (make sure this are pins that have an interrupt available - on Arduino not all pins have interrupts, and some are shared with other functions).

  • add an ISR for each one of them in your sketch.

  • every now and then read the numbers and calculate rpm with it - better not use delay() for the intervals, use millis() timing, makes it much easier to handle more at the same time. See "blink without delay" for an example of how that works.

sonixax:
So now how can I read multiple? what is the right wiring diagram and sketch changes?

Start by posting YOUR program and YOUR wiring diagram here so we can see them easily.

...R

Robin2:
Start by posting YOUR program and YOUR wiring diagram here so we can see them easily.

...R

Exactly like this:

http://www.theorycircuit.com/reading-dc-fan-rpm-arduino/

Program and wiring diagram are the same!

wvmarle:
Very crude way or measuring RPM. It may work.

So what you have to do:

  • connect the multiple fans on different pins (make sure this are pins that have an interrupt available - on Arduino not all pins have interrupts, and some are shared with other functions).

  • add an ISR for each one of them in your sketch.

  • every now and then read the numbers and calculate rpm with it - better not use delay() for the intervals, use millis() timing, makes it much easier to handle more at the same time. See "blink without delay" for an example of how that works.

No its not possible to connect 16 fans to different pins! I think!
And because of that I ask for a correct wiring diagram and sketch.

As I found no one never tries to read 16 fans at the same time!
Even I cannot read two on the same input! is there any example out there? to read two or three rpm with only one input?

I want to use Arduino MINI (Slave) to read fans and then send them to my mega (Master) with i2c or serial!
Maybe two different mini each can read 8?! it seems its easier.

add another minis to read temperature and a 16ch pwm module to control the voltage and speed.
for most of things I want to do I found tutorials and examples except this one!

Please help :slight_smile:

Thanks a lot

I don't see why it can't be done.

An Arduino has interrupts available on all pins - mind you: that are pin change interrupts, so you get an interrupt at both the start and the end of a pulse, and are basically double counting. That doesn't matter as you just have to divide by 2 later.

16 ISRs should be OK.

Serial and I2C communication uses interrupts, this may throw off your measurements. I really don't know if, and if so: how, they could influence each other.

Hi,
How accurate does the RPM reading have to be, how often do you need to update the readings?

Tom... :slight_smile:

wvmarle:
I don't see why it can't be done.

An Arduino has interrupts available on all pins - mind you: that are pin change interrupts, so you get an interrupt at both the start and the end of a pulse, and are basically double counting. That doesn't matter as you just have to divide by 2 later.

16 ISRs should be OK.

Serial and I2C communication uses interrupts, this may throw off your measurements. I really don't know if, and if so: how, they could influence each other.

I need my resources to calculate other things and send/receive data through i2c!

TomGeorge:
Hi,
How accurate does the RPM reading have to be, how often do you need to update the readings?

Tom... :slight_smile:

Honestly I just want to log data because every fan speed set through 16CH PWM module and some Low-Pass Filters.

So I just want to read data, and timing is not too priority I believe!
maybe every one or two seconds!

and what about using 16CH Digital/Analog Multiplexer?
Read all 16CH data every one or two seconds?

Thanks a lot:)

I don't get where you want to go with that multiplexer.

You have to count pulses and measure time in between pulses. If you need the resources for other things, don't measure all the time - measure a handful of pulses to get the RPM from all fans, then stop measuring to do your calculations.

So I just want to read data, and timing is not too priority I believe!
maybe every one or two seconds!

So write a function that does that by using the pulse in measurement method and call it when you need it or have the time.

and what about using 16CH Digital/Analog Multiplexer?

Yes you can do that although obviously it will take 16 times longer.

The thing is when you have interrupts going off constantly measuring things you use up all your CPU cycles doing that and, to use a technical term, bugger up, other stuff that uses interrupts.