Using ESP32-C3 Super Mini, which GPIO pin would be best for reading a fan tachometer signal? #19131
Replies: 3 comments
-
|
to read tacho from fan i recommed to use: a) omp-amp or some simpler solution ( zener diore , etc) for forming impulses see also : Computer Cooling Fan Tachometer Wire ,or: Ad1. So You can use aby ISR input to count impulses. And since You propably want measure high speed of Fan - just simple code for frequency meter will be sufficient . If You want just turn on/off fan (without speed control) then You can use just ADC for current measurement (voltage on shunt resistor) , ad2 Ad5.
But all this problem are always easy to solve ( ussualy shielded wires or magnetic screens for insulation or propet use ground line layering on PCB'develepment board). Tacho signal amplitide is ussaly much higher than noise, but if impulse noise occure - then simple R-C filter will help ( like in ad1. a) link Ad3 - for What purpose You want validate tacho -impulses witch reading ADC ? AD6. For any control solutoin it is good practice to indicate( by led or other visual/sound mechanism) state of the process like |
Beta Was this translation helpful? Give feedback.
-
In which case why bother reading the fan RPM? The only reason I can think of is to check for the case where the fan has failed. I would simply use two temperature sensors, one on the outside air intake and the other on the equipment being cooled. Switch the fan on when the inside temperature exceeds a threshold. Sound an alarm if either the inside temperature exceeds a higher threshold or if the temperature diference becomes excessive. This avoids any hassle with signal quality and voltage levels. There are failure modes that measuring rotation will miss such as blockages to inlet or outlet vents. The fan will happily spin while achieving nothing. Measuring temperatures is safer. |
Beta Was this translation helpful? Give feedback.
-
|
@peterhinch , yes you raise a valid point. In the past I have had fans fail, and yes I do want to know if or when it does, for this project. The RPM results will going to my home automation I already have, i.e. MQTT based, and I have a custom Node Red dashboard (Yes, I could use something else, but I enjoyed learning Node Red). Never mind the fact that this would, IMHO be a fun project to do. I happen to have an ESP32-C3 Super Mini, and why not use it. :) There is no reason why I cannot add a couple of i2c based temperature sensors. @2dof, I think I noted, I have not plans for speed control, or any PWM use at this point. The possible use of ADC, of which I have done little with ADC, was more of sanity check... in that I have done interrupt signal processing before in MP and otherwise, so to some modest extent familiar with falling or raising 'digital' signaling. But figured I would ask, in case someone could see 'better' use case for using ADC. From what I gather given all the responses, use of ADC has some complexities that I would rather not tackle for this specific project. But, as a lab, or learning effort, I do want to explore more ADC use. I designed a simple prototype layout board last night, which includes a WS2812, so I can provide 'LED' status color coding, as visual indicator. This will of course also be telemetry to the Node Red dashboard for virtual LED indicator. Guys, again, thank you, off and on over the years, I have interacted with MP forum, and later here in the discussions, always wonderful. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using ESP32-C3 Super Mini, which GPIO pin would be best for reading a fan tachometer signal? This is what I believe is valid?
The fan is a typical 12v, 3pin or 4pin case fan that is cooling a small wifi access point that is in an extreme environment. Yes, the ESP32-C3 is going to suffering a bit, but replacing a super-mini worse case once or so during the summer extremes, a lot less hassle than replacing the entire wifi access point. I may add a temperature sensor (via i2c) as well, but maybe that is next generation. I have no plans to implement any fan control via PWM. Fan always on, at maximum RPM, is fine.
ESP32-C3 Super Mini lacks a PCNT (hardware counter)? So I am limited to an interrupt based scenario, for this use case, not a big deal if I have some CPU lag on the tachometer accuracy. This is better much just validating the fan is spinning, if it basically accurate, a plus
I figure I can use D3 (GPIO 5) usually is the top left most pin, if looking at the board with USB port north, and WiFi antenna south.
Can I use ADC-1, i.e. GPIO 1? I think... it may transmit 'garage' during boot, but not sure I care? Or do I? A second or two, should have valid tachometer values, right?
I plan to use mqtt_as as the core of the solution so I can send the tachometer results via MQTT, as will as request read of tachometer value on demand, as long as I initialize the interrupt, before the main asyncio loop, I just need to read the 'counter' on each publish or subscribe request. Oh, and reset the counter as applicable of course.
Oh, as I recall most GPIO pins on ESP32 have software resistor pull up, need that for the interrupt, believe GPIO 1 and GPIO 5 have such.
I might add a separate LED to flash as fan is spinning... but that is just shooting for the moon... :) Or I just flash on-board LED (GPIO 2) of course.
This seem feasible, fair approach or am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions