Wireless Temperature and Humidity Monitoring System
by CHWTT in Circuits > Gadgets
105 Views, 2 Favorites, 0 Comments
Wireless Temperature and Humidity Monitoring System
Hello there and welcome to my Instructable. In this tutorial, I'll show you how I built a little system for monitoring the temperature and humidity at my desk and in my homelab server closet.
Supplies
There are two parts to this project, a "base station" which displays the temperature data of the temperature sensor that's inside the base station, as well as the data from the sensor that's located in the second part of the project, the wireless sensor station.
Along with the materials/3D files/PCB files that I'll provide here, I'll also give the two different schematics, as well as some views of the PCB from within Fusion 360 so that you can have those as reference materials while building it.
Base Station Materials:
Keyboard Switches - You can choose pretty much any standard keyboard switch here, and we only need three.
M2 Screws - Only need 4 M2x8 screws and 4 M2 nuts
M3 Screws - Only need 2 M3x8 screws and 3 M3x6
Custom PCB - I got my custom PCBs for this project from PCBWay (my YouTube sponsor), and you can find the files for them on their website at this link.
3D Printed Case - I 3D printed the case for this project on my own 3D printers, but if you don't have one, you can take the STL files that I provide and have PCBWay 3D print them for you. There are also some 3D printed button caps for the buttons on this unit that you can have printed as well.
Remote Sensor Materials:
M3 Screws - Only need 2 M3x8 screws and 3 M3x6
Custom PCB - I got my custom PCBs for this project from PCBWay (my YouTube sponsor), and you can find the files for them on their website at this link.
3D Printed Case - I 3D printed the case for this project on my own 3D printers, but if you don't have one, you can take the STL files that I provide and have PCBWay 3D print them for you.
Watch the Video!
Watch the video I made on this project to get an idea of how it works and the assembly process.
Load the Code Onto the Microcontrollers
These files are C++ files (.cpp), just open them with notepad and copy/paste the code into the Arduino IDE. The microcontrollers are hard to access once the project is assembled so we're going to put the code onto them now.
The code labeled "Base Station" is the code for the ESP32, and the code for the Arduino Nano is labeled "Remote Sensor". Make sure you install any libraries or boards if you don't have the ones used in these programs already installed. Also, there are some lines at the tops of the programs that you should take a look at if you want to change certain parameters.
Solder Some Components to the PCBs
The first step to assembling this project is to solder the microcontrollers, SMD capacitors, NRF24 modules, and the BME280 sensors to the two PCBs. Make sure to solder the SMD capacitor on before the NRF24 module, otherwise you'll block your access to the pads for the capacitor with the NRF24. If you have them on hand, I recommend using some female headers to connect the microcontrollers and BME280 sensors to the board so that they can be plugged in and out throughout the assembly process. Also, one final note, I forgot to mark on the PCB where the USB port of the ESP32 should be oriented so that you can make sure you're installing it the right way around, but you can see here that the USB port is on the same side of the board as the BME280.
For the remote sensor board, I'd also recommend soldering some wires to the PWR IN connections on the board now, so that these can be soldered to the USB port's power later. Make sure to mark which one is positive and which one is negative, and you can determine this by looking at which pad is connected to the copper GND plane (But I'll also just tell you that the negative terminal/GND terminal is the one closer to the silkscreen text that says "Designed by CHWTT").
Assemble the Remote Sensor
Now we're going to finish the assembly of the remote sensor box, as its the simpler of the two parts of this project.
Screw the USB-c Port Into the Chassis
Screw the USB-C port into the chassis with two M3x6 screws. This part is quite tricky, but it is doable, so give it a good shot. If you find that you really can't get the screws in, you can always hot glue the port in.
Mount the PCB in the Chassis and Connect Power
Place the PCB into the chassis and screw it in with an M3x6 screw. I put three M3 screw holes in the design, but really only a single screw is needed to hold the board sufficiently in place, and so I've only installed it with a single screw, and you can too.
Then, take the two wires that were soldered to the PWR IN header when we soldered some components to the boards and connect the positive wire to VBUS on the USB breakout board, and the negative wire to GND on the breakout board.
Close Up the Remote Sensor Box
Finally, we can screw the 3D printed lid on to the sensor box with two M3x8 screws. Now this part of the project is done! We'll obviously be able to fully test it only once the base station is complete enough to receive and display data, but for now, if you want, you can plug in a USB A to C cable (I sadly don't think this will properly work with a native USB C power supply due to the USB C power protocols), and make sure that the light on the Arduino Nano lights up.
Build the Base Station Box
Now we're going to build the other half of this project, the base station. This build process is much more involved, and requires some pretty fiddly things, so be prepared to spend a bit more time on this one than the remote sensor box.
Solder Wires to the Keyboard Switches
Solder some roughly 3-4 inch (7-10 cm) long wires to the pins on each of the three keyboard switches. I'd recommend color coding these wires to make your life easier when you need to connect everything up, and the code that I followed was really simple. I just had the GND connection for all of the buttons as black, and then each of the three buttons got a different color for its signal connection.
Also, I'd recommend using either some hot glue, electrical tape, or heat shrink tubing to keep these contacts from shorting out on anything.
Solder Wires to the PCB
Now we can solder some wires to the headers on the PCB for the OLED display, the buttons, and the USB-C breakout.
OLED Display Wires - I used some female-female standard jumper wires that I cut in half, and I soldered the cut end into the PCB. This made it really easy to connect the OLED display when everything was put together, but if you don't want to do this, you can just use some of the regular 22AWG stranded wire I quoted in the materials list. Also, do whatever works for you to keep track of what pin each wire should connect to so that you don't connect the OLED wrong.
Button Wires - These are pretty simple thankfully. When looking at the PCB with the "Buttons" header facing you, the leftmost pad is the GND connection. Then, the pad just to the right of that is the signal connection for the leftmost button. Move over to the right one more, and that's the middle button's signal wire. Finally, the rightmost pad is the signal connection for the rightmost button, and if you're color coding the wiring, you can keep track of this to make sure you hook the buttons up in the right order.
USB-C Port Wires - Just like with the remote box, reference the schematics/PCB diagrams to figure out which connection is connected to the GND plane. This one connects to the GND connection on the USB-C header, and the other connection on this header connects to the VBUS connection, but for now we're just connecting the wires to the board.
Mount the PCB and the USB-C Port
Mount the main PCB into the bottom of the chassis, with the "Buttons" and "OLED" headers towards the side of the chassis where the keyboard switches will be located. You can use either one or two M3x6 screws to secure the PCB.
Then, the mounting for the USB-C port in this chassis is identical to the mounting in the remote sensor box. Use either the two M3x6 screws that are intended or do what I did this time and take the easy way out with some hot glue. Just make sure you're able to make the VBUS and GND connections. Speaking of those connections, go ahead and solder them now.
Mount the Buttons and the OLED Display
The keyboard switches should just click right into place into the chassis. I recommend orienting them so that the wires are closer to the bottom of the chassis, rather than putting them in upside down with the wires/contacts closer to the top of the chassis. Note, if you've color coded the wires on your buttons, make sure that the button on the far left has the same color wire coming out of it as its corresponding pad on the PCB (See step 10 for more details)
Then, mounting the OLED is probably the hardest part of this whole project. With the help of 4 M2x8 screws and their matching nuts though, it should be doable, though you will need some patience and tweezers to get the bottom two nuts on.
Hook Everything Up
Finally, you can hook up all of the wires inside this box. If you did the USB-C port's connections earlier, you shouldn't need to worry about them now, but if they haven't been done those should be made at this time.
Then, for the buttons, if you color coded well, you should be able to just connect all the GND wires together and then make the signal connections for each of the three buttons. Use some electrical tape or small heat shrink tubing to isolate these connections.
As for the OLED, ensure that you get the VCC, GND, SDA, and SCL connections in the right order, and beyond that, the connections should be done.
Close Up the Base Station
Install the base station's lid with two M3x8 screws and then pop on three of the little button caps for the keyboard switches. Now you're done!