DIY Wireless Household Temperature and Humidity Monitor System With Up to 5 Remote Sensor Stations
by CHWTT in Circuits > Arduino
217 Views, 7 Favorites, 0 Comments
DIY Wireless Household Temperature and Humidity Monitor System With Up to 5 Remote Sensor Stations
Hello there and welcome to my Instructable! In this Instructable, I'll be showing you how to build a DIY wireless temperature/humidity monitor system that can work with up to 5 wireless sensors, has a sensor built into the receiver station, and that is designed to have much more accurate temperature readouts than my old version of this project. If this sounds interesting to you, check it out!
This project consists of three main components: the base station, and two kinds of wireless remote sensors: one that's a basic, wireless sensor, and one that's a basic, wireless sensor, but with a screen on it that displays its own readout.
I will split the supplies section and the rest of this Instructable up so that all three parts for this project are clearly understandable, so you know exactly what you need for each part, as well as how to build each part.
Supplies
All links EXCEPT for PCBWay shared project links are non-affiliate.
Supplies for the Base Station:
Electronics:
1x SH1107 1.5" I2C OLED Display
3x 12MM Panel Mount Pushbutton
1x NRF24L01
1x BME280
1x 10uF 1206 Ceramic Capacitor
Hookup Wire (could also just cut the ends off of some DuPont cables)
Hardware:
4x M2 Nut
Custom Parts:
1x Custom PCB - Here's the link to a shared PCBWay project that has the gerber files for the custom PCB for this part of the project. Note that PCBWay is my YouTube sponsor, and that on this page, you have the option to either download the gerber files yourself, or to place an order with a button directly on the page, which will give me a 10% kickback from your purchase - it really helps out my YouTube channel if you do that!
1x Custom 3D Printed Parts - In this Instructable, there are STL files for all of the 3D printed parts for the enclosure. Refer to the filenames for which files are relevant to each part of the project, and you will need one of each part that is marked to be for this piece of the project. One last thing, if you don't have a 3D printer, PCBWay has a 3D printing service that you can check out right here.
NOTE - The front panel of the base station is a part that, if you're looking to add some flare and a more polished feel to your project, you can have CNC machined by PCBWay, like I did. It will cost more than a 3D print, but it's not absurdly expensive and it adds a lot to the finished product in terms of aesthetics and feel. If you go this route, use the .STEP file instead of the .STL file, and for reference, I got my part in 6061 Aluminum with a bead blast and anodized gray finish, if you're wondering.
Supplies for the Simple Remote Sensor:
Electronics:
1x Arduino Nano
1x NRF24L01
1x BME280
1x 10uF 1206 Ceramic Capacitor
1x 2x5 Male Pin Header (two 1x5 headers next to each other will work as long as they're aligned)
1x Jumper
Hookup Wire (could also just cut the ends off of some DuPont cables)
Hardware:
2x M3 Locking Washer (only needed sometimes to help align the USB-C port)
Custom Parts:
1x Custom PCB - Here's the link to a shared PCBWay project that has the gerber files for the custom PCB for this part of the project. Note that PCBWay is my YouTube sponsor, and that on this page, you have the option to either download the gerber files yourself, or to place an order with a button directly on the page, which will give me a 10% kickback from your purchase - it really helps out my YouTube channel if you do that!
1x Custom 3D Printed Parts - In this Instructable, there are STL files for all of the 3D printed parts for the enclosure. Refer to the filenames for which files are relevant to each part of the project, and you will need one of each part that is marked to be for this piece of the project. One last thing, if you don't have a 3D printer, PCBWay has a 3D printing service that you can check out right here.
Supplies for the Remote Sensor with Screen:
Electronics:
1x Arduino Nano
1x NRF24L01
1x BME280
1x SSD1306 128x64 I2C OLED Display
1x 10uF 1206 Ceramic Capacitor
1x 2x5 Male Pin Header (two 1x5 headers next to each other will work as long as they're aligned)
1x Jumper
Hookup Wire (could also just cut the ends off of some DuPont cables)
Hardware:
2x M3 Locking Washer (only needed sometimes to help align the USB-C port)
4x M2x8 Screw - Depending on if you solder the Arduino Nano in a socket made of female headers or not, you may have to use 2 M2x8 and 2 M2x4 screws instead, as if the Arduino is socketed, shorter screws are needed in some spots to clear the USB port.
4x M2 Nut
Custom Parts:
1x Custom PCB - Here's the link to a shared PCBWay project that has the gerber files for the custom PCB for this part of the project. Note that PCBWay is my YouTube sponsor, and that on this page, you have the option to either download the gerber files yourself, or to place an order with a button directly on the page, which will give me a 10% kickback from your purchase - it really helps out my YouTube channel if you do that!
1x Custom 3D Printed Parts - In this Instructable, there are STL files for all of the 3D printed parts for the enclosure. Refer to the filenames for which files are relevant to each part of the project, and you will need one of each part that is marked to be for this piece of the project. One last thing, if you don't have a 3D printer, PCBWay has a 3D printing service that you can check out right here.
Downloads
Watch the Video!!
I made a YouTube video on this project, and most of you are probably coming from the YouTube video, so if that's you, you can skip this step. But, there are several people who come across these Instructables separate from the YouTube video, and if that's you, go ahead and give it a watch! It gives a good idea of the design philosophy behind this project, how it works, and what you'll be in for should you choose to build it.
Build the Base Station
The first step to building this system is to build the base station, because no matter what kind of configuration of remote sensors you're planning to run, you'll need one of these. So, gather the appropriate materials for this part of the project and let's get building!
Solder the Components to the PCB
The PCB for this project is, overall, not that complicated, which makes it a lot easier to describe when writing these instructions! Basically, solder the correct components in the correct spots, and that's it.
However, a couple really important notes are that you cannot solder the ESP32 in a socket made of female pin headers, as the added height from this will make the buttons on the front panel interfere with the ESP32's board, and therefore, nothing will fit properly (I learned this the hard way). Additionally, the NRF24 shouldn't be soldered in a female header socket either, as it tends to cause issues with transmissions at max power, and while this device shouldn't be transmitting much, I'd rather not take that risk (I also learned this the hard way, which will hopefully explain why some photos have the NRF24s in sockets - they're old photos, and the boards didn't work well like that).
Finally, if you're wondering where the singular female 1x4 pin header goes, and where the 2x5 pin header is in the materials list, the 1x4 female header is used as a socket for the BME280 temperature sensor, and the 2x5 pin header is actually not used in this design due to some minor oversight when choosing which GPIO pins to use on the ESP. However, I left it on the final PCB because I figured that knowing how awesome the community is, someone might be able to take advantage of the fact that it's basically a GPIO breakout and do something cool with it.
Schematics and board views provided as well in case they help you while assembling :)
Upload the Code to the ESP32
Before you forget to, make sure that you upload the code provided on this step to the ESP32, as once stuff is assembled, it's hard to get at the programming port. So, uploading now will help ensure you don't forget to and give yourself a bit of a chore to deal with later in terms of disassembling and reassmbling part of the construction.
Also, near the top of the code, search for a few comments, as these provide instructions on a few parameters you might be interested in changing, such as the sensor names, whether you want the system to display in Fahrenheit or Celsius, if you want to hide any unused sensor pages from the menus, and if you need to negatively offset the base station's local sensor by any amount.
Downloads
Solder Hookup Wire to USB-C Breakout
Next, solder two hookup wires to the VBUS and GND pins of your USB-C breakout board. these wires should be several inches in length, as it will make your job a whole lot easier in the next steps.
Thread Cables Through the Chassis and Mount USB-C Port
Grab the 3D print of "Base Station Body.stl" from the materials section, and now we're going to thread these two hookup wires through a small hole in the dividing wall between the main electronics chamber in this chassis, and the smaller chamber for the sensor.
Once these cables are threaded through, you can place the USB port in its correct mounting spot in the temperature sensor's chamber in the chassis and hot glue it into place. There are screw holes that accept M3x6 screws, however it's nearly impossible to actually screw them in, so I recommend just using glue here.
Solder USB-C Power Connections and Mount Main PCB
Next up, take the two hookup wires that are threaded through the chassis and solder them to the pads on the main PCB that are labeled "PWRIN". There should also be positive and negative labels in the silkscreen on the boards, and make sure that the wire connected to VBUS gets connected to positive and the wire connected to GND gets connected to negative.
Then, you can mount the main PCB to the chassis using five M3x12 socket head screws and the 3D print of "Base Station Base.stl". The PCB basically gets sandwiched in between these two 3D prints, and the screws just drive straight through the PCB into the main part of the chassis. If it's not making sense to you in words, check out the photo on this step that shows a cross section of the assembly.
To mount this easily, I recommend screwing the screws into the bottom piece just enough so that they barely stick out the other side, therefore allowing them to act as aligning pegs that hold the PCB in perfect alignment while the main chasiss is dropped on top and screwed into place.
Screw the Top Lid On
Now, the 3D print of "Base Station Lid.stl" can be screwed on to the back chamber of the base station, as we won't be needing to access either the USB-C port or the temperature sensor back there anymore. Use three M3x8 screws to attach this part.
Prep the OLED Panel
Now let's move on to assembling the front panel, but that involves ensuring that every component that will be mounted to it is ready. So, let's prep the SH1107 OLED display for this job!
The SH1107 display usually comes with some male pin headers already attached, however these have an issue, and that is that their solder joints stick out quite far on the front side of the display. This means that they could interfere with the front panel, or even short out on it if you had it CNC machined. So, I desoldered this header and soldered four DuPont wires to the display that were terminated with female ends, so that they could plug into the PCB. Definitely leave these wires decently long, maybe an inch longer than mine, as it will make it a lot easier to plug in the front panel when it comes time to mount it.
Mount the Buttons to the Front Panel
Next up, we'll mount the three push buttons to the front panel, and whether you had it 3D printed or CNC machined, these steps will all be the same. The push buttons come with their matching nuts to mount them, as well as some O-rings for water resistance, however the O-rings aren't necessary in this design, so I scrapped them. The only nuance with mounting these switches is that it will be best if you ensure all of their contacts line up to form a horizontal line rather than a vertical one, as this decreases the risk of a contact touching the ESP32.
Solder the Button Connections
Continuing with the buttons, it's time to solder all of their electrical connections properly. To do this, first connect one pin of each of the buttons together to form one large shared connection, and solder a DuPont wire with a female end to this connection. Then, the remaining three contacts on the buttons can each get another female DuPont wire soldered to them, so there should be a total of four DuPont wires coming off of the button assembly.
I would recommend using some heatshrink here, but I chose to be lazy and rely on the spacing/tolerances of the design to keep things from touching, but honestly I'd recommend just heatshrinking this stuff to be safe.
Mount the OLED Display to the Front Panel
Use four M2x8 socket head screws to mount the OLED display to the front panel, and make sure stuff is snug but not too tight, as if you tighten it too much, it risks damaging the OLED panel from too much pressure.
Plug in and Mount the Front Panel to the Chassis
Now we just have to plug in the wires from the OLED display and the buttons to the main board! Pay attention to the wiring carefully here, as it's easy to mess something up and while it might seem like everything will be in the right order out of the box, it's likely it won't be.
For the OLED, the pinout of the pin header on the custom PCB, in order of closest to ESP32 to furthest, is SDA, SCL, 3.3V, GND. Make sure this aligns with the same connections on the OLED.
Then, the buttons, in order from closest to ESP32 to furthest, is GND (this should be the shared connection), right button, middle button, and left button (these three should be the individual connections.
Once stuff is plugged in, use the four M3x12 countersunk screws to close up the panel, and your base station is done! Plug it into USB with a USB A to C cable and give it a test! Now, we can move on to making some remote sensors.
Build a Screenless Wireless Remote Sensor
Next are all of the steps to follow to build a wireless remote sensor that doesn't have a built-in screen to display its own data. These are great for tucking away in a place that you want to be able to monitor the temperature and humidity of, but that you probably won't ever need to check the temperature of while you actually at said place. For example, I built one of these for my use of this system and placed it on top of my server rack, so that I can get a nice temperature readout of the closet it's in.
Remember, this system can only work with 5 total sensors, so ensure that your total number of wireless remote sensors, both with screens and without, will not exceed 5. Other than that, you can have any combination of screened/screenless sensors, and you also don't HAVE to use 5 sensors, you can use fewer.
Assemble the PCB
Just like with the base station, the first step to build one of these sensors is to assemble the PCB. The assembly is practically identical to the base station's PCB assembly, with the 1x4 female pin header being used to socket the BME280, and the NRF24 having to be soldered directly to the PCB. However, for this build, socketing the Arduino Nano will have no consequence.
Schematics and PCB views provided in case they aid in your assembly :)
Upload the Code to the Arduino Nano
Upload the code to the Arduino Nano before you forget! As with the base station, the programming USB port isn't easily accessible after closing the project up, and therefore, you should upload the code now. On this step, the code is provided, and this code shouldn't need to be tweaked much at all, except for one section where you can add a negative offset to the sensor if you find that you need to. However, usually these remote sensors are spot on out of the gate, so it's unlikely you'll have to change this.
Downloads
Select Sensor Address
Use a single jumper to jump two pins on the "ADDRSEL" header on the PCB to select which address will be used by the sensor's NRF24 module to communicate with the base station. This address is directly tied to what sensor this will show up as on the base station, with address 1 directly corresponding to remote sensor 1 on the base station, and address 5 directly corresponding to remote sensor 5 on the base station.
Bridging the two pins closest to the Arduino will select Address 1, and as you move further from the arduino, you'll move through addresses 2, 3, 4, and eventually 5 (shown in photo). Ensure that you don't ever have more than one sensor box on each address, or you will run into some pretty serious issues. You also sadly cannot have one sensor transmit on two addresses.
Solder Power Leads to PCB
Take two hookup wires, ideally about 4 inches in length each, and solder them to the pads on the main PCB that are labeled "PWRIN". There should be polarity markers in the PCB's silkscreen, so that you can easily know which cable is positive and which is negative.
Mount the PCB to the Chassis
Now, you can use the 3D prints of "Sensor Station No Screen Base.stl" and "Sensor Station No Screen Body.stl" to secure the PCB with 3 M3x12 socket head screws. Just like with the base station, these two pieces of the case sandwich the PCB in their joint to hold it in place. And, in case words aren't doing the best job of explaining that, I've provided a cross-section view of how the PCB mounts for reference.
To assemble this, I recommend partially screwing in the three screws to the base plate, just far enough that they barely stick out the other side. These will then act as aligning pegs, which can hold the PCB in place while the main part of the chassis is dropped on top and screwed all the way in.
Mount the USB-C Port and Connect the Power Cables
Next up, we can mount the USB-C breakout to the 3D print of "Sensor Station No Screen Lid.stl" using two M3x6 socket head screws. Ideally, these screws should be all that's needed, but depending on how your print comes out, you may have to place some washers between the 3D print and the bottom of the breakout board's PCB to raise it off of the lid a little more. This is where the two locking washers quoted in the materials list come into play, as they're not too wide, and they're a nice thickness for this use case.
Once the USB port is mounted, go ahead and solder the two hookup wires you previously connected to the PCB to the breakout board, with positive going to VBUS and negative going to GND.
Close the Lid
Use four M3x8 socket head screws to close the lid of the basic remote sensor, and you're done! Yeah, a pretty simple build! And you can repeat these steps as many times as you want to build as many basic remote sensors as you're planning to use for this build. However, if you think you have a few locations where a sensor that both transmits wirelessly, but that also has a built-in readout on board, keep going for the instructions on how to build a remote sensor with a screen!
Build a Remote Sensor With a Screen
Here's the series of steps on how to build a remote sensor that has a built-in screen on it! The assembly of this sensor is very similar to the assembly of the simple remote sensor, so these steps will rely heavily on you referring to previous ones that were under the section on building a remote sensor without a screen. However, I will try to keep this section as clear as possible, just be prepared to do a bit of scrolling back and forth!
Prepare the OLED Display
The first part of the assembly for this sensor is to get the OLED display prepped and installed into the chassis, so let's go over how to prep it really fast. This is basically identical to how we prepped the OLED in the base station, in that you just need to solder 4 DuPont wires with female ends on to the OLED display, so that you're left with something that looks like what's in the photo.
Mount the OLED to the Chassis
Now, we can mount the OLED to the chassis with four M2 socket head screws and four M2 nuts. Now, the length of the M2 screws depends on whether or not you chose to socket the Arduino. If you did socket the Arduino with some female pin headers, the bottom two screws used to mount the OLED need to be M2x4 screws, and the top two can be whatever length, I found that M2x8 works well for being easy to thread the nuts on while not excessively long. However, if you didn't socket the Arduino, all four screws can be basically whatever length, again with my recommendation being M2x8.
Assemble the PCB
Next up, assemble the PCB just like you have to do with the screenless remote sensor. The only difference is that there's another 1x4 male pin header for the OLED display to plug into. The same things about ensuring that the NRF24 is not in a socket and ensuring that you use the 1x4 female header to socket the BME280 module apply here as well.
As with the other steps, schematics and board view are provided if they aid your assembly :)
Upload the Code to the Arduino Nano
This module of the project, like the others, blocks the programming port once assembled, so upload the code attached to this step now so you don't forget! This code has the same section to apply a negative temperature offset, however, it also has a boolean variable that you can change from false to true which dictates whether or not the screen displays in degrees fahrenheit or celsius.
Downloads
Select Sensor Address
This sensor uses the exact same system as the other kind of sensor to select its address, so refer to Step 17 in this Instructable for more details on this. But basically, use a jumper to jump two pins on the "ADDRSEL" header - jumping the two pins closest to the Arduino will set the address to 1 causing it to show up as remote sensor 1 on the base station, and the furthest pins will result in address 5 being selected as well as it showing up as remote sensor 5.
Solder Leads to PCB Power Input Terminals
Solder two hookup wires to the pads for the "PWRIN" connections on the main PCB. There should be polarity markers in the silkscreen. I recommend leaving these wires about 4 inches long, as it will make life easier in the next few steps.
Mount the PCB to the Main Chassis With the Base
Use the 3D prints of "Sensor Station With Screen Base.stl" and "Sensor Station With Screen Body.stl" to mount the PCB to the main assembly with 3 M3x12 socket head screws. A cross-section view is provided, and feel free to refer to Step 19 for more details on how to do this, as this part of the mounting system is identical across both remote sensor designs.
Mount the USB-C Breakout Board and Solder Power Connections
Use two M3x6 screws and possible some washers as spacers to mount the USB-C breakout board to the 3D print of "Sensor Station With Screen Lid.stl". Then, solder the positive PWRIN wire to VBUS on the breakout, and the negative lead to the GND pin on the breakout. Feel free to refer to Step 20 for better details on how exactly to do this, as again, this part is identical across both kinds of sensors.
Connect the OLED
There's one last thing to connect, and that is the OLED display. Here's the pinout of the header on the PCB, in order from closest pin to the Arduino to furthest pin from the Arduino: GND, 3.3V, SDA, SCL
Close the Lid
Use four M3x8 socket head screws to close the lid of the box, and voila, you're done with the last of the three different modules to the project! Let's move on now to an overview of the project as a whole, and talk a little about how it works.
You're Done! Here's How It Works:
Great work, you assembled all of the parts to the project! You have a base station, and some combination of remote sensors with/without screens that adds up to a total number of remote sensors that's either 5 or fewer. These sensors should all have different addresses selected with the hardware jumper, and all of the configuration in the code for the base station should be done at this point.
So, power everything up, and you should see a readout of the local temperature sensor on the base station, as well as readouts of the remote sensors if you press the left and right buttons to page through the different pages of temperature data. On each page, there's a temperature and humidity readout, which for the local sensor refreshes every quarter-second, and for the wireless sensors, it refreshes every 2.5 seconds. Then, below that, there's a small auto-ranging line graph, which shows the overall temperature trend over the past hour of that sensor's data. Above the graph, in small text, is a small readout of the range of the line graph, which indicates the lowest Y-value and the highest Y-Value on the graph's Y axis at any point in time, as this will change with the severity of the temperature change (larger range for bigger changes, to fit them on the graph, smaller range for smaller changes, so you can actually make out what the trend is).
Then, if you click the middle button on any sensor, it will bring up the full-size line graph for that sensor, which can be easy for viewing a trend in more detail. And yeah, that's it! It sure is pretty simple, but it works darn well, and I think it's pretty awesome. Thanks for checking out this Instructable, and if you made one of these for yourself, submit an "I Made It!", because I'd love to see what me community builds based on my projects.
Troubeshooting, Because Not Everything Goes Perfectly the First Time
As with all projects, things going awry is almost an expectation. Here are some basic troubleshooting steps to get you started!
Issue: Nothing is displayed on the screen (either base station or remote sensor with screen)
Troubleshooting step: There's a chance the I2C address of your screens is different than the address in the code that worked with my screens, so find the line where the display is initialized and change the I2C address to one that matches your screen. If you need to, look up a simple I2C scanner code and that can help you find the right address.
Issue: The data from a sensor isn't being received by the base station
Troubleshooting step: Ensure that the sensor is set to the right address. If it is, and things are still not working, ensure that no other sensors are set to the address this sensor is set to. Apart from that, try decreasing the range between the sensor and the base station and see if that improves anything.
Issue: The temperature readout on one of the sensors is too high
Troubleshooting step: Find another sensor that's more accurate and figure out how far off the inaccurate sensor is. Once figured out, enter this value in degrees celsius into the sensorOffset variable, which will be in the code for the remote sensor or the code for the base station, depending on which sensor you intend to affect.
Issue: I added a new sensor, but its sensor page isn't showing up on the base station OR I want to remove a sensor page that I'm not using from showing up on the base station
Troubleshooting step/solution: edit the base station code, there is a variable that is marked with some comments that allows you to show/hide certain sensor pages from being displayed.