• Wandering tachometer, a digression

    WJCarpenter09/11/2022 at 21:32 0 comments

    On the way to measuring the loudness of fans running at various speeds, I also wired up the tachometer output to an ESP32 pin to monitor the speed. The somewhat ancient Intel spec for PWM fans (I haven't yet found a newer one) requires a linear relationship between the PWM duty cycle and the fan RPMs, at least for the mainstream part of the graph. The spec generally asks things to meet a +/-10% tolerance. I wanted to see if that actually held true for the PWM fans I have on hand.

    The tachometer output from the fan is the 3rd wire on the connector, for both 3-wire (non-PWM) and 4-wire (PWM) fans. It's called "sense" in some diagrams and documentation. The idea is that the controller can get feedback about the effects of the inputs it sends to the fan (whether PWM duty cycle or varying supply voltage) and can dial in some particular RPM target, or at least display the fan speed for humans to geek out on. The spec calls for 2 pulses per revolution, typically implemented via Hall effect sensors. The pulse count divided in half and then multiplied by 60 will give RPMs. (Puzzler for wiseguys: see if you can solve that with just a single multiplication.)

    Like many explorers before me, I found the pulse count measurements to be surprisingly unstable. As I changed the PWM duty cycle in increments of 10%, I could hear the fans running faster. But it took a couple of minutes for the pulse counts to settle down, and they never really became completely stable. There was generally a correlation between the PWM duty cycle and the RPMs, but it was only roughly linear. Most perplexing of all, when I got up to the 80-100% duty cycle area, the pulse counts sometimes decreased pretty dramatically.

    At first, I blamed the fan manufacturer, but I observed this on five different fans from three manufacturers. What the heck could be going on? The mystery was at least partially resolved when I used a scope to observe the tachometer output. I was slightly surprised by one thing and greatly surprised by another.

    The scope trace of the tachometer above was taken at a PWM duty cycle of 40%. (Sorry for the lousy photo. My scope is not configured to let me take a real screenshot.)

    The slight surprise was that the pulse outputs were not the nice, tidy square wave I was assuming. Instead, they had non-trivial ramps for the tops and bottoms of the waveform, gravitating toward the midpoint. The waves themselves are roughly 50% up and 50% down. There are some return-to-midpoint mini-pulses within each real pulse.

    Hypothesis: The ESP32 might be counting unreliably due to the ramps on the top of the waveform.

    The big surprise was in the voltage range of the tachometer pulses. To be honest, I didn't even give this any thought when I wired things up. On the scope, I could see that the pulse waveform was centered around 0 with the waveform going between roughly +/-2.5v. Just through dumb luck, the pulses at +2.5v were visible to the ESP32 3.3v input pins. The ESP32 spec guarantees detecting a HIGH on an input at 0.75*Vdd or higher, or 2.475v. That was pretty lucky, except for one thing. I noticed that as the PWM duty cycle went up, the waveform shifted down. I assume that's somehow related to the power draw for driving the fan. In some observations, I saw it go as low as about 1.8v at higher RPMs.

    This is more than a hypothesis: When the PWM duty cycle gets high enough, the waveform drops low enough that the ESP32 does not see as many HIGH pulses, so the pulse count actually drops. This is not the fault of the ESP32, of course.

    Surprisingly, the Intel spec cited above does not actually say what the voltage range of the tachometer should be, though it does say the signal should be pulled up to the 12v supply. I have already been using the ESP32 internal pullup to 3.3v. The pullup makes some kind of difference, but I don't yet grok what it does. Various "someone on the Internet" postings make conflicting claims. Some say the waveform varies from 0v-12v, some...

    Read more »

  • Musings on power options

    WJCarpenter09/05/2022 at 18:41 0 comments

    I've been thinking about how to power things. Most PC case fans will run at lots of different voltages, but they expect to run at 12v (DC of course). If a different voltage is supplied, they just run at a different speed. There are some fans available that expect 5v, but they are for some reason a lot more expensive (maybe just market forces). For predictability and management, it's best if the power supply is steady, but it probably does not need to be regulated for running the fans as long as it's not grossly variable.

    All along, I've been expecting to power things with a 12v DC wall wart or bump-in-the-cord power brick. I already have several spares from dead electronic components. (I've been following Tony Brobston's smart vent project. He ran low voltage power wires through his home's duct work from a central transformer. It's a tidy solution, but it may be a bit too involved and invasive for me.)

    The ESP32 has a couple of power options. 

    • I'm planning to use dev boards that have the usual USB 5v input, but I don't want to run a second power cord to the register.
    • You can feed 3.3v directly to a pin, but only if it's regulated. I'm trying to see if I can avoid the use of a regulator in the circuit, because....
    • The ESP32 dev board has an on-board 3.3v regulator, and you can feed unregulated 5v-12v into a pin. For efficiency of the regulator, closer to 5v is better than higher.

    I think I will be able to feed my 12v power supply into the overall circuit. That 12v supply will go directly to the fan power input (well, as I mentioned earlier, it will probably actually go to a MOSFET that can switch the fans completely off). Then a couple of voltage divider resistors will tap the 12v supply to provide something above 5v to the unregulated ESP32 input. For that last part, I'll have to check the stability of my supply voltage under load to be sure it doesn't drop too much and let the ESP32 input fall below 5v. That would also be undesirable for the fans, but that's less critical.

  • Temperature drops

    WJCarpenter08/23/2022 at 00:58 0 comments

    One common scheme for controlling a register booster fan is to detect a temperature difference in the ductwork. If the temperature drops while in "AC mode", the HVAC is blowing cold air. If the temperature goes up while in "heating mode", the HVAC is blowing warm air.

    I wanted to see how simple this idea would be to implement. I put a temperature sensor inside the ductwork in one of my upstairs rooms. I also have a smart thermostat from which I can find out exactly when the AC or heat is on. (It's a warm summer here, so it's AC.) Both of those devices are integrated into my Home Assistant server. Here are graphs of a few days or so of both.

    First, the temperature inside the ductwork:

    Next, the smart thermostat activity.

    The solid blue areas are the times when the AC is active. It lines up nicely with the temperature drop of 15-20 degrees (F) in the ductwork. The smart thermostat also has a control to let me run the fan some configured percentage of the time for circulation and filtering purposes, but that is not reflected in the graph.

  • Control freaking

    WJCarpenter08/20/2022 at 19:19 0 comments

    Without even knowing if this entire idea will do what I want, I've spent some mental energy thinking about the user experience of controlling it. (That's not the right way to go about things for project management, but that's not the way some brains work. :-) ) If I use an ESP32 to control the fans, that gives me a lot of flexibility in the control stuff.

    It goes (almost) without saying that the units will report their sensor and operational state data to my home automation setup. I use Home Assistant and will probably use MQTT to tie into that. It would be entirely possible to control the units from Home Assistant. I will probably do that, but I don't want that to be the only means of controlling them, for the following reasons:

    • Most of the rest of the household is not so interested in interacting with nerdy Home Assistant. I'm trying to cure that by making a ultra user-friendly wall panel system, but that's a longer-term project.
    • If we have house guests, I want them to be able to have some control over the guest room climate without needing to take a community college course to understand how to do it. I don't even want to force them to have an app or even a computer. I want to give them some kind of in-room control. (A wall panel tied to Home Assistant could do that, but see previous bullet.)
    • If I were to someday sell this house, a lot of my home automation infrastructure would go away, including my wifi and my Home Assistant server. Could I leave the register booster units in place with controls feasible for the new owners to use without requiring a lot of fiddling around?

    I've been thinking mostly about some kind of local control UI for the ESP32 in the register. Let's call that R-ESP32. My registers are on the floor, so I don't really want to have some piece of electronics sticking out above the register grating all the time. I thought about some kind of "display with knobs and buttons" gadget that could plug into some wire or socket that barely protrudes from the register grate. To the average non-techy person, even plugging a provided box into that sort of thing in someone else's house might seem overly invasive.

    Can I do something wireless with a separate box or wall panel? There is some chance I can run the fan and controller DC power wires through the ducts rather than using a wall wart. If that turns out to be possible, then there would be nothing sticking through the register and the vent opening, and that makes a wireless control gadget very desirable. There are plenty of off-the-shelf components that integrate an ESP32 and some kind of display. Even without that, integrating those two things is pretty painless. Add a few knobs or buttons, mount it in a convenient wall location in a nice enclosure, and you're sitting pretty. Let's call that gadget he UI-ESP32.

    With an ESP32 on both ends, there are obvious possibilities for having them talk to each other (even after subtracting out various wired options). I expect the R-ESP32 will already be talking to Home Assistant over wifi. Using the same or a similar pathway for linking the two ESP32s would be straightforward. The cost of that would be involving the wifi router, and maybe even the Home Assistant server, in the pathway. That's not a deal-breaker, but I'd rather avoid it if I can. Bluetooth Classic or BLE are possible and would give that local point-to-point interaction. (I'm not sure about complications of using both wifi and BT on the same ESP32. I know it can be done, but I'm not sure if there is any trickiness involved since they use the same radio.)

    I think I will use ESP-NOW. ESP-NOW is an Espressif-defined protocol for communicating with short packets over IEEE 802.11 physical links. That is, it uses the same radios and channels as wifi, but most of the information within the packets is "custom" for the ESP-NOW protocol. I think (but I'm not yet sure) that it will be simple to use both traditional wifi and ESP-NOW side by side without too much complexity or hassle....

    Read more »

  • ESP32 pin assignments

    WJCarpenter08/17/2022 at 01:50 0 comments

    I haven't figured out the complete picture of what I want for the controller, but it's almost a certainty that I'll use an ESP32. As I write this, the pin assignments are a bit arbitrary and only intended to convince me that I have enough of whatever pins I need. I'll be updating this table over time.

    I expect to use a PWM pin and a tachometer pin separately for each fan (F1, F2, F3). I'll use the I2C interface for a temperature sensor. I'm not sure yet what button, rotary encoders, LEDs, or display I'll use.

    This table is based on the more or less standard ESP-WROOM-32 development boards with 30 or 38 pin headers. I plan to use the 38 pin variant. The I/O recommendations in the Specialization column are based on the chart from here (I've seen similar charts on other web sites; this is the one I consult). "I" means OK for input; "(I)" means OK for input with some caveat. Similar notation for outputs.

    Pin (30)Pin (38)GPIOSpecializationMy usage
    -250adc11 - touch1 [(I)(O)]
    28351tx0 [(O)]
    19242adc12 - touch2 [I O]
    27343rx0 [(I)]
    20264adc10 - touch0 [I O]
    23295VSPI CS [I O]
    -206SPI flash CK-
    -217SPI flash D0-
    -228SPI flash D1-
    -169SPI flash D2 - rx1-
    -1710SPI flash D3 - tx1-
    -1811SPI flash CMD-
    121312HSPI MISO - adc15 - touch5 [(I) O]
    131513HSPI MOSI - adc14 - touch4 [I O]
    111214HSPI CLK - adc16 - touch6 [I O]
    182315HSPI CS - adc13 - touch3 [I O]F3-PWM
    212716rx2 [I O]F1-PWM
    222817tx2 [I O]F2-PWM
    243018VSPI CLK [I O]
    253119VSPI MISO [I O]
    --20--
    263321I2C SDA [I O]I2C SDA
    293622I2C SCL [I O]I2C SCL
    303723VSPI MOSI [I O]
    --24--
    8925adc18 - dac1 [I O]F1-tach
    91026adc19 - dac2 [I O]F2-tach
    101127adc17 - touch7 [I O]F3-tach
    --28--
    --29--
    --30--
    --31--
    6732adc4 - touch9 [I O]
    7833adc5 - touch8 [I O]
    4534Input only - adc6 [I]
    5635Input only - adc7 [I]
    2336Input only - adc0 [I]
    --37--
    --38--
    3439Input only - adc3 [I]
    161-3.3v
    12-enable/reset
    1414-gnd
    1519-Vin 5v
    1732-gnd
    -38-gnd

  • Window shopping for fans

    WJCarpenter08/14/2022 at 21:28 0 comments

    I spent a little time comparing PC cooling fans, based on the time-honored tradition of googling and looking at resulting lists of "best" fans, plus a couple of sites that specialize in quieter PCs and either sell or recommend fans. I only looked at PWM fans in the 92mm and 100mm sizes. Actually, I didn't find any 100mm fans with PWM. The only candidate that I found was SilenX, and they say that PWM fans are a bad idea for noise control. So, my list is all 92mm fans. 92mm fans are less common than 80mm and 120mm fans, so there is less variety to look at.

    CFM and static pressure have an inverse relationship, though it's not strictly linear. It's understood that the CFM figures quoted are maximums, as are the static pressure figures. Some manufacturers provide noise levels at minimum and maximum RPMs, but most provide only a single figure without stating an RPM value. Until I find out otherwise, I'm assuming they quote a figure that makes them look the best, which would be the minimum RPM. One interesting counter-example is the be quiet! fan, where they give a noise figure for the maximum RPMs. 

    Another interesting note is that most of the Noctua fans advertise that they turn the fan off if the PWM duty cycle is 0%. I was thinking of using a separate transistor to turn the power to the fans off. Exploiting that Noctua feature would simplify the circuit a little bit, but at the expense of flexibility in fan choices, so I probably will continue with my original plan.

    Here's my list. If I find more later, I'll edit the table to add them.

    ModelNoise dbRPMs CFMstatic pressure (mm H2O)
    Arctic F9 PWM PST???-14.8150-1800431.35
    Nexus PWM Silent15.8-27.8700-250043.53.15
    Noctua NF-A9 PWM22.8400-200046.42.28
    Noctua NF-A9x14 PWM19.9500-220029.71.64
    Noctua NF-B9 redux-1600 PWM17.6350-160037.81.61
    Noctua NF-A9 PWM chromax.black.swap22.8400-200046.42.28
    Noctua NF-A9x14 HS-PWM chromax.black.swap23.6600-250033.82.11
    Gelid Silent 9 PWM11-23.5900-200037.92
    be quiet! PURE WINGS 2 PWM???-19.6500-190033.21.65
    CoolerMaster Blade Master17-35800-280054.84.27
    CoolerMaster Sickleflow6-25650-2300401.8

  • Thinking inside the box

    WJCarpenter08/14/2022 at 17:07 0 comments

    In a previous project log, I described 4x12 inch vent boxes being supplied by a 6 inch diameter duct. How can that be? Well, the situation is a little more involved. The cut-outs in the floor are all the correct size to fit a 4x12 inch register. Some of the vent boxes, however, are larger than the cut-outs. 

    Could I then use that larger interior space to use larger fans (and run them at lower RPMs, and therefore lower noise, for the same air flow)? Not really. 

    Although some vent boxes are pass-through (ducts on two ends), the vent boxes in the rooms of interest for this project are all at the ends of runs. The supplying ducts are indeed 6 inches in diameter, but the vent boxes are tapered from a 6 inch opening for the duct to the 4 inch opening in the floor cut. By fiddling around and putting things at angles, I might be able to replace one of the 92mm or 100mm fans with a 140mm or 150mm fan. That seems like a lot of fooling around for a speculative pay-off. I'm not going to bother with it.

    (I'm not certain how the tapered shape would affect my previous consideration of static pressure due to size of the supply ducts. Obviously, 4 inches is less than 6 inches, but it's also some part of the 4x12 inch area. I don't have much hope of figuring that out as a calculation.)

  • Initial design thoughts

    WJCarpenter08/14/2022 at 01:57 0 comments

    The registers throughout my house are 4 inches by 12 inches. That's one of a few standard opening sizes for registers in the US. Mine are in cut-outs on the floors, which is a standard but not universal arrangement. As I mentioned earlier, I don't have convenient access to the ducts feeding the upstairs rooms, so I can only work with the registers and the box-like vent openings.

    The cheapest sources of fans these days are standard sizes of PC cooling fans. A 92mm fan is just over 3.6 inches and would fit nicely in the 4 inch opening. And, as it happens, 3 of them side by side would be less than 11 inches long, fitting nicely in that dimension and allowing room for any other odds and ends I need to fit there. (Another popular vent opening size is 4 inches by 10 inches. Someone with those vents would only be able to put two of those fans side by side.) I'm not sure how I would mount them. It's easy or cheap enough to make or buy brackets that can join standard 92mm fans to each other. I think I would then fabricate either some legs to stand them up or some hangers to hold them up. That will probably need some experimentation. I want to make sure that whatever I use doesn't end up creating some kind of vibration noise when the fans are going.

    Speaking of noise, most people already appreciate the general idea of trading off fan performance for fan noise. People putting together very low-noise PCs typically use larger fans running at lower RPMs. If I'm going to use off-the-shelf PC cooling fans that fit inside the vent boxes, 92mm is the starting point. There are 100mm fans available, and they would fit into 4 inches, so I might consider those. In either case, the size of the fan is going to be constant in the consideration of other fan parameters: air flow volume, static pressure rating, RPMs, and noise level.

    The parameter least appreciated by the average person is the static pressure rating of a fan. Even though the manufacturer can give a maximum static pressure rating for a fan, it's more important to understand the trade-off between static pressure and air flow volume. This engineering note by Johann Tang gives a very easy to understand explanation of the relationship: https://blog.orientalmotor.com/fan-basics-air-flow-static-pressure-impedance. When static pressure reduces air flow volume, you can make up for some of that by increasing the RPMs of the fan, but that means increased power consumption (which you probably don't care about) and increased noise (which you probably do care about).

    In the case of a register booster fan, there shouldn't be much obstruction above it to create a static pressure differential. The grill on the register shouldn't count for much. But there might be something to think about on the other side. For the individual rooms, the vents are fed by 6 inch round ducts. As far as I know, there are not any smaller duct segments in the paths. The 6 inch duct has a cross-sectional area of just over 28 square inches. A 92mm fan has a cross-sectional area of just over 10 square inches (a 100mm fan has a cross-sectional area just over 12 square inches). With 3 fans, that's a fan opening area of 30 to 36 square inches. The duct will not be able to deliver air at the same rate the fans can expel it, so that will create, effectively, a kind of "suction" on the back side of the fan, or a difference in static pressure. (At least, that's my theory. I hadn't really thought about much of this before a few days ago. I could be completely wrong.)  I don't know how to calculate or measure that static pressure difference, and my plan is to just make up for it experimentally by boosting the fan RPMs.

    Speaking of RPMs, you might already know that PC cooling fans come in 2 varieties these days. Long ago, PC fans just operated on 2 wires, power and ground. In today's 3-wire fans, there is tachometer-style feedback on that 3rd wire, so the motherboard can vary the supply voltage or other tricks until it gets...

    Read more »

  • What do they know?

    WJCarpenter08/14/2022 at 00:34 0 comments

    Do you believe everything you read on the internet? I know that I do. But on this subject, there seem to be two prevalent opinions:

    • HVAC pros, mechanical engineers, and self-appointed know-it-alls who insist that the whole approach of using booster fans at forced air furnace vents is doomed to failure. It just can't possibly work because of several reasons. The reasons might be entirely correct, or they might be so much hot air (you should pardon the expression). There are similar opinions about inline duct booster fans.
    • People who have actually used register boosters and reported that it made a big difference in their homes. I mean, are we supposed to believe them just because they tried it and were satisfied? Humbug!

    To be quite honest, I don't know if either of those schools of thought are correct when it comes to my own home. The people who are naysayers might actually know what they are talking about. The people who reported success might just be lucky and got good results for other reasons or despite the theoretical impediments. 

    One thing that seems to be almost universally agreed, at least by anyone whose comments make it seem like they know anything about anything, is that it's a loser's game to permanently close off some registers in an attempt to force more air to others. (I'm not expert enough in HVAC to say whether this is correct thinking. I can only say that it's widely believed.) Why, then, do vent registers have adjustable louvres?  Apparently, it's so you can temporarily prevent or allow airflow into that particular room, even if it doesn't dramatically affect flow into others. For example, you might want to only heat some rooms when you expect to be using them, to save heating costs.

    It's inconvenient to retrofit inline duct booster fans in my house. The rooms that need help have the ducts among floor joints or walls. The disruption to just try something is too great for me. On the other hand, trying booster fans at register* locations is just a matter of a tolerable amount of money and time.

    (*Why are these vent covers called registers? Beats me. The term was unfamiliar to my adult children, but it's what I've always called them. Web searching didn't turn out a plausible origin within the limits of my attention span.)

    There are a few commercially available "register boosters" on the market, and my first thought was to try one of those in one of the rooms to see if it worked. These typically have 1 or 2 fans alleged to be "very quiet" and a power cord or wall wart that plugs into a standard household mains outlet. That's not the best aesthetics, but it would be OK in the particular rooms where I need some help.

    • Some are simple on-or-off devices. These devices by Tjernlund are representative examples: https://www.tjernlund.com/ductboost.htm. They have an on/off switch, but you could use a timer or other control at the power outlet so that they didn't need manual attention.
    • Some sit above the existing register, and some replace the register with the bulk of it sitting inside the vent. These devices from Suncourt are representative examples of both: https://suncourt.com/collections/register-booster-fans
    • The register boosters that are not always-on typically have some kind of temperature sensor (and a mode switch) that will be able to detect the warm or cool air coming from the furnace and use that as a signal to turn the boosting fan on or off. They give some control over the threshold points and the resulting fan speed. These models from AC Infinity are examples: https://acinfinity.com/register-booster-fans/.
    • There is this model from SmartCocoon: https://mysmartcocoon.com/. It fits inside the vent and allows you to keep your existing register. All of the controls are via a phone app. You can't do anything without your phone except unplug the danged thing. This is the completely wrong balance point in the user experience for me. I want the occupants of those rooms to be able to make adjustments without...
    Read more »