Ventbot, a DIY Home HVAC Vent Booster: Warm Side Cool, Cool Side Warm
by wjcarpenter in Circuits > Gadgets
19811 Views, 161 Favorites, 0 Comments
Ventbot, a DIY Home HVAC Vent Booster: Warm Side Cool, Cool Side Warm
Do you have rooms in your house that are colder than other rooms in the winter? If you have air conditioning, are those same rooms warmer than other rooms in the summer? It's common for that to happen to rooms farthest from the blower on the furnace or air conditioner. You can buy booster fans that sit on top of or under registers to blow more air into those rooms.
With this project, you can make your own booster fans with behavior that is completely under your control.
The idea is to use commonly available and inexpensive PC case fans to do the work. A small circuit board and microprocessor provide the smarts. When the furnace or air conditioner is blowing warm or cool air into the room, the Ventbot automatically turns the fans on to provide a boost. When the furnace or air conditioner stops blowing, the Ventbot turns the fans off. Once you have it built and installed, you can just set it and forget it.
There are a lot of interesting things to consider in the design, but I've done a bunch of that thinking and deciding for you. All of the design files and software source code are freely available under open source licensing, so you can do things differently if you want to. I would be interested in hearing any suggestions or ideas for improvements (you can leave comments about that here or in one of the project reference sites mentioned below).
The description of this project is a bit lengthy. If you are already a maker of sorts, some of the description will be an over-explanation of obvious things. I wanted to provide enough details so that someone who isn't a maker, or who hasn't done these particular things, will have the information to actually be able to do it. At a glance, it seems complicated, but each step is straightforward.
The minimum skills you will need are:
- Simple electronic soldering (very basic; even if you are a beginner, you shouldn't have much trouble)
- 3D printing for the enclosure and brackets (if you don't own a 3D printer and don't have access to one, there are services where you can upload files and have things made and shipped to you)
- Simple computer skills for uploading firmware to the board.
The master repository for all of the hardware and software design files is here: https://gitlab.com/wjcarpenter/ventbot If you want to know more about my journey in designing this thing, you can read all about it here: https://hackaday.io/project/186808. (You don't have to read that in order to build one, though. It's even longer and has more tangents than this Instructable.)
The list of supplies and the set of steps below look long and a bit daunting. That's because there are some options and other things to think about when you gather your parts. I put a lot of information into the supplies section and the assembly steps, so don't skip over it. I suggest you read through the whole thing before shopping for any parts. Definitely read through all of the "Plan" and "Decide" steps below before obtaining any parts. Otherwise, you might waste a little money getting things you don't need. Nobody wants that.
Here's the overview of how this fits together:
- There's a printed circuit board (PCB) with various components to be placed on it.
- One of those components is an ESP32 microprocessor module. You'll be putting custom firmware onto that module.
- There are connectors on one end of the circuit board for connecting the cables from the fans.
- There is a temperature sensor that is connected to the circuit board with some wires.
- An enclosure for the project can made on a 3D printer.
- Brackets for holding the fans together and for installing them inside the vent cavity can be made on a 3D printer.
- You might want to do some simple calibration and update the custom firmware once you have everything assembled.
- Your friends and family will think you are a genius (this step is optional).
Note: A few of the pictures of the PCB and a few of the diagrams show v2023-01-13. I made some small modifications to produce PCB v2023-02-14. Since those changes were not pertinent to the things being shown in the older images, I didn't update them. The v2023-02-14 version is the definitive version and is what all the steps actually describe.
Supplies
Let's start with the tools, since that's simpler.
- Access to a 3D printer (or a 3D printing service) for making the enclosure and mounting brackets
- Simple soldering tools: soldering iron, solder, etc.
- Simple and common hand tools. A pair of diagonal cutters for trimming component leads is essential.
- A computer with a USB port for uploading the firmware. Later firmware updates can be done over wifi, and you might not need to do any.
Now for the parts, which is a kind of lengthy list.
The circuit design can work with up to 4 fans, but both the circuit board and software can work with fewer fans. Both the circuit board and the 3D printed case have markings to indicate which fan is which. Obviously, you need at least 1 fan, or it's pointless. If you do use just one fan, it should be Fan 1 to minimize confusion. Other fans can be any combination of Fan 2, Fan 3, or Fan 4. The software will automatically detect which fans are present. Many of the parts are "per fan", so if you don't use a particular fan position, you can leave some parts unpopulated on the board. There are also circuit options to have some things for other fans controlled by Fan 1, in which case you can leave even more parts off the board. These optional parts are indicated in the descriptions below.
Depending on the choices you make about optional parts, how good a shopper/scrounger you are, and what you might already have laying around, I think the total cost ought to be US$60 or so. You can buy a ready-made booster fan for around that price, but you'd be missing the adventure of making it yourself. You will also have more control with one you build yourself. (Confession: I was originally going to buy a booster fan, but I couldn't find them available during the time in the pandemic when I was thinking about this. That's why I went off on this design tangent. The commercial units are more readily available now, but so is this design.) The per-item prices for some things would go down quite a bit if you bought a bunch of them, so it gets a bit cheaper if you are building multiple Ventbots. I needed five Ventbots for my house.
The parts listing in a bill of materials (BOM) produced by the KiCad design software, and then annotated by me, can be found here (same content; different formats): BOM.csv and BOM.xlsx, or on Google docs at ventbot BOM.
These estimates are more like guesses, informed by what I have paid for parts like this recently:
- ESP32 module: US$10 each
- Circuit board manufacture: US$15 for 5-10 boards total
- BMP280: US$3 each
- Fans: US$7 each
- Capacitors, resistors, transistors, connectors: under US$10 for everything
- Voltage converter: US$3
- Material for 3D printed parts: negligible
- 12vdc power adapter: US$7 each
Most of these parts are just mentioned briefly here so you can get a quick idea of what you will need. Be sure to read through the "Plan" and "Decide" steps for additional comments about some of them (for example, what substitutions you might make, what they actually do, etc) and for parts you can omit if you are not using all 4 fans. For handy reference, the "Decide" steps are intermingled with the assembly steps. At least, I hope that's handy and not confusing. For each "Decide" step, there is a suggestion for what to do if you'd rather not think about it too much. (I've already thought about it way too much.)
- Circuit board: It's theoretically possible to wire the entire thing up on a breadboard or protoboard. That's how I tested the design. However, that's an untidy mess of wires, and it's better to have a manufactured circuit board. (Most of the PCB manufacturers have the same prototyping prices for up to some number, typically 5 or 10, of the same board. Even if you don't plan to use them all, you might as well get them. You might make some mistakes, you might have friends who would be interested, or you might someday use them for some other ESP32 project.)
- Enclosure: The repository at https://gitlab.com/wjcarpenter/ventbot includes design files for a 3D printed enclosure. See the step about the enclosure below.
- Fan mounting brackets: The repository at https://gitlab.com/wjcarpenter/ventbot includes design files for 3D printed brackets for mounting the fans. See the step about the brackets below.
- PC case mounting screws: You might want more screws for mounting the fans than usually come with a new fan. Or you might be using some fans that you have laying around, and the screws might have wandered away.
- Fans: The design allows for up to 4 PC PWM case fans to provide the boost. How many you use will be limited by the dimensions of your vent openings. See the "Measure Your Vents" step below.
- Resistors:
- 4.7k ohm: (4 per fan)
- 27k ohm: (1 per fan)
- 10k ohm: (1 per fan)
- Electrolytic capacitors: 10uF: (1 per fan)
- Transistors
- NPN bipolar transistor: (1 per fan)
- N-channel MOSFET: (1 per fan)
- Voltage regulator: Switching voltage converter; or 7805 linear regulator with optional heatsink
- Jumpers and pin headers: (optional)
- 3-pin 0.1in pitch pin header: optional, up to 6
- 2-pin jumper blocks: one for each 3-pin header
- External connectors
- Fan connectors: (1 per fan)
- I2C connectors: (at least 1 of the 3 choices)
- Power jack
- ESP32 module: There are a lot of ESP32 modules available with different sizes and configurations of pins. Makes sure you get the right one. The design uses ESP32-DevKitC V4 with a ESP32-WROOM-32D module. There are other variations that will work. The most important thing is to get the 38-pin version, and that the pin signals are the same as the ones the design uses, at least for the signals that are actually used. Even though it's pretty old, you can still find ESP32-DevKitC V1, which has slightly different physical dimensions; it will still work and will fit as long as you pay attention to surrounding components.
- ESP32 extra pins: (optional)
- 1x19 0.1 inch pitch pin header, optional: J1, J2
- Temperature sensor: The part I use is Bosch's BMP280 on a break-out board. They are commonly available and inexpensive. Without any changes, the firmware can alternatively use a BME280 sensor to also get relative humidity, though a BME280 is more expensive these days. For both BMP280 and BME280, the ones I have seen have all had an I2C interface, and some of them also have an SPI interface. This design uses the I2C interface. (You don't need to understand much about that to build this.) The firmware also reads the pressure from the BMP280 or BME280, and the relative humidity from the BME280, but it doesn't use them for anything beyond reporting them. In fact, the firmware will automatically try to find several different temperature sensors that ESPHome supports, but I have only tested BMP280 and BME280. You can even use yet a different temperature sensor if you are willing to modify the ESPHome configuration file for the firmware. That will be pretty simple if the sensor uses I2C and is already supported by ESPHome. I2C parts sometimes come in either 3.3v or 5v versions. You want 3.3v parts to be compatible with the ESP32 module.
- BMP280 sensor
- cabling: Wiring to connect the temperature sensor to one of the available I2C connectors on the board.
- Power supply: This is a commonly available 12vdc power supply with a 2.1x5mm barrel connector. 1 amp at 12vdc should be more than sufficient. Since this will be plugged in all the time, I recommend that you use only a quality part that is UL or ETL rated. You probably want to see if you can get one with a cord long enough to reach from the mains outlet to the location of the vent, plus a little bit (to avoid the need for an extension cable), but it's hard to find them with cords more than 3-5 feet (1-2 meters) long.
Plan: Measure Your Vents and Decide About Fans
Your vents might be the same as mine, or they might be different. The way to know is to measure. In most homes, all the vents will be the same size, but it's always possible that there is a mix of different sizes. Once again, the only way to know is to measure. Take measurements of both the vent opening and the vent register that will cover it. If you are in the US, the standard sizes are stated in inches. The world of 3D design and printing operates in millimeters. When you are measuring, it's slightly better to make a note of both systems than to do mathematical conversions later.
Since we will be using PC case fans, their dimensions will force some decisions. Commonly available case fan sizes are 80mm (3.15 inches), 92mm (3.6 inches), 120mm (4.75 inches), and a few larger sizes. The fans you use must fit horizontally within the vent cavity; that is, with the fan blades facing out of the opening.
In many cases, the vent opening will be a certain size, but the actual duct work for the vent will be slightly larger. It's really the ductwork that matters here. You're going to need to fit the fan horizontally, and then you can use as many fans as will fit side by side in the space. For example, in my house the vents are nominally 4 inches by 12 inches. I'm using 92mm fans in a set of 3. However, a caution: Have a look at all of the different vents where you plan to put a Ventbot. With the cover in place, they look all tidy and uniform. When you take the cover off, you might find all sort of bent metal and force-fit adaptations. Your Ventbots must fit really real reality, not your mental notion of how nice things are. Don't ask me how I know about this; let's just say it happened to "a friend".
You will want to use the largest fans that will fit into the vent openings you have. That will give you the largest possible boosting, but it will also let you run the fans at lower RPMs if you want to. Lower RPMs means lower noise from the fans. That can be especially important in bedrooms.
You want PWM fans, sometimes listed as "4-wire fans". That lets you control the speed of the fan. You could also use non-PWM fans, sometimes listed as "3-wire fans", but they will only be able to be either completely off or completely on, and that might be loud enough to be annoying. There's not much price difference between 3-wire and 4-wire fans since they are both commodity items. Within the category of PWM fans, there are some that specialize in being quiet. There is no such thing as a silent fan that is actually silent, regardless of what their marketing material says, but there are some that have sound that is pretty low. It's a trade-off between noise, how much air they can move, and how much you have to pay for them.
If you'd like to see the notes I made when I was looking around at fans, you can read these project logs (reading them is completely optional):
- https://hackaday.io/project/186808-ventbot-warm-side-cool-cool-side-warm/log/209794-window-shopping-for-fans
- https://hackaday.io/project/186808-ventbot-warm-side-cool-cool-side-warm/log/210609-arctic-et-al-noise-and-speed-test
- https://hackaday.io/project/186808/log/213701-some-observed-breadboard-results
Plan: Decide What, and How Many, and Order Parts
You are probably going to need to order some parts, so now is the time to decide how many Ventbots you are going to make, how many and what size fans you will use for each one, and any of the options described in the supplies list and the "Decide" steps below. You will save some money if you tally it all up now. Don't be like me: "That was fun. I think I'll make another after I buy more parts."
Some of the parts you order will likely come from far away (unless you happen to live far away, in which case maybe they will come from nearby.) It's not really necessary to buy all the parts from the same supplier; in fact, that might be impossible. But you are likely to save some money on shipping charges if you can get multiple items from the same few places. Most of the parts, other than the circuit board and the 3D printed items, are very common and readily available from many sources, either by mail order or if you are lucky enough to have a local electronics shop. For the inexpensive parts, it's often just as inexpensive to buy a ridiculous quantity of them as to buy just a few. Better to have extras than to not have enough. For example, when I was buying generic electrolytic capacitors, it was about the same price to buy 10 from one place as it was to buy 100 from another place.
The circuit board is a slightly special case because it has to be manufactured for you. The repository at https://gitlab.com/wjcarpenter/ventbot includes the full set of KiCad design files. WIth those, and the open source KiCad application, you can explore the design or even modify it. The repository also includes the Gerber files that are the standard files most PCB manufacturers would need to produce the boards. Theoretically, you could use those files to manufacture your own circuit boards. It's a 2-layer board that is not especially complicated. Most people will want to have them built by a company that specializes in that. There are numerous companies that can do this for you. If you do a web search for "pcb prototype", you'll find many. I've used a few different companies for various projects, and all of the results were excellent. For this project, I used PCBway (who even supported me by providing two iterations for free). These companies typically manufacture your boards in 1-3 business days and then ship them to you. Various shipping options are usually available, from "slow boat" to "ridiculously expensive". The cost for the boards is usually pretty cheap at around US$5-15, and usually the price for 5 or 10 boards is the same as the price for a single board. If you don't want to think about it and just want to get exactly what I got, my design is "on file" and can be ordered here: https://www.pcbway.com/project/shareproject/Ventbot_a_DIY_HVAC_Vent_Booster_Warm_Side_Cool_Cool_Side_Warm_76e090b7.html
While you are waiting for your parts to arrive, if you are a novice at this sort of thing, you might use the time to brush up on your soldering skills. Most of the parts in this design are pretty easy, but you probably want to practice a little beforehand so you can do a tidy job. You can also work on the 3D printed components while you are waiting. You should be able to get all the dimensions you need from the design or from measurements you make in your home.
Prepare and Upload Firmware
The ESP32 must be programmed with firmware. The first time you do this, you will have to connect your computer to the module's USB port with a USB cable. Your ESP32 module will almost certainly have a micro-USB socket. After the first time, you'll be able to do firmware updates over wifi (so-called over-the-air, OTA, updates). It might be tricky to get a cable plugged into the USB port once the module and other parts are soldered to the circuit board, so it's best to do that first firmware upload now, as soon as you have your ESP32 modules on-hand. Don't worry about whether you'll want to modify the firmware later. In the finished Ventbot, the USB connector is not used to power the ESP32. You might or might not have enough room to plug a USB cable into it for firmware loading. (Caution: If you do plug a USB cable into the ESP32 module after it's soldered to the circuit board, make sure the 12vdc power supply is not connected at the same time. One or the other, not both!)
The framework used for the firmware is called ESPHome. They have really good documentation for how to get started at https://esphome.io. I won't repeat all of that here. One thing that often confuses beginners is that it might seem like you have to run a Home Assistant "smart home" automation system to use ESPHome, and that seems like a big deal. That's not the case. They are related pieces of software with many synergies, but you can use ESPHome without Home Assistant. Except for possible firmware updates, the Ventbot can operate completely on its own with no external communications at all. (In a later step, I'll describe using the two together, but it's completely optional.)
The steps for uploading the firmware are these:
- Install ESPHome on your computer (Mac, Windows, or Linux) and get it running using the site's instructions.
- Decide on an ESPHome configuration directory.
- Download Ventbot's ESPHome configuration files into that directory: https://gitlab.com/wjcarpenter/ventbot/-/blob/main/ventbot.yaml.inc and at least one of the "color" coinfiguration files, like https://gitlab.com/wjcarpenter/ventbot/-/blob/main/ventbot-red.yaml. It doesn't matter which one, and you could also just download them all.
- When editing any of these YAML configuration files, pay attention to the indentation and always use spaces and never use tabs. YAML is very fussy about that. (Not my fault.)
- If you are going to have multiple Ventbots, you will want to give each a unique name. The names you pick can be whatever you like as long as they are unique (because they register themselves with your wifi network with those names). I used the names of ROY G BIV colors and put them into 3D printed cases of those same colors to make it easy for me to keep track of what was what. If you decided to call your Ventbot "chuzzlewit", rename "ventbot-red.yaml" to "ventbot-chuzzlewit.yaml".
- Open that renamed file in a text editor. Look for "## CONFIG ##", which is a marker for things you might wish to change. There are comments throughout. If in doubt about something, don't change it now. You can revisit it later. One thing that you will certainly want to customize, especially if you are making multiple Ventbots, is the name of the device, which is listed near the top of the configuration file. From the example in the previous point, change the name to "ventbot-chuzzlewit" (without the ".yaml" suffix).
- Create a file "secrets.yaml" in that same directory. Anything in "ventbot.yaml" marked "!secret" actually comes from that file. An entry like "!secrets foo" means that it will look in secrets.yaml for an item named "foo" and use the associated value. Using "secrets.yaml" is a good practice, but it's not a requirement. If you find it too confusing, you can just change "!secrets" entries to have the values you would otherwise put into the secrets file.
- Build and flash the firmware using ESPHome, connecting over USB to the ESP32 module.
- Configure wifi credentials via the captive portal (described below).
- Flash again, but this time select "Wirelessly" to verify that you can do OTA updates.
After you flash the firmware, if you watch the ESPHome console log output, you'll see some errors about I2C devices. That's because your temperature sensor is not hooked up yet. Don't worry about that for now. If you get far enough to be able to do OTA updates, it's a success for this step.
Configuring wifi
Naturally, the generic Ventbot firmware configuration file does not know the network name and password for your wifi network. One way to overcome that is to add the wifi credentials into that configuration file (you would most likely do that using the secrets.yaml file). If you wanted to, you could also configure a static IP address at the same time. If you are already familiar with such things, you don't need me to describe it to you, except to say that you will probably also have to modify "ventbot.yaml.inc".
There is another way built into the ESPHome firmware framework: the Captive Portal. When the ESP32 starts up (with this ESPHome firmware), it will realize it does not know how to connect to your wifi network. It will then start up a wifi access point for a private wifi network not connected to anything else. The name of that network will be the name you chose for your Ventbot followed by "Config AP"; for example, "ventbot-chuzzlewit Config AP". Connect to that network with your phone or PC, and open a web browser to the page at http://192.168.4.1. If you do it on your phone, it may ask you to sign into the network and then automatically take you to that page. You'll see a form that will let you enter the information for your real wifi network. The image accompanything this section is an example. The firmware will store that information in flash and will automatically connect to that network whenever the ESP32 boots again, so using the Captive Portal is a one-time step.
After you have done these steps, you should be able to do OTA updates from a PC on the same network as the Ventbot. The Ventbot will automatically register itself with most routers with its name and the suffix ".local". For example, "ventbot-chuzzlewit.local". You can try pinging the device by name.
To recap:
- You'll do the first upload over a USB cable.
- You'll use your phone or a PC to connect to the ESP32's captive portal and configure credentials for your wifi network.
- The ESP32 will reboot and connect to your wifi network automatically.
- From that point, you can do OTA updates.
PCB: Assemble the Circuit Boards
Once you have the circuit boards from the factory and have most of the parts on hand, you can begin assembling the boards. The images accompanying this step show a board that I have mostly assembled, and a 3D rendering of the board from within KiCad. There is also a generated 2D graphic showing the entire board with component locations.
There are a few general rules I follow when assembling any board (these rules actually compete with each other for priority):
- Assemble the trickiest parts first, in case you have to give up and start over with a blank board.
- Assemble the shortest/lowest parts first. This tends to help things stay in place as you flip the board over and back. You also don't have to work your way around taller parts to manipulate shorter parts.
- Save the expensive parts for last. This is in case you make some grand mistake and decide to start over with a fresh empty board. In this design, the ESP32 module is expensive compared to the others, though only relatively. More importantly, its 38 pins make it difficult to remove once it's soldered in place.
Another rule that I sometimes follow (and sometimes don't) is to assemble the really cheap parts just in case, even if I don't plan to use them. For example, resistors are pretty cheap, so I would typically solder them all in place even though I plan to use only 3 of the 4 fan positions.
Here is the order that I would assemble things for this board (this is also the order for the individual "PCB" steps that come after this step):
- If you are going to use the JST-SH connector, solder it first.
- The small NPN transistors (Q21-Q24).
- All resistors, in any order.
- All of the other connectors around the board edges, in any order, and the pin headers for the option jumpers (if you elect to use them).
- The electrolytic capacitors (C11-C14).
- The large MOSFET transistors (Q11-Q14) and the voltage regulator.
- The ESP32 module.
- Pin header strips J1, J2.
I usually place a few parts, then solder and clip the excess leads. If the part is a bit wobbly, I might hold it in place with a small piece of tape until I get it soldered. For parts with several legs, it can be helpful to solder a single leg in place, then push it gently as you reheat the solder to get it exactly where you want it. That soldered leg will hold it steady while you solder the other legs. (Be careful when pushing the part and reheating the solder. Some parts are really good at transferring heat into your fingertips.)
The large MOSFET transistors are oriented so that you can lean them over "on their backs" at an angle to reduce the overall height. These transistors have a tab with a hole in it for attaching a heat sink, but it's not needed for the amount of power that they are switching in this design.
Because of the large number of pins, the ESP32 module can be tricky to place. The redundant pins that are companions of the ESP32 (J1 and J2) are completely optional. I might populate them anyhow since the pin header strips are extremely cheap, and it's more convenient to solder them now than later if I decide I want them.
Each of the "PCB" steps below includes a graphic showing the board and highlighting the particular components for the step. The graphics were generated by the Interactive HTML BOM plugin to KiCad. As the name implies, you can also use it interactively to help you keep track of things as you populate the circuit board. To do that, open this page in your web browser: https://wjcarpenter.gitlab.io/ventbot/ibom.html. You can also download that page and open it locally in a browser. As you mouse over a line in the parts list, the corresponding board locations are highlighted in red.
Decide: How to Connect the Temperature Sensor
In a hurry or can't decide? Use 1x4 or 2x4 right angle pin headers.
The design uses a BMP280 temperature and humidity sensor (or some other I2C temperature sensor). It's external and connected with wires to the PCB through an opening in the enclosure. It's interfaced to the ESP32 module with a protocol called I2C. The circuit board provides pads for multiple connectors, and you only need to place the one you are going to use. It is not harmful to also place the connectors that you are not planning to use.
- JST-SH (same as Adafruit STEMMA QT and Sparkfun Qwiic). Although these connectors are available in both horizontal and vertical insertion orientation, only the horizontal insertion variant can be used with this board. It is a surface mounted component with a very fine 1.0 mm pitch. If you are not experienced with this sort of thing, I recommend you do not attempt it.
- JST-PH (same as original Adafruit STEMMA and fairly similar to Seeed Studio Grove). These are available in either horizontal or vertical insertion orientation, and either can be used with this circuit board.
- Seeed Studio Grove connectors. Unless you are already invested in the Grove ecosystem, I don't recommend it for this project. It's a fine connection system, but some aspects of it can be a little confusing in this specific design. The circuit board connectors are available in either vertical insertion or horizontal insertion ("90D") orientations, but you will not be able to use the horizontal insertion connectors (because the wiring is flipped to the reverse order of what you want).
- 4-pin header. These are very cheap and available in single or double rows of straight-through (vertical insertion) or right-angle (horizontal insertion) variants. The circuit board has a 2x4 footprint. Each pin in the set of 4 is connected to its twin. You can use whichever best suits your choice of connector and any modifications you make to the 3D printed case. If you use a double-row set of pin headers, you don't have to do anything about the removing unused row of pins.
The choice of which connector to use may be influenced by the temperature sensor that you will use. The cheapest are on "no name" boards that have pads for pin headers. There are also versions from Adafruit, Seeed Studio, and other manufacturers with either JST-SH, JST-PH, STEMMA, STEMMA QT, or Grove connectors. The electrical signals are the same for I2C for all of those variations, though you have to pay attention to the order of the signals. The same sources sell a variety of cables and adapters for using pretty much all of the combinations between the circuit board and the sensor. The cheapest and most widely available are the so-called Dupont jumper cables. Whatever wiring you use, you will probably want to be able to place the sensor about a foot away from the Ventbot box. The actual distance is not critical. The idea is to have the sensor away from the mild warmth of the circuit board, and I put mine inside the ductwork so it's immediately influenced by any warm or cool air from the HVAC.
Regardless of which combination of board connectors and wiring to use, pay attention to the signals actually carried on each wire. They are identified on the white silk screen layer of the PCB and should also be identified that way on the sensor board. It's easy to be misled by the color of the wiring you use since different suppliers have different conventions for how they order the signals. Remember, color is not an electrical property! Match up what's on both ends of each wire.
If you use any of the vertical insertion options, you will have to modify the 3D printed case to accommodate those connectors. I did some experiments with modifying the case for vertical insertion, and I wasn't crazy about the results. YMMV.
PCB: the Very First Part on the Board
There is a larger step later for placing jumpers and connectors, but I suggest you consider this part first, before all others if you plan to use a JST-SH connector for the temperature sensor.
For most people, this will be the most difficult thing to place on the circuit board. It's a surface mounted (SMT) part with very small leads (1 mm pitch). This isn't one of the teeny-tiny SMT parts that are available these days, but they can still be a challenge. If you are inexperienced at soldering, you might want to skip this part completely and choose one of the other I2C connectors for the temperature sensor. If you want to attempt it, I suggest you do some web searches for tutorials on soldering SMT parts. Here's a short video description, for example. They will provide a lot more detail than I could give here. You will want to use the finest soldering tip you can find, and using very thin solder would also be helpful.
Why do I suggest you try to place this part first, before any other parts? Because there is a reasonable chance you will have problems with it and will want to start over with another copy of the PCB. If you do that, your effort in placing other parts will not have been wasted. (I know, I should have a positive attitude and be encouraging and all that, but if you are already skilled at SMT part placement, you don't need me to give you a pep talk.)
Decide: Whether to Share Power and PWM Controls
In a hurry or can't decide? Skip this.
If you do nothing about it, each fan will have its own power and PWM (speed) controls. The circuit board has an option for sharing the power control or the PWM control from fan 1 to any combination of fans 2, 3, and 4. If you decided to do that, you could omit the MOSFET, capacitor, and a couple of resistors for the fans that are sharing power, and a couple of resistors for fans that are sharing PWM.
The circuit board has pads for 6 3-pin jumper blocks. Each controls one of the two options for one fan. The blocks in the JP1x series are for power sharing, and the blocks in the JP2x series are for PWM sharing. For each block, pin 2 (the center pin) is already connected to pin 1 (the pin farther from the edge of the circuit board), which means that the control is not shared.
To change the default behavior, use a blade of some kind to cut through that trace between pin 1 and pin 2. It may be hard to see the trace through the surface treatment of the circuit board, but it is a thin line on the top side of the board directly connecting the two pins in a straight line. After you have cut that trace, you can either solder a piece of wire between pin 2 and either pin 1 or pin 3, or you can solder in a 3-pin header and use a jumper to connect the desired pins. The picture in this section shows a board with all 6 blocks populated with 3-pin headers and jumpers in place.
PCB: Small Transistors
PWM signal conditioning
The small NPN bipolar transistors are used for controlling the PWM signal sent to a fan. I used 2N3904 transistors because they are inexpensive, commonly available, and because I had a bunch on-hand already. Just about any NPN bipolar resistor should work, as long as it's compatible with ESP32 digital output voltages (3.3 volts) and comes in a TO-92 inline form factor. It's only used for switching a digital signal, so it doesn't need to handle much current. Be sure you don't accidentally try to use PNP transistors; they are not compatible.
If you use the jumper option to share the PWM signal from Fan 1, then you can omit these transistors for fans that don't have their own PWM signal. And, obviously, you can omit these transistors for any fans that you will not be using. These bipolar transistors are pretty cheap, so, if in doubt, place them all.
You will notice that the transistors have a flat side; seen from above, it looks a bit like the letter "D". That matches the flat side on the image silk-screened on the circuit board. The transistors should slide easily into the 3 holes in the boards, though there might be a small amount of resistance at the very end, which will hold the transistor in place while you solder the leads. If they feel a little loose before soldering, use your finger or a piece of tape to hold them flat against the board until you get at least one lead soldered. It won't affect their operation if they are crooked, but it will look a little sloppy.
Compared to most of the other parts, the leads and pads for the transistor TO-92 package are close together. If you have a fine tip for your soldering iron, it's a good idea to use it for these. Be careful not to accidentally bridge two pads together with a blob of solder. If you do, use some solder wick to remove the excess and make sure there is no direct connection between any two legs. It's a good idea to check this with a multimeter or continuity tester if you're not sure. It's the kind of short-circuit that even experienced makers can create occasionally. I bridged 2 or 3 of them while assembling my own menagerie of Ventbots.
- 2N3904
- Q21 (Fan 1)
- Q22 (Fan 2)
- Q23 (Fan 3)
- Q24 (Fan 4)
PCB: Resistors
The resistors all lie flat against the circuit board ("axial" orientation) and so have the shortest vertical profile. Therefore, it's a reasonable idea to solder them before most other parts. All resistors are for signal conditioning or current limiting, so ordinary 1/4 watt resistors should be fine. For the resistors that are 4.7k ohms, the precise value is not critical, so you could use something else if you had them on hand.
Resistors do not have an electrical orientation, so it doesn't matter which way you place them. The colored bands on the resistor body indicate the resistor value and tolerance. You might like to place them all in the same orientation so that it's easier to read the colors later if you have the need. It will also satisfy your human need for tidiness!
When placing resistors, my personal preference is to work with a single value at a time. I find I'm less likely to make a mistake in putting a resistor of the wrong value in a position. The long row of resistors are all 4.7k ohms, which should make it easy to avoid a mistake with them.
For each resistor, bend the leads at a right angle a millimeter or two from each end. Push it through the holes on the circuit board and gently tug from the back side until the resistor lays flat. Bend the leads out slightly to hold the resistor in place. I usually do a few resistors at a time. Place them on the board, bend the leads to hold them in place, solder them, and then use a tool to clip the excess leads off.
PWM signal conditioning
One of these resistors limits the current draw from an ESP32 digital pin to the base of the small transistor that switches the PWM control signal of a fan. The other resistor in each pair is a pull-up resistor for that same signal. The PWM ("pulse-width modulation") signal controls the speed of the fan.
If you use the jumper option to share the PWM signal from Fan 1, then you can omit these resistors for fans that don't have their own PWM signal. And, obviously, you can omit these resistors for any fans that you will not be using. Resistors are pretty cheap, so, if in doubt, place them all.
- 4.7k ohm:
- R21, R31 (Fan 1)
- R22, R32 (Fan 2)
- R23, R33 (Fan 3)
- R24, R34 (Fan 4)
MOSFET gate control
The MOSFET transistor (explained in a later step) controls power flowing to a fan. This resistor limits the current draw from an ESP32 digital pin to the gate of the MOSFET.
If you use the jumper option to share the power from Fan 1, then you can omit these resistors for fans that don't have their own power. And, obviously, you can omit these resistors for any fans that you will not be using. Resistors are pretty cheap, so, if in doubt, place them all.
- 4.7k ohm ohm:
- R41 (Fan 1)
- R42 (Fan 2)
- R43 (Fan 3)
- R44 (Fan 4)
Tachometer signal conditioning
One of the pins (pin 3) of a 3-wire or 4-wire PC case fan emits a signal to indicate how fast the fan is actually spinning. Two digital pulses are emitted per fan revolution, and the software calculates RPMs from that.
There are 3 resistors involved for each fan tachometer. The 4.7k resistor is a pull-up, and it's value is not critical. The other two resistors, 27k and 10k, are a voltage divider circuit. The values are not critical, but the ratio is important. You want the resulting "divided" voltage to indicate a logic "high" on the input to an ESP32 digital pin. ESP32 specs call for at least 2.5 volts, but it's a good idea to be a little above that. Aim to be above 3 volts but under 3.3 volts. Voltages higher than 3.3 volts might damage the ESP32. You can use an online calculator to find other possible pairs of values. For example, I happen to have a lot of 4.7k resistors on hand, so I might use the calculator to find a way to use them instead of one of the other resistor values (and change the value of the remaining resistor to give a good divided voltage). If all that seems complicated, you could just stick with the values already in the design.
Even if you use the jumper option to supply the PWM signal from Fan 1 to other fans, they still might spin at slightly different speeds, so there is no option for sharing tachometer signals. The tachometer readings are only used for the automatic fan discovery at boot-up. After that, it only matters for casual observation of the fan speeds and no other functional purpose
- 4.7k ohm
- R51 (Fan 1)
- R52 (Fan 2)
- R53 (Fan 3)
- R54 (Fan 4)
- 27.4k ohm
- R61 (Fan 1)
- R62 (Fan 2)
- R63 (Fan 3)
- R64 (Fan 4)
- 10k ohm
- R71 (Fan 1)
- R72 (Fan 2)
- R73 (Fan 3)
- R74 (Fan 4)
Decide: How Many and What Kind of Fan Connectors
In a hurry or can't decide? Plan to place all 4 fan connectors and use modified 2x4 right angle pin headers.
The circuit board and software can operate with any combination of 1 to 4 fans. If your vents only allow room for fewer than 4 fans (which is pretty common), you can add just the fan connectors you need. On the other hand, you might choose to place connectors for all 4 fans, just in case you have a need for them at some future point.
Whatever number of connectors you decide to use, you have some options for what kind of connectors to solder onto the circuit board.
- There are official connectors for 4-wire PC case fans. They have a small off-center tab that mates with an indentation on the fan cable connector. The tab provides some additional holding power to keep the fan cable connected. They are available in both horizontal and vertical insertion orientations. However, the only connectors I could find were vertical insertion (pushing down toward the circuit board). That's convenient for their original purpose, which is to connect fans to a PC motherboard, but it's a little clumsy to work with when you make and assemble the Ventbot case. You can use vertical insertion connectors, but you will have to modify the 3D printed case. The Molex brand of these connectors has a small plastic pin on the bottom that expects a matching hole on the circuit board (so that you get the orientation correct). The circuit board doesn't actually have that hole, so you will have to snip off that small plastic pin if your connectors have it.
- It's fairly easy to find 4-pin connectors with that friction-fit tab in a right-angle, horizontal insertion orientation. However, the parts you find will likely have the tab across all four pins instead of just the first 3 pins. There are also a lot of vertical insertion parts with the same sort of tab. The extra width of the tab makes them difficult to use with the connectors on the fan cables (though it's not impossible). I found it reasonably easy to snip off part of the tab to make it the correct size, covering only pins 1-3. One of the pictures accompanying the next step shows a couple of connectors with that modification. Or, you can snip off all of the tab and let the pins hold things in place.
- (This is the way that I do it.) The spacing for the pins is exactly the same as the pitch of standard pin headers (0.1 inch, 2.54 mm). You can use standard 4-pin right angle pin headers to give horizontal insertion. You just have to be careful of the orientation of the fan cables when you plug them in (indentation facing up, as if the imaginary tab is on the top of the pin header). The connectors on the fan cables are fairly thick. Another option would be to use 2x4 right-angle pin headers and remove or clip off the lower set of pins. Many people don't realize that you can pull the pins out of these pin headers with a little bit of force. For the bottom row of pins, I clip off the part that has the right angle and then pull out the remaining straight part with needle-nosed pliers. I then push the upper row's right-angle part against the plastic to give maximum length to the straight part. The upper set of pins will automatically have additional spacing away from the circuit board. If you use these pin headers, you won't have the tab to provide extra oomph to the friction fit. I've found that the fit is pretty snug anyhow.
If you use any of the vertical insertion options, you will have to modify the 3D printed case to accommodate those connectors. I did some experiments with modifying the case for vertical insertion, and I wasn't crazy about the results. YMMV.
The circuit board provides a 2x4 footprint for each connector. Each pin in the set of 4 is connected to its twin. You will probably only need one of the two rows. You can use whichever best suits your choice of connector and any modifications you make to the 3D printed case.
PCB: Connectors and Jumpers
Along two edges of the board, there are several mechanical connectors for various things. The pin headers for jumper selections are also located along one of the edges. You can place these parts in any order, but for discussion we'll describe them in clockwise order.
Fan connectors
These are only needed for the fans actually being used. Because these connectors use a common 0.1 inch pitch, you have some flexibility in the part you use. The possibilities were described in the previous step.
The row of holes in the connector on the cable coming from the is not centered vertically. If you use right-angle pin headers, the thicker part of the cable connector will be facing down toward the circuit board. Check that there is enough room to actually connect the cable. You might have to bend the pin headers slightly upwards or do some wiggling of the cable to get them connected.
- 4-pin 0.1 inch pitch right-angle header (1x4 or 2x4)
- J11 (Fan 1)
- J12 (Fan 2)
- J13 (Fan 3)
- J14 (Fan 4)
Pin headers for jumpers
In a hurry or can't decide? Skip these.
As mentioned earlier, there are options for sharing Fan 1's PWM signal and/or power to any of the other fans. That was described in an earlier step. Normally, each fan should get its own PWM signal and its own power-controlling transistor. You have the option with jumper blocks on these pin headers for any combination of fans 2, 3, or 4 to get those controls shared from Fan 1. (If you do that, the software automatically figures out what's going on.) Without doing anything, the choice has been made for you to not use either of those types of sharing. That's probably what you want.
Rounding the corner from the fan connectors, you will find 6 sets of pads for 3-pin headers for selecting PWM and power sharing options. Although the pin headers are organized in pairs of 3-pin headers, they are physically staggered on the circuit board so you don't accidentally put the jumpers blocks on inappropriate pairs of pins. There are small white rectangles silk-screened on the circuit board to mark the normal position (each fan having its own controls).
If you want to make the choice to use any of the sharing (or if you want to be able to change your mind later), then follow these steps.
- There is already a trace connecting pin 1 to pin 2 on each of the 6 sets of pads. The trace is on the top side of the board (the side with all the components on it). Use a sharp blade to carefully cut through the trace. There's a small white line on the silkscreen that you could use for guidance.
- Now that pin 2 is not connected to either pin 1 or pin 3, you must make a choice to connect it to one of them. You could use a small piece of wire soldered in place between pin 1 and pin 2 or between pin 2 and pin 3. (It should be obvious that the trace you cut in the previous step was doing the job of connecting pin 1 and pin 2.)
- Another option would be to solder in place a 3 pin header. With the pin headers in place, you can use a jumper block to connect pin 1 (farther from the edge of the circuit board) to the center, which is pin 2. If you wanted that fan to share a signal from Fan 1, you would use the jumper block to connect the center to the other pin (the one not indicated with a white rectangle, which is pin 3).
For PWM sharing:
- 3-pin 0.1 inch pitch header
- JP22 (Fan 2)
- JP23 (Fan 3)
- JP24 (Fan 4)
For power sharing:
- 3-pin 0.1 inch pitch header
- JP12 (Fan 2)
- JP13 (Fan 3)
- JP14 (Fan 4)
Jumpers:
- 2-pin jumper blocks: one for each 3-pin header (total of 6)
I2C connections
The design uses a temperature sensor to know when to turn the fans on or off. The temperature sensor is not mounted on the main PCB. Instead, it is expected to be connected via wires so that it can be placed into the opening of the vent duct work. Electrically, the sensor interfaces using the I2C protocol. Physically, the circuit board provides 3 different connector types. You only need to use one of them, and you can omit the others if you want to.
In an I2C circuit with multiple devices, the 4 wires are all in common for the devices. On this circuit board, each signal is directly connected to the same signal on each connector type. Two of the connector types, JST-PH and JST-SH, have a de facto standard order for the wiring. There is not a standard for the pin header connectors, but this circuit board uses the same order as for JST-SH (which is the reverse of the order for JST-PH). As a handy reference, "SCL.SDA.+.G" (SCL and SDA signals, positive voltage, and ground) is silk-screened on the circuit board near the pin header connector positions. The JST-SH and JST-PH connector footprints have an abbreviated form of that near them on the silkscreen.
Although you only need to use one of these connectors for I2C, the 3D printed enclosure has openings for all of them. You can modify that enclosure so that it only has an opening for the one you use, or you can just print it as-is.
Pin headers for I2C
One way to interface the I2C temperature sensor to the board is to use Dupont wires to connect to a 4-pin 0.1 inch pitch header. The board has holes for 2 sets (J25). You have choices for what you do here.
- If you plan to use the JST-PH or JST-SH connector for I2C, you can skip these pin headers entirely.
- You can use a single 1x4 block of straight pin headers in either set of holes.
- You can use two 1x4 blocks or a single 2x4 block of straight pin headers.
- You can use a single 1x4 block of right-angle pin headers in either set of holes.
- (Recommended) You can use a 2x4 block of right-angle pin headers.
The reason I recommend the last option is because straight pin headers would mean vertical insertion, which is slightly awkward to use with the enclosure. You will need to modify the 3D printed enclosure if you do this. Using a 2x4 block of right-angle pin headers will give an extra I2C connector if you think of a use for it in the future. The only good reason to use straight pin headers here is because you have them already and don't want to bother obtaining the less common (but still easy to find) right-angle headers.
JST-PH connector for I2C
Another way to interface the I2C temperature sensor to the board is to connect to the 4-pin JST-PH connector (J22). These are compatible with Adafruit STEMMA and (more or less) Seeed Grove. The Adafruit article has a good explanation about Grove compatibility. Connectors are available for horizontal and vertical insertion of the mating cable connector. Either will work, but horizontal is easier to work with in this design. The silk-screened footprint on the board shows horizontal insertion. With vertical insertion, the cut-out notch should face away from the edge of the board. With horizontal insertion, the cut-out notch should face up, away from the circuit board.
JST-SH connector for I2C
Because it is a surface-mounted part and tricky for novices to work with, I described the JST-SH connector separately in an earlier step. If you plan to add the JST-SH connector, refer to that earlier step.
Power jack
The board should be powered by a 12 volt DC power supply. The most common connector for those power supplies is a barrel connector, and the board has a barrel jack to mate with it. The barrel connector should have a 2.1 mm center pin hole and a 5.5 mm outer diameter. (The jack typically gives the center pin diameters as 2.0 mm.) That's the most common size for those connectors, so if you bought one without checking, that's probably what you got.)
The footprint on the circuit board is for a specific part, but you will find many "no-name" equivalent parts that can use the same holes, perhaps with slightly different alignment to the edge of the circuit board. Here are some possibilities.
- CUI Devices PJ-063AH. This is the exact part for the footprint on the board.
- CUI Devices PJ-037AH. This is a less expensive part from the same manufacturer. It has a slightly different footprint, but I adjusted the holes in the circuit board so that it can be used.
- DC-005 "no-name" jacks. This is a part number used by a zillion different manufacturers of DC power jacks. They are pretty inexpensive. I can't guarantee that the ones you get will match the holes in the circuit board, but the ones I bought did. Some of these come with a third pin that enables sensing if the power plug is inserted. This design doesn't use that feature, and there is no hole for that pin on the circuit board. If your jacks have that third pin, just bend it out of the way or snip it off.
- There are barrel jacks that are intended to be mounted in a round hole in an enclosure or panel. They would be connected with wires to the circuit board. If you use one of those, which would require changes to the 3D-printed case, be sure to attach the wires to the correct holes. The hole in the center of the footprint is for ground, and the hole farthest from the edge is for 12 vdc. (The two holes on the sides of the footprint are just for physical attachment of the PJ-063AH and are not electrically connected to anything.)
PCB: Electrolytic Capacitors
Power smoothing
These smooth out the 12 volt power going into the fans. The value is not critical, and anything from 10uF to 100uF is fine. In fact, I'm not even sure they are needed at all, but they were part of the reference circuit that I copied into this part of the design. They definitely need to tolerate 12 volts, and I would suggest using parts that can tolerate something higher. IMPORTANT: If you leave these capacitors out, DO NOT connect the pads on the board. That would cause a short circuit from power to ground from the power supply, and that would be very bad.
You only need one capacitor for each fan, but the circuit board has pads and silkscreen outlines for two for each fan. They look like a figure "8" or a snowman. What's up with that? As a hobbyist, you will find it easy and inexpensive to buy electrolytic capacitors in lots of values and with reasonable voltage tolerances. But you might not have as much choice for the lead spacing. In fact, some online sites might not even tell you the lead spacing, so you won't know until you get them. The pairs of capacitor footprints on the circuit board are connected to each other. The larger footprint uses 5mm lead spacing, and the smaller footprint used 2.5mm lead spacing. Your capacitors might use yet another spacing. Use whichever one best fits the capacitors you actually have. There is plenty of room on the board for larger diameters, and the only effect of some other lead spacing is that the capacitors might not rest completely flat when placed.
Electrolytic capacitors have an electrical orientation. There is a small "+" silk screened onto the circuit board. The capacitors will have one of the leads marked with "+" or "-" on the side of the part (both leads might be marked). The board expects "radial" orientation.
Place them reasonably snugly against the board, solder the leads, and trim them.
If you use the jumper option to have power for some fans shared with Fan 1, you can omit the capacitors for those fans that don't have their own power.
- 10uF
- C11 (Fan 1)
- C12 (Fan 2)
- C13 (Fan 3)
- C14 (Fan 4)
Decide: What Voltage Regulator and Heatsink
In a hurry or can't decide? Use a CUI VXO7805-500 or CUI VXO7805-1000.
The power for the fans and the overall circuit board is 12v DC. The ESP32 module requires 3.3v DC. There is an on-board linear voltage regulator on the ESP32 module (usually an AMS1117) that can convert the 12vdc to 3.3vdc. The complication is that a linear voltage regulator dissipates as heat (hand-waving) the energy difference between 12vdc and 3.3vdc. 12vdc is near the upper limit of what the particular on-board regulator chip can handle, and it can also get quite warm from dissipating that much heat. In fact, I've had a couple of cases of seeing the magic smoke being released.
To deal with this voltage difference, there is a space for an additional voltage regulator on the PCB. You can use this to drop the voltage from 12vdc to 5vdc, which is much easier for the ESP32 on-board voltage regulator to handle. (It's the same voltage you get when you power it with a USB cable.)
The image of the circuit board showing the placement of the voltage regulator in the next step is generically marked, but you should use one of these parts that performs the same function. Here are some options for what to do:
- This is qualitatively the best option and is recommended. A few manufacturers make switching voltage regulators that can be used as direct replacements for the 7805 linear voltage regulator. Switching regulators are more efficient and dissipate much less heat than linear regulators. You will not need a heatsink with these. One example is the CUI VXO7805-500, but there are others. This regulator is only powering the ESP32 module and not powering the fans, so a modest capacity of a few hundred milliamps is sufficient.
- This is an OK option but not ideal due to the heat. You can install a 7805 voltage regulator. This is a widely available and inexpensive part (the actual part number you find may have some letters before or after the "7805" because different manufacturers have different conventions). Just be sure you get one in a TO-220 package (the most common). Since this is also a linear voltage regulator, it will also dissipate heat. It's larger and more robust than the ESP32 on-board regulator. If it happened to fail, it's also simpler and cheaper to replace than the entire ESP32 module. Besides the heat, there are a couple of physical disadvantages of using a 7805.
- To allow the most room for the heatsink, the 7805 will be standing kind of tall above the circuit board. That might mean you will have to modify the 3D printed enclosure for the height.
- If you lean the 7805 on its back (be careful it doesn't contact anything else), it might make it difficult to get to one of the buttons on the ESP32 module.
- This is the worst option. If you just want to take your chances and skip the extra voltage regulator (not recommended), you can just solder a wire between pins 1 and 3 of the voltage regulator footprint on the circuit board. Definitely avoid letting the wire contact pin 2 (the middle pin). Assuming you are taking the preferred option of using the switching regulator, just be sure it doesn't touch the ESP32 module, which is fairly close behind it.
If you chose to use a 7805 voltage regulator, in operation it will be somewhere between "warm" and "very warm, you might even call it hot". Although the 7805 is a mature and robust part, sustained heat is not good for any electronics. The usual thing is to add a heatsink. The tab on the TO-220 package has a hole specifically for attaching a heatsink. Here are some options:
- You can take a chance and do nothing at all. Once you've got the 7805 and the ESP32 module on the circuit board, you can let it run for a while and see how warm the 7805 becomes over time. I'd let it run for several hours to be sure. If it gets only "warm" (so you can touch it with your fingertips with no discomfort), then you can probably skip the heatsink, but you probably will not be this lucky.
- There are commercially available inexpensive heatsinks made to fit the TO-220 package. They are made of aluminum or some other metal, and they typically have fins or groves to increase the surface area to help shed the heat. This is the best option. There are also silicone greases and silicone pads to help with the thermal transfer between the 7805 and the heatsink.
- If you are feeling adventurous, you can DIY a heatsink by using a screw and some nuts and washers. There is a picture in this section that shows one that I made while waiting for my mail-order heatsinks to arrive. If you make your own heatsink, the two things you want are lots of mass and lots of surface area. You should run the device for a few hours to see if your makeshift heatsink or the 7805 still gets too hot.
PCB: Voltage Regulator
When you place the voltage regulator, whether you use a switching regulator or a 7805 linear regulator, there are 3 pads and two possible ways to insert it. Pin 1 is the pad closer to the power connector. For both the CUI VXO7805 and generic 7805 parts, you want to place them so that their more or less flat backs face away from the nearest edge of the circuit board. In other words, the back of the device will be toward the outline where the ESP32 module will go later.
PCB: MOSFET Transistors
The PWM signal controls the speed of each fan. Most PC case fans will keep spinning slowly even if the PWM signal is set to 0%. To overcome that situation, N-channel MOSFETs are used to turn off the power supply to a fan if the PWM signal is set to 0%.
I used a particular MOSFET part, but there are many others that would do the job just as well. You want an N-channel MOSFET that comes in a TO-220 form factor, which is the most common. It must be able to switch power at 12 volts DC or higher, and it must be able to switch the amount of current the fan needs. Check the specs for the fans you plan to use; it will sometimes be printed on a label on the fan itself. Most will draw no more than 100-150 milliamps at full speed, and, in fact, most will draw considerably less than that. For fans that will have their own power control, that's the amount of current involved. For Fan 1, if it will be sharing power control with any other fans, you will have to add in the power consumption for those other fans for the Fan 1 MOSFET.
I originally used part STP16NF06L, which can handle 60 volts and 16 amps. This part is not recommended by the manufacturer for new designs, but I didn't have any trouble finding them in hobbyist quantities. Other commonly available parts that would also work include FQP30N06L, IRF540N, and many others. I am currently using IRF540N MOSFETs, which are rated at 100 volts and 33 amps.
UPDATE: Based on some helpful feedback (see the comments), there are better choices for this MOSFET. Even though I didn't have any trouble with the ones I chose, there might have been some luck involved. It's better to use a MOSFET whose Vgs(th) (gate threshold voltage) maximum is less than the 3.3v output of the ESP32 pins. One example is the IRLB4030, but there are many others, similarly affordable.
These are the parts with the highest vertical profile on the circuit board. The orientation of the holes allows for bending them over backwards at an angle to make things shorter. There is a metal tab with a hole on the back side of the TO-220 package. That tab should be oriented so it is away from the fan connectors and toward the small transistors placed earlier. You will find that the legs of the part are thicker near the main body of the part and narrower toward the ends. You can use needle-nosed pliers to bend an angle in the legs. You can do that either before or after you solder the part in place. Be sure that the part isn't touching anything else when it leans on its back. It should hover in the air. (Don't rebend the legs too many times, or they will snap off.)
- IRF540N
- Q11 (Fan 1)
- Q12 (Fan 2)
- Q13 (Fan 3)
- Q14 (Fan 4)
Decide: Extra ESP32 Pins
In a hurry or can't decide? Skip extra ESP32 pins.
There are many unused pins on the ESP32 module in this design. This circuit board could also be used in various other projects. For those reasons, there are pads for adding standard 0.1 inch (2.54 mm) pin header strips. They are labeled J1 and J2 on the silkscreen. Each is 19 pins long, and each pin is electrically connected to the ESP32 pin directly beside it. Those pin headers usually come in sticks of 40 pins, so a single stick is enough, and you will even have a couple of pins left over.
Using these pin headers is completely optional and will not affect the functioning of the Ventbot. On the other hand, if you are a tinkerer and think you might tinker with this board, the pin headers are cheap enough that you might add them "just in case". On the other-other hand, you could wait and add them later should the need arise.
PCB: ESP32 Module and Pins
Finally, we come to the largest and most expensive component for the circuit board, the ESP32 module and a couple of pin headers to expose all of the ESP32 pins.
ESP32-DevKitC
There are many ESP32 dev boards around, but you need one that matches the footprint and pinout of the circuit board. This is the 38-pin version of the ESP32-DevKitC, which is also sometimes listed as ESP32-WROOM-32D or NodeMCU ESP32 (not the original NodeMCU, which was based on ESP8266). These sometimes have the wifi antenna sticking out off the end of the module, and sometimes they have the antenna positioned on the module board between the last couple of pins. The important part is the pin-out of the part. The footprint on the circuit board will accept either, and they both fit in the 3D printed enclosure.
If you look at the back of the circuit board and hold it up to the light, you'll notice that there is a solid layer of copper covering most of it. That's called a "copper pour" or "copper fill" and is just a good circuit board design practice. There is a rectangular area under the ESP32 antenna that does not have that solid copper layer. That's to prevent possible interference from the metal of the copper with the antenna electromagnetic emission pattern. You don't have to worry about this in any way. It's just interesting design trivia. I'm no expert in this area, but this article has some interesting insights. You want good wifi communications since you will be putting the entire Ventbot inside metal ductwork.
There are only two possible ways to insert the ESP32-module (and I don't mean "right" and "wrong", though that happens to be true). You should orient it with the USB port, which is not used in this design, near the circuit board power connector. You may find it a little tricky to get all of the pins into the holes at the same time, if they are even the tiniest bit out of alignment (and in my experience, they always are). What I usually do is try to line up the pins on one side of the module with the holes on the circuit board. Have them just barely started going into the holes. Then gently rock the module and squeeze the pins on the other side until they engage with the holes. This can take patience, and you might have to gently pry a few of the pins with a tool. Gently, gently! Be sure all of the pins on both sides are actually engaged with holes, and then slowly and firmly push the module into place. It will probably be a fairly snug fit. A variation of that technique is to start with one end of the ESP32 module engaged and then gently lowering the module as each pair of pin on opposite sides engages. (The process of placing this part always reminds me of the principle behind picking a tumbler lock.)
There is no need to trim the extra bits off the pins after they are soldered into place. The 3D printed enclosure provides room for them to dangle as-is.
An alternative strategy would be to place 19-pin female pin headers into the ESP32 module location and solder them. You could then simply insert the ESP32 module pins into those pin headers. The advantage is that there will be a little give in those pin headers, making it much easier to place the ESP32 module. There are two disadvantages. It makes the whole thing have a higher vertical profile, which might affect how you make the enclosure. And, your ESP32 will only be held in place by friction instead of a soldered mechanical bond, so it might work its way out over time due to vibration and thermal expansion and contraction. I would not recommend this approach unless you simply cannot get the ESP32 module directly inserted.
The ESP32 module has a small but surprisingly bright LED on it. Depending on the specific ESP32 module you have, it might blink intermittently while the ESP32 is running, or it might be on all the time. It's bright enough to make part of the 3D printed case glow. Since your Ventbots will be tucked away inside a vent cavity, that shouldn't be a practical problem. If you find it annoying, you can remove the LED. It's a tiny surface-mounted part that looks a lot like other components on the ESP32 module. When the ESP32 is powered on, you can easily identify the LED part. To remove it (with power removed from the ESP32 module), heat it with a soldering iron until the solder on both ends softens. Use a tool of some kind to flick the LED away. If any solder has splashed onto the ESP32 module, carefully clean it up with solder wick. In case you are wondering, there's a decent chance you destroyed the LED by overheating it with the soldering iron.
ESP32 extra pins
If you decide to place these, you should have a fairly easy time inserting each of them. You want the short ends of the pin headers to go through the holes from the top of the board, leaving the long ends of the pin headers available for connections. You could, in theory, use smaller segments of pin headers to make up the total of 19 on each side, but you will find that things look tidier if you use a single strip of 19 pins on each side. You might also like to do what I suggested earlier: solder one pin in place, then re-melt the solder while pushing the pins to stand them up straight and firm against the circuit board; finish by soldering the rest of the pins.
PCB: Temperature Sensor
This part is not actually mounted on the circuit board. Instead, it's a small separate circuit board that you will connect to the main circuit board with a cable consisting of 4 wires. How you actually make that connection will depend on the type of temperature sensor breakout board you have and what type of connector you have decided to use on the main circuit board. Regardless of how you make the physical connection, your I2C temperature sensor should be able to work with a 3.3v power supply. Sensors that want a 5v power supply will probably not work in this design.
We described the various I2C connectors on the circuit board in an earlier step. Now it's time to consider the connections on the temperature sensor board. If you are using a sensor that is part of an ecosystem, like Adafruit STEMMA, Sparkfun Qwiic, or Seeed Grove, and you are using a cable from the same ecosystem, you can hook things up without thinking about it too much. On the other hand, if you are doing any kind of mix and match, you must certainly pay attention to what signals are where. In these cases, don't rely on the colors of the wires to indicate which signal it carries. Different ecosystems have different conventions for the order of signals and for the colors of wires. The board is marked "SCL.SDA.+.G" for the pin headers. The "G.+" and "+.G" markings for the JST-SH and JST-PH connectors, respectively, are reminders of the orientation. The signals are in the same relative order for all of the connectors.
The picture in this step shows a typical "no name" BMP280 breakout board. These are fairly inexpensive and are available from a variety of sellers. They share a lot of circuitry with their cousins, the BME280, so manufacturers often use the same breakout boards for both. Theoretically, there is some kind of marking telling you which one you have (as you can see in the small black dot in the picture), but I have found they often do not have that marking. Even worse, sometimes you try to buy a BMP280 and get a BME280, or vice versa. You're unlikely to run into this problem if you get a branded sensor breakout board from a well-known manufacturer.
The good news in this confusion about "no name" parts is that the firmware doesn't care whether you use a BMP280 or a BME280, or even some other I2C temperature sensor. It's happy with any of them. In fact, in theory you could connect more than one, and the firmware would use them all. (There's no good reason to actually do that.) In the usual case, when you only have one of them connected, there will be harmless error messages logged when the ESP32 starts up because it couldn't find the other types of the devices.
The common breakout board shown in the picture has pads for 6 pin headers. Four of those pins are used for I2C. The other two are used for a separate interface called SPI that is not used in this design. (Don't worry if the particular BMP280 boards you have don't have those extra pins.) Two of the pins will be labeled "Vcc" and "Gnd", or something similar to indicate supply voltage and ground. The names of the other two pins for I2C are Serial Data ("SDA") and Serial Clock ("SCL"). You just have to make sure that the signals on one end of your cable or wires are the same as the signal the other end. Again, don't be fooled by the colors of the wires you are using. Check the markings on the boards on both ends to be sure.
Once you have settled on the connections to the temperature sensor board, I suggest you cover any exposed connectors or solder with electrical tape to prevent accidental shorts when the sensor board is rattling around in your metal ductwork. Just don't cover the actual sensor itself, which will be a small silver rectangle if you are using a BMP280 or BME280 (see the photo).
PCB: Testing the Board
At this point, you have a fully assembled circuit board with the choices you made along the way. Now is a good time for a quick test. You should already have uploaded the ESPHome firmware to the ESP32 in an earlier step. You can use the ESPHome dashboard to observe the firmware logging as you do the testing. (If you didn't already do the first firmware upload in that earlier step -- tut, tut! -- you'll have to find a USB cable that will physically fit into the USB connector on the ESP32 module that is already soldered to the board. If you can do that, you can connect the cable to a PC and do that first firmware update now. Do NOT connect the 12v power supply and the USB cable at the same time.)
- Put the assembled circuit board on some kind of non-conductive surface (to prevent things on the back side from shorting out).
- (Optional) Connect your temperature sensor to one of the I2C connectors on the circuit board.
- Connect one or more fans to the fan connectors on the circuit board. Obviously, it doesn't make sense to connect to any positions for which you decided to omit parts from the circuit board. If you placed parts for all 4 positions, you can plug in all 4 fans for this testing phase, even if you plan to use fewer fans "in production" in your vents.
- Connect the 12 volt power supply to a wall outlet and then into the connector on the circuit board.
If you are experienced with DIY electronics, you know what comes next. If you don't know, here it is: As soon as you plug in the power supply, keep your eagle eyes and bloodhound nose on the alert for smoke, sparks, funny smells, or parts of the circuit board that are more than just barely warm. If any of those things happen, disconnect the 12 volt power supply immediately, and think about the choices you have made in life up to now. (If things didn't go well, my best advice is to go through each of these assembly steps again, one at a time. At each step, recheck your soldering to see that the pins of the part are actually connected, and that you haven't accidentally made a solder bridge to something else.)
If thing go as expected, you should see the following things happen as soon as you connect the power supply:
- There will probably be a little bit of random blinking of the on-board LED on the ESP32 module, or you will see the LED steadily on (which one depends on the specific ESP32 module you have). There's nothing to learn from this beyond whether it happens or not. If there is no LED activity, there is probably something wrong, either with the firmware or your assembly of the circuit board. Obviously, you can't expect to see any LED activity if you removed the LED from the ESP32 module.
- One or more of the fans might come on briefly (a few seconds at most). Whether this happens depends on the specific fans you are using. It will probably happen, but don't be alarmed if it doesn't. The few seconds is the period of time when the circuit is powered up and the firmware has not yet had a chance to switch the MOSFETs off to cut the power to the fans. Even fans of the same module might behave slightly differently in this phase.
- The firmware will go through an auto-discovery process to figure out which fans are present and which are sharing the controls of Fan 1. For the first part, each fan will come on in sequence for a couple of seconds and then turn off. For the second part, Fan 1 will be on and then Fan 2, Fan 3, and Fan 4 will be on if they are sharing controls of Fan 1. After a few seconds, all the fans will have been turned off.
- The collection of fans will power up and go through the configured ramp-up table (described in a later step), and then they will power down through the configured ramp-down table.
- At that point, the fans go under the control of the temperature sensor if you have one plugged in. If things are at a normal room temperature, between the low and high trigger points in the firmware, the fans will stay off. They will also stay off if you haven't connected a temperature sensor.
- The ESP32 module has two small push buttons on it. One is labeled "Reset" or something similar. On the Ventbot circuit board, it's the button closer to the power jack. Pushing that will cause the ESP32 to reboot and repeat the previous steps. The other button is typically (and confusingly) labeled "Boot" and is connected to GPIO 0 on the ESP32. If you push that button, the firmware will go through the fan ramp-up cycle. At any time, you can push the button again, and the firmware will go through the fan ramp-down cycle, eventually turning all of the fans completely off. About 5 minutes after the last button press, the fans will return to being controlled by the temperature sensor.
- If you want to test the temperature control, you can use a hair dryer or something similar to warm up the temperature sensor breakout board. You don't need to go crazy since the default high trigger is only 85 F / 30 C or so. You can also cool the temperature sensor breakout board with an ice cube wrapped in cloth. Just be careful to not get any part of the circuitry wet. Also be careful to not short out any of the exposed metallic parts of the sensor board.
You can see a demonstration of most of the above things in the video. (I added step 4 to the firmware after I made the video.) If all of that went well, congratulations. Your board is working. There's a later calibration step where you can fine-tune the temperature triggers and the fan ramp-up and ramp-down configuration.
3D: the Enclosure
Off the shelf
If you are handy working with plastic and are a skilled artisan, you could probably make a usable case out of some kind of electrical junction box for mains wiring that you could find at a hardware store. The circuit board is 99 mm by 71 mm. In North American standard sizes, it would not fit in a single-gang box of any kind. However, it probably would fit in most double-gang boxes.
3D printed
Even though the devices will be tucked away out of sight, I prefer to use an enclosure that looks like it was made for it. You can see some examples of the enclosures I designed and used in the photos at the beginning of this Instructable. The design includes files for creating an enclosure on a 3D printer (file pointers below). If you don't have access to a 3D printer (you own one or can use one at work, at school, or at a local hackerspace), then there are services where you can upload files and have them print things and ship them to you. That last option takes time and can be a little bit pricey because you might have to iterate a couple of times before you get exactly what you want.
Filament material
The environment inside your furnace vent will get warm but probably will not get hot. 100 F / 40 C is probably around the upper limit. You can and should check your own system in the calibration steps below. With that sort of temperature, just about any of the usual 3D printing materials should be fine. Even lowly PLA should be safe to about 60 C (about 140 F). However, PLA is relatively inflexible, and you might consider printing in PETG, which has a little bit of "give". ABS would be even better, but that's a material for more experienced 3D printing. No matter what material you choose, don't forget to allow for shrinkage during printing. The circuit board fits over some pegs inside the enclosure, and material with too much shrinkage would mean things wouldn't line up. If you know the shrinkage percentage, most 3D slicers will let you scale your print to compensate in 2 of the 3 dimensions. If your shrinkage is only 1-2%, maybe it doesn't even matter.
The enclosure
The enclosure is in two pieces. The base has small pegs in the corners that match with mount holes in the circuit board. The lid has hollow columns which fit over those same pegs to clamp the circuit board in place. The two halves of the enclosure snap together. There are tiny clips and slots that hold the two halve together, so you will not need any screws or glue. In fact, you may find it difficult to get the two halves apart once you have joined them. On the bottom side of the base, near the corners, there are small holes. If you put the circuit board onto the pegs, you might find it difficult to get it back out without damaging the case. The holes in the bottom will let you push the circuit board out from below.
The enclosure has cutouts on one end for connecting the fans, and cutouts on a side for connecting the temperature sensor and the power cord.
The bottom of the enclosure has the project URLs printed on it (it's also printed on the circuit board). The top has legends for the fan and power connectors. The legend for each fan gives the fan number, and there is a small dot to indicate which side of the connector is pin 1. There is also a reminder of the pin order for the I2C pin header connector. It's difficult to get legible printed words with 3D printing, so the fonts for all of those things are rather large and bold. All of the printing is done with a scheme that engraves the text into the surface of the enclosure.
The lid has some slots for grillwork, although ventilation for this device is not really needed. There are also two small holes to give access to the buttons on the circuit board for testing. You can use a small screwdriver to poke the buttons, though you might need to fish around for them a bit, depending on their exact placement on your specific ESP32 module. You can see me doing that in the video in an earlier step.
The enclosure can be printed with the flat sides of the base and lid face down on the print bed, in which case you will find you do not need any supports.
STL files
If you just want to print exactly what I printed, with the choices that I made for my home, I provide the STL files that you can send to a 3D print service or feed into your own 3D slicer program. I don't know how likely it is that you will want to use them as-is, but it's an option.
- ventbot_yapp.stl: the entire enclosure (base and lid) in one file
- ventbot_yapp_base.stl: just the enclosure base
- ventbot_yapp_lid.stl: just the enclosure lid
OpenSCAD
The design for the enclosure was done using OpenSCAD, an open source parametric design tool. "Parametric" here means that the design is more like a small program instead of being a tool where you drag things around with your mouse. Don't worry if you're not a programmer. If you can handle understanding a graph of things with X and Y on a piece of paper, you have the skills and you'll be fine.
OpenSCAD is available for Linux, Mac, and Windows. Download and install it.
The enclosure design is based on Yet Another Parametric Projectbox generator version 1.6. Download it and install it as an OpenSCAD library in one of the locations described in the OpenSCAD documentation.
Finally, download this project's OpenSCAD design file, ventbot_yapp.scad, and save it in a convenient location. Open that file in OpenSCAD. You might want to make changes to the design based on your own preferences. For example, if you will never be using one of the I2C connectors, you can remove the cutout for that connector from the enclosure. There are many comments in ventbot_yapp.scad, so you should open it in a text editor and look over it (or use the editor built into OpenSCAD). If you make changes to the design file via the editor, you should see updates in the OpenSCAD preview window.
When you are happy with your modifications, you can tell OpenSCAD to render the design. Once it's rendered, you can export it as STL and open the STL file in the 3D slicer program. The two parts of the enclosure are drawn end-to-end, which is too large for many 3D printers. You can either move the parts around to be side-by-side, or you can print the two parts separately.
Rattles
The idea of the case is that the PCB is clamped in place by the combination of the pegs on the bottom and tubes on the top. Then the two halves of the case are held together with matching clips and slots. You may find it difficult to get exactly the right distance for effective clamping while still getting the right distance for clipping the case halves together. If so, opt for a little extra space for clamping and make the clipping as precise a match as you can. You might then find that the PCB is slightly loose and rattles around a bit. This doesn't make any functional difference, but it can offend your sense of aesthetic polish. To get rid of the rattling, you can add reinforcement donuts (intended for use with loose-leaf notebook paper) as non-conductive washers over the posts inside the bottom of the case. They happen to be just the right size, and you can use as many as you need to get the right thickness.
3D: Fan Mounting Brackets
You'll want to hold your multiple fans together as some kind of unit. You can buy ready-made metal clips for that, but that's only the first part. You also need to position the fans unit in the vent cavity in some stable way, and those clips won't help with that.
The Ventbot design includes a customizable bracket that you can 3D print: ventbot-bracket.scad. That's an OpenSCAD file. I described OpenSCAD in the previous step for the Ventbot case. There are a lot of parameters that you can adjust to get the bracket exactly the size you want. You will find it helpful to read the comments in the bracket design file in a text editor. It's hard to think of good and obvious names for all of those possible adjustments, so one of the images in this step is a reference diagram with everything named. The actual dimensions in the reference diagram don't make any sense; I just made everything big enough so that the labels would be reasonably positioned.
The image that includes a 9V battery shows a typical realistic bracket. (The battery is just for scale and is nothing to do with this project.) The rectangle in the center of the bottom is called the fan box. You'll slide a fan in from each side and secure it with screws to hold the two fans together, side by side. A little bit above the fan box is a horizontal cross-brace. It's optional and you can use it if you need more stability. If you use the cross-brace, it has holes in it so that you will be able to reach the screws that go through the fan box. You can see how things come together in the image with 3 fans mounted in 4 brackets. That's one of mine, and I didn't use the cross-braces. The brackets on the two ends were made by adjusting (in OpenSCAD) the distance between the screw holes to zero and adjusting the overall width of the bracket by the same amount.
You will be hanging your fans from the lip of the vent cavity, and that's what the tabs at the top are for. Another option is to stand the fans on the floor of the vent cavity, if the vent cavity geometry allows for that. For that reason, there is an option to change the direction of the tabs from facing outward to facing inward. For a standing set of fans, you probably want the bracket to be fairly close to the width of the vent cavity to prevent things from dancing around due to vibration. For a hanging set of fans, you can do the same thing. Or, you can make the brackets a little narrower and depend on the vent cover register to push the tabs outward. Whatever you do, you have to allow for the vent register cover, which may have fins or other projections into the vent cavity. If you print the brackets with PETG, you will find they have quite a bit of flexibility, as illustrated in one of the images.
The screws that hold the fans and brackets together are the standard screws that you undoubtedly got in the package when you bought the fans. When used as a PC case fan, the screws only go into one side of the fan. You can do that for your Ventbot fans, screwing in only the back or the front or some combination of the two. If you want extra stability (I don't know if it's needed, but I did it), you can buy extra PC case fan screws fairly cheaply and use screws in all 8 holes of each fan.
A couple special cautions:
- Whether using standing fans or hanging fans, make a note of the direction of airflow for the fans. You want the air to blow out of the vent cavity. Usually, somewhere on the fan's casing will be some arrows showing both the direction of the fan blade rotation and the direction of the airflow. If you can't find those markings, definitely plug the fans in and find out. Don't depend on the fan's brand label to be either the front or the back; it could be either.
- The screws that hold the bracket and fan together are self-tapping. That means there are probably not any threads in the fan's plastic casing. The screws create the threads by biting into the plastic when you screw them in. That also means you can only unscrew and screw them a limited number of times before the screws lose their grip and refuse to hold. Also, do not overtighten the screws or you risk stripping the threads the screw made.
- Pay attention to how you are routing the cables from the fans. After all, the fan is square, so there are 4 possible orientations that will fit into the brackets the same way (not counting the wrong ways with the airflow going in the wrong direction). You definitely want to make sure the cables won't be up against the blades of the fan or its neighbors. Other than that, you probably want all of the cables from all of the fans to have the same relative placement, just to make it easier to connect everything up.
Placing a Ventbot
Now you've got everything you need. It's time to actually put the Ventbots in their forever homes. If you are doing more than one, I suggest placing just one and making any adjustments before dong the rest. You will probably learn a few things that save your some effort for the later ones. You are probably going to find that things are a bit more tangly and uncooperative than you imagined them as you were building things. This is where French Enlightenment philosophy meets geometric reality.
- Connect the temperature sensor to the Ventbot board through the appropriate opening in the case. If the wires are not reasonably straight, you probably want to work on that first. It doesn't have to be perfect.
- Run the cables from each fan to the connectors on the Ventbot board. Pay attention to the orientation. The grooves that form a notch on the connector face upwards, and the thicker part of the connector faces the base of the Ventbot case. If you used right angle pin on the circuit board, you may have to wiggle things a bit to get the fan connector in place. Be gentle but firm!
- Do not plug the power adapter into the mains outlet yet. How will you route the power cable to the Ventbot? You can either route it directly, passing completely under the vent cover, or you can route it through one of the openings in the vent cover. If you are routing it through an opening, now is the time to do that. Plug the power cable into the Ventbot case. Don't plug the other end into the mains power yet.
- Place the Ventbot case into the vent cavity and feed the wire with the temperature sensor into the ductwork in the direction of your HVAC. You could use some of that HVAC foil tape (not duct tape!) to hold things in place, but I didn't bother with that.
- Place the fans and bracket assembly into the vent cavity. You want the cables from the fans to be as out of the way as possible, but it's a tricky business for those of us with only two hands. The thin wire cables from the fans seem to want to escape your control.
- Now, before putting the vent cover in place, plug the power adapter into the wall outlet. The Ventbot will go through its power-up sequence, and each fan will come on at least briefly. You are checking two things. First, did all the fans come on at the expected time? Second, did any of the fans produce any weird or annoying noises? Those noises can happen if it's a tight fit and the bracket assembly is getting warped a little bit. It can also happen if some of the fan cables or the power cable are rubbing against a fan blade. For either of those, unplug from the wall outlet, make adjustments, and repeat this step until things are happy.
- Put the vent cover in place. It might be a tight fit. Go ahead and swear if you need to do it. I won't judge.
- Plug into the wall outlet again. You may find that placing the vent cover undid some of your earlier adjustment, and you are now getting noises. There's nothing for it but to repeat your steps until things are happy again.
The pictures that accompany this step intentionally shows the least cooperative vent cavity I had to deal with. It was such a struggle that I eventually re-printed the fan brackets with slightly different dimensions. I also removed the adjustable louvres from the vent cover. We don't use them, and removing them reduced the thickness of the cover. It also made it possible for me to bend the long sides in slightly so that it was easier to place the cover. I hope you don't have that kind of struggle. If you do, don't blame me. Blame the crew that installed your ductwork.
With that first Ventbot in place, you can leave it plugged in. You can either go straight to installing the others or you can do the calibration steps for this first Ventbot next.
Calibration: What's That About?
When I get a gadget and the instructions say I need to calibrate it, I feel sad because I think I won't do it right. I don't have a government certified lab or expensive equipment. I start to doubt that I'll get it right. In this case, calibration only means tuning things to operate for your particular environment and preferences. All of the steps are pretty easy, and many people will find they don't need to change anything.
Much, much earlier, you used ESPHome to install the initial firmware onto the ESP32. You used a USB cable for that first time, but now everything can be done over wifi. For the calibration adjustments, you will be using your ESPHome setup again. We'll continue our earlier example and assume your Ventbot is named "ventbot-chuzzlewit". There are two ESPHome files involved. Each Ventbot has its particular file like "ventbot-chuzzlewit.yaml" which references a much larger "ventbot.inc.yaml" file. The same "ventbot.yaml.inc" file is used by all of the Ventbots, and you don't need to make any changes to it. The individual files like "ventbot-chuzzlewit.yaml" contain all of the tunable settings.
Since the updates will go over wifi, and since you have placed your Ventbot into a metal box, there is some chance that a weak wifi signal won't reach it. That would also be true if the vent cavity were in a place with no wifi coverage. For those cases, you would have to bring the Ventbot to a location that does have wifi coverage. I hope this doesn't happen to you since it would be a major inconvenience. I didn't have this kind of problem, but wifi is strong in all the Ventbot locations in my house.
There are comments throughout both files. You will not need to change most things in "ventbot-chuzzlewit.yaml", but there are things in there for you to consider. In most cases, the default values will be what you want. You will not be changing "ventbot.yaml.inc" at all unless you feel like going on a programming adventure to modify the Ventbot behavior in some way that can't be done with the tunable configurations.
For the steps which follow, your process will be to modify values in "ventbot-chuzzlewit.yaml" and then use ESPHome's web interface or command line tools to rebuild and upload the firmware to the Ventbot. If you want to make the same change to multiple Ventbots, you will repeat the steps for each one. If you ever want to go back to the defaults, you can alway look at my master copies of the files to find them.
You can also use ESPHome to monitor any of the Ventbot behavior by looking at the on-board log files, but the Ventbots will operate autonomously and do not depend on being connected to anything (other than the wifi connection you use if you want to monitor the logs or update the firmware).
Note: I am an incorrigible tinkerer, so I will probably continue to tweak the Ventbot firmware long after this Instructable is published. Most changes would end up in "ventbot.yaml.inc". It should be rare for me to make any changes to the example individual Ventbot files like "ventbot-chuzzlewit.yaml". You can check in on "ventbot.yaml.inc" from time to time to see what's new. In most cases, if you see a change you want, you should be able to just download a copy of that file and rebuild and upload the firmware for each of your Ventbots.
Calibration: Temperature Triggers
A Ventbot turns the fans on if it detects a temperature above a certain point (the "high trigger") or below a certain point (the "low trigger"). In between those two values, a range I call the "neutral zone", the Ventbot turns the fans off.
The HIGH_TRIGGER and LOW_TRIGGER are just numbers. You can express them in either Fahrenheit or centigrade. A companion setting, TRIGGERS_ARE_CENTIGRADE, indicates which scale you used. So you can use whichever scale is more familiar to you. Another related setting, SENSOR_IS_CENTIGRADE, indicates what your temperature sensor uses for its native scale (it will almost certainly be centigrade).
What values should you use for your temperature triggers? While watching your Ventbot's log file with ESPHome, turn on your heat. You'll see periodic temperature readings reported in the on-board log files. The values are logged in both scales for convenience. You'll see the temperature rise from something near room temperature to something that you might find surprisingly high. You want to pick a value that is well above normal room temperature and some amount below the maximum reached when the heat is on (to allow for some variation from cycle to cycle). If you have air conditioning, repeat things with the cooling turned on and set the low trigger if you want something different from the default.
One caution: If you have multiple Ventbots, do this step for each one individually. You might find fairly significant differences in low and high temperatures for different parts of your ductwork.
## CONFIG ##
# If the temperature is above the high trigger, the vent is blowing
# heated air. If below the low trigger, the vent is blowing cooled
# air. Boosting is desired for both cases.
HIGH_TRIGGER: "85.1"
LOW_TRIGGER: "60.5"
## CONFIG ##
# Most temp sensors read out in centigrade. You can specify the triggers in
# either centrigrade or fahrenheit by setting these things appropriately.
# The code will do conversion to the right scale.
TRIGGERS_ARE_CENTIGRADE: 'false'
SENSOR_IS_CENTIGRADE: 'true'
Calibration: Ramp Up and Down
To get the maximum boosting effect, you could just turn all the fans on to maximum speed immediately when boosting is desired. Ventbot takes a more complicated approach because maximum RPMs also means maximum fan noise. This might be especially important in rooms where people sleep. Not only can the maximum RPM fan noise be annoying, but the transition from no noise to some noise can be a sort of audio shock that might wake someone up.
To solve both of these aspects, Ventbot uses a configurable table of values to tell it how fast the fans should spin and what steps it should take to get there. It's called the ramp table, and it's used for both directions, for spinning the fans up and for spinning them back down. The complete explanation is below. In all its glory, it can seem pretty complicated. The most important things to decide are the maximum speed you want the fans to reach and how many steps and pauses to use to get there. You can also consider how many steps and pauses to use when turning the fans off, but that is likely to be less important for most people. Fan speeds are expressed as a percentage of maximum instead of some number of RPMs. For the average person, the percentages are more intuitive.
How should you decide what to change, if anything? When Ventbot powers up, after autodetecting which fans are present, it goes through a full ramp-up and ramp-down cycle. You can plug it in and then listen to see what it sounds like. The default ramp table only takes the fans to 80%. If you want to hear what 100% sounds like, you can remove the "/*" and "*/" comment markers from the last line of the table. The Ventbot automatically reboots after a firmware update. If the computer you are using for firmware uploads is not conveniently located, you can unplug the Ventbot power for a few second after a firmware update and then plug it back in. (Don't unplug it in the middle of an upload.)
## CONFIG ##
# This table is used to control how the fans spin up (when the HVAC comes on) or
# spin down (when the HVAC goes off). The speeds are changed in steps, with one
# row for each step. When the fans are spinning up, the first number in the row
# is how many seconds to pause after setting the fans to the values for that step.
# The second number is similar, but it's seconds to pause when spinning down.
# You might want those numbers to be the same, but it's not required. The
# right-hand block of numbers in inner {braces} is one per fan. It's a PWM duty cycle
# percentage, which means roughly the percentage of the fan's maximum speed. If
# the value is 0, that fan is switched off. You can also use decimal fractions (0.4
# for 40%). Any value 1 or smaller is interpreted as a decimal fraction, and
# anything larger than 1 is interpeted as a percentage.
#
# There is a row of 0 values at the beginning of the table, which
# means all the fans will be switched off after spin down is completed. That
# matters for most fans since they keep spinning even with a PWM value of 0.
# If for some reason you don't want to switch the fans completely off,
# you can delete or change that row.
#
# The delay after the final ramp-up step is not meaningful since the fans
# will continue to run indefinitely at the speeds given in the final step
# (until something happens to tell them to spin down). Likewise, the delay
# after the final ramp-down step is not meaningful.
#
# Fractional percentages are OK for all of these numbers, though that kind of
# precision is not generally warranted. Be careful of the exact format for
# punctuation or you will be greeted with incomprehensible gibberish when you
# try to build it. Every block must end with a comma, including the last line.
# Extra spaces are OK. For other esoteric syntax reasons that you probably
# don't care about, maintain the left indentation amount (for YAML reasons)
# and use /* */ commenting (for C++ and ESPHome reasons).
#
# You are not required to go all the way to 100% (maybe it's too loud for
# you). You are also not required to go strictly increasing/decreasing.
# If you just want to turn all the fans on immediately and completely, you
# could just use this single line:
#
# {0, 0, {100, 100, 100, 100}},
#
# In my own configuration, I only go to 80% because the fans I use get
# significantly louder above that. I start the fans up individually to
# minimize the "audio shock" of hearing the start-up. I comment out the
# start-up step for Fan 4 because I only have 3 fans. I hope these
# examples will help you configure your own ramp up and ramp down steps
# if you don't like mine.
#
# {up, down, { f1, f2, f3, f4}},
RAMP_TABLE: |-
{0, 0, { 0, 0, 0, 0}},
{2, 1, { 2, 0, 0, 0}},
{2, 1, { 2, 2, 0, 0}},
{2, 1, { 2, 2, 2, 0}},
/*{2, 1, { 2, 2, 2, 2}},*/
{5, 5, { 20, 20, 20, 20}},
{5, 5, { 40, 40, .40, 40}},
{5, 5, { 60, 60, 60, 60}},
{5, 5, { 80, 80, 80, 80}},
/*{0, 5, {100, 100, 100, 100}},*/
The On-board Logs
The firmware on a Ventbot creates a running log of pretty much everything it does. The log doesn't go anywhere. It just accumulates in the ESP32's memory until the memory space is needed for new log lines. ESPHome provides ways of looking at the logs in real time, over wifi, as things run. It's also possible to download the logs to a file. Of course, you can only download the latest few hundred lines that have not been overwritten.
By default, Ventbot logs are DEBUG level. That leads to output from both the Ventbot logic and the ESPHome framework and devices. Although there is a configuration option to change the log level (for example, to INFO) to get less or more detailed logging, I don't recommend changing it. The chatty logging of the default DEBUG level doesn't do any harm, and it does contain some pretty valuable things for anybody poking around in the behavior.
I'm not going to try to describe everything in the logging. We'd be here all day. But there are a few things that even a casual user might find interesting.
Right after boot-up, there will be many log lines as the ESPHome framework initializes all of the configured components. Among those, it will attempt to configure about a dozen different types of temperature sensors. Since you are only using one of them, you will see failures for all the others. That's normal and expected. I did it that way so that you wouldn't have to configure which temperature sensor you are using. You can even change to a different sensor later. As long as it's a supported device, it will be detected and things will work fine. Here are examples of a missing sensor and the sensor that I am actually using on one of my Ventbots. For the success case (BMP280), it doesn't explicitly say it found it. It just doesn't indicate any kind of error (as it does for the BME280).
[17:11:23][C][bmp280.sensor:124]: BMP280:
[17:11:23][C][bmp280.sensor:125]: Address: 0x76
[17:11:23][C][bme280.sensor:177]: BME280:
[17:11:23][C][bme280.sensor:178]: Address: 0x77
[17:11:23][E][bme280.sensor:181]: Communication with BME280 failed!
The first time Ventbot uses the ramp table to spin up or down, it logs the configured trigger values and the entire ramp table that it is using. You can compare that to the ramp table mentioned earlier. The "-" for Fan 4 on the Fan control line in this example means that Fan 4 is not present.
[17:11:44][I][ventbot:828]: Name: ventbot-red
[17:11:44][I][ventbot:828]: Temperature triggers: Low 60.5, High 85.1
[17:11:44][I][ventbot:829]: There are 8 ramp steps
[17:11:44][I][ventbot:833]: Fans: Fan 1 2 3 4
[17:11:44][I][ventbot:838]: Fan control: 1 2 3 -
[17:11:44][I][ventbot:842]: { 0.0, 0.0, { 0.00, 0.00, 0.00, 0.00}}, /* 1*/
[17:11:44][I][ventbot:842]: { 2.0, 1.0, { 2.00, 0.00, 0.00, 0.00}}, /* 2*/
[17:11:44][I][ventbot:842]: { 2.0, 1.0, { 2.00, 2.00, 0.00, 0.00}}, /* 3*/
[17:11:44][I][ventbot:842]: { 2.0, 1.0, { 2.00, 2.00, 2.00, 0.00}}, /* 4*/
[17:11:44][I][ventbot:842]: { 5.0, 5.0, { 20.00, 20.00, 20.00, 20.00}}, /* 5*/
[17:11:44][I][ventbot:842]: { 5.0, 5.0, { 40.00, 40.00, 0.40, 40.00}}, /* 6*/
[17:11:44][I][ventbot:842]: { 5.0, 5.0, { 60.00, 60.00, 60.00, 60.00}}, /* 7*/
[17:11:44][I][ventbot:842]: { 5.0, 5.0, { 80.00, 80.00, 80.00, 80.00}}, /* 8*/
Whenever Ventbot tells a fan to do something, it logs a few lines about it. If you read through all those log lines, you will find it matches the behavior specified in the ramp table. Here's an example of telling Fan 2 to go to 40% speed.
[17:11:58][D][ventbot:622]: S04_direct_fan_control, fandex 1 (zero-based), pwm 40.000000
[17:11:58][D][ventbot:618]: Setting Fan 2, PWM 40.0%
[17:11:58][D][sensor:094]: 'ventbot-red F2 PWM': Sending state 40.00000 % with 0 decimals of accuracy
[17:11:58][D][ventbot:631]: changing fan 2, ON (0.60 aka 40%)
[17:11:58][D][switch:012]: 'ventbot-red F2 power' Turning ON.
A few times per minute, the temperature is read from the sensor. Because the sensor this Ventbot uses is a BMP280, the barometric pressure is also read, but it's not used for anything. For human convenience, the temperature is logged with values in both scales.
[17:12:46][D][bmp280.sensor:175]: Got temperature=21.5°C pressure=1007.7hPa
[17:12:46][D][sensor:094]: 'ventbot-red Temp': Sending state 21.47000 °C with 1 decimals of accuracy
[17:12:46][D][ventbot:733]: script: S10a_on_temperature_reading (21.5 raw)
[17:12:46][D][ventbot:748]: script: S10b_on_temperature_reading (21.5 raw)
[17:12:46][D][ventbot:756]: S10_on_temperature_reading (70.6 F)
[17:12:46][D][ventbot:757]: S10_on_temperature_reading (21.5 C)
[17:12:46][D][sensor:094]: 'ventbot-red AirPr': Sending state 1007.66455 hPa with 1 decimals of accuracy
A few times per minute, the speeds of the fans are read. After fan autodetection, this has no further functional use in the operation of the Ventbot, but it can be helpful in figuring out if your fans are working properly. Of course, they will read zero when Ventbot has turned the fans off. The speed is read as two pulses of a signal per rotation of the fan. Ventbot converts that to RPMs. Don't be concerned if the fans are not reported in order or even along with each other. The ESPHome framework doesn't know that they are related, and it gets to each one in its own time. Incidentally, after Ventbot tells a fan to change speed, it can take some seconds for the physical speed change to actually happen, and the tachometer readings will not be correct until the fan reaches the new speed and settles down. Also, it would just be a coincidence if two fans had exactly the same tachometer output; things just aren't that precise in this inexpensive equipment.
[17:12:30][D][pulse_counter:174]: 'ventbot-red F1 tachometer': Retrieved counter: 2700.00 pulses/min
[17:12:30][D][sensor:094]: 'ventbot-red F1 tachometer': Sending state 1350.00000 rpm with 0 decimals of accuracy
[17:12:30][D][pulse_counter:174]: 'ventbot-red F4 tachometer': Retrieved counter: 0.00 pulses/min
[17:12:30][D][sensor:094]: 'ventbot-red F4 tachometer': Sending state 0.00000 rpm with 0 decimals of accuracy
[17:12:31][D][pulse_counter:174]: 'ventbot-red F3 tachometer': Retrieved counter: 2349.80 pulses/min
[17:12:31][D][sensor:094]: 'ventbot-red F3 tachometer': Sending state 1174.90210 rpm with 0 decimals of accuracy
[17:12:33][D][pulse_counter:174]: 'ventbot-red F2 tachometer': Retrieved counter: 2119.82 pulses/min
[17:12:33][D][sensor:094]: 'ventbot-red F2 tachometer': Sending state 1059.91162 rpm with 0 decimals of accuracy
You may have noticed that some of the log lines say they are "sending" a value. Where are they sending it to? By itself, they aren't sending those values anywhere, but they are available to be sent over the network to a home automation hub. That's not required in any way for the Ventbots to do their job. They operate autonomously. We'll cover the completely optional integration with Home Assistant in the next section.
Home Assistant Integration
I've said a couple of times that Ventbots can operate on their own without communicating to each other or the outside world. That is definitely and completely true. But ESPHome, the framework in which the firmware is composed, and Home Assistant, a pretty complete home automation system, are closely related open source projects. It is very easy to let Ventbot report its findings to your Home Assistant server, and it's even straightforward to use a Home Assistant dashboard screen to tell your Ventbot to do things.
It's beyond the scope of this Instructable to describe how to set all that up, but I did want to give a little taste of the possibilities. Just as an example, one of the things I am pretty likely to do is use my home thermostat to control my Ventbots. My smart thermostat already tells my Home Assistant server when it is heating or cooling (and a few other things). Instead of using the temperature sensors attached to the Ventbots, I might use Home Assistant's knowledge of when the heating or cooling is on to command the Ventbots to start and stop. The only reason I haven't done that already is that I'm being absolutely sure that the Ventbots can operate with their connected temperature sensors (they do).
I've attached a couple of screenshots of some of my Home Assistant dashboards related to my Ventbots. For me, fiddling with the dashboard user interfaces is a never-finished work in progress, so it will probably look different next week, next month, or next year.
The first image, which is a pair of multi-colored graphs, shows the temperature sensor readings and Fan 1 tachometer readings from all five of my Ventbots over the course of several hours.
- There is an obvious spike on the right-hand side. That's when the heat pump did what its name suggests and pumped some heat through the vents. That happens on chilly mornings when the thermostat schedule switches over from nighttime to daytime comfort. (Yes, here in the Seattle area, we get chilly mornings in June. We also get stinking hot evenings sometimes.)
- Most of the temperature readings throughout the night are wiggly lines. That's not a sensor or graphing problem. The smart thermostat is set to run the fan some percentage of every hour to keep things fairly evened out without actually heating or cooling. That causes tiny temperature changes in the vent cavities.
- The bottom graph shows the tachometer readings for Fan 1 of each of the Ventbots over the same timeframe. The scale is too compressed to see the ramp-up and ramp-down, but it's clear that the fans go up to 1600 rpms or so when the heat is on. (There is a little bit of a graphing artifact in that chart. The Venbot fans are not running slowly all night. The graphing software is doing some kind of interpolation.)
The second image is part of a dashboard that shows all five Ventbots side by side, though I'm only showing two of the columns here. Since my Ventbots have names (and 3D printed cases and fan brackets) of distinctive colors, I also used those colors in my dashboard.
- The row of square buttons along the top of each column lets me control each Ventbot for testing purposes.
- Likewise, the small reboot button lets me reboot the ESP32.
- The block of 4 lines with little thermometer icons show reports from the Ventbot. In addition to the expected current temperature (the 3rd of those lines), the Ventbot also reports its high and low temperature triggers (the 2nd and 4th lines). Those don't change unless you reconfigure the firmware, but it's handy to have it reported so you don't have to remember it. Notice, for example, that the orange Ventbot has triggers that are not the default; it's in a room that is far from the heat pump. I'm still tuning those triggers. In the late afternoon, the ambient temperature in that room got high enough to turn that Ventbot on without the HVAC actually blowing anything.
- The next several lines report the PWM speed percentage and the actual tachometer reading for each fan. Most of the time, you would only care if things are working or not, so that amount of detail is a little bit "data geeky".
- Finally, the two graphs on the bottom are similar to the information plotted on the first image, except that each Ventbot gets its own graph.
I realize this section is light on implementation details. That's intentional because this Instructable is about Ventbots, not about Home Assistant. With a little more effort, you could instead integrate the Ventbots with some different home automation system.
Conclusion
If you made it this far, even just reading instead of actually building Ventbots, you've been on quite a journey. It was an even longer journey for me to make the first one, but things went pretty fast for me once I built up some momentum. (Don't tell anybody, but this is the 4th version of the circuit board, the second version of the brackets, and the I've-lost-count-how-many-versions of the Ventbot case.) I'm pretty happy with the hardware results, and I'm also happy with the software at this point in time. I'm actually a software guy in my day job, so I can't resist continuous improvement (or at least continuous change).
Thanks for your attention. I hope you found it interesting. Your comments and suggestions are invited and welcome.