Peg Box with Temperature and Humidity Monitor using NodeMCU
In my last tutorial I created a Weather Station using Arduino and NodeMCU using DHT11 or DHT22 temperature and humidity sensor and displayed it using an OLED Display. In this tutorial, I am going create a Peg-Box using the same board but with a little bit of twist. In this setup, I am going to send the Temperature and Humidity readings to my Raspberry Pi based home server and store it in a MySQL database. The data can then be viewed using PHP and Google Charts, on a Mobile Phone or a PC connected to the home network.
Circuit Diagram
The setup is very simple. The temperature and humidity sensor sends the collected data to the NodeMCU on pin D3. NodeMCU then sends the data over WiFi to the Raspberry Pi, which is then saved in the MySQL database.
The Yellow LED, which is the status indicator flashes every second and is connected to D6 pin of the NodeMCU. The Blue LED connected to pin D5, lights up when NodeMCU sends the temperature and humidity readings to the database.
If you are planning to install this box somewhere inside the house, then you can also add an OLED display and display the readings on it.
The Board
So, this is how my board looks like in 2d and 3d.
There are 3 breakout boards in this 100cm x 100cm assembly. Each board can be used with either Arduino or NodeMCU and DHT11 or DHT22 sensor or sensor module.
Temperature and humidity readings can be collected using either a DHT11 or DHT22 Module or by using one of these sensors with a 10K resistor.
The bottom section of the board is for the OLED display. The attached gerber is bit different from what you see on screen. I made some modifications in the final version and moved the sensors a bit far from the microcontrollers.
Component Assembly
Lets start by soldering the female pin-headers to the board. The pin-headers will house the NodeMCU in it.
Next, lets soldered few more pin-headers for the LEDs, DHT11 sensor and the OLED display.
Before installing the circuit in the peg-box, lets hook up the OLED Display and make sure everything works as expected. Boom, nailed it.
The Code
The code starts by including all the libraries and by defining all the constants and variables that will be used throughout the program.
Then there are two functions SendIamAlive() and SendTemperatureAndHumidity() which sends heartbeat and the data read from the temperature sensor to the database server.
The ReadDHTSensor() function reads the data from the DHT11 or DHT22 sensor.
In the setup section we first setup the WiFi and then send a SendIamAlive() message to the server advising that it is back up and running. Then in the loop section the microcontroller send a heartbeat every minute using the SendIamAlive() function and if the time elapses it sends the humidity and temperature data using the SendTemperatureAndHumidity() function.
The White LED flashes every seconds and the Blue LED turns on when the device sends the temperature and humidity data to the database server.
MySQL
So,the data sent by the NodeMCU over WiFi is saved in the MySQL database hosted on a RaspberryPi 4.
Here you can see, the microcontroller sends the data every 30 minutes (you can change the frequency) which is then saved in the MySQL database. The data saved on the Pi's MySQL database can then be used to generate various different types of graphs either by using google charts or any other 3rd party application. It totally depends on you how you want to present it.
3D Design
Now, lets look at the design of the peg-box. Using freely available pallet planks, I designed the body of the box.
The pallet planks I am using are 160cm x 9cm x 2cm (length, width and thickness). So, the rest of the measurements will be based on that.
The top bit of the peg-box will house the microcontroller and the sensors in it. Putting it on the top prevents the electronics from adverse climatic conditions.
The back bit will stick to wall and hence we don't need to cover it up.
You can either put the pegs straight in the front bin or throw it to the top bit, from where it will slide down to the front bin.
The sliding design with an opening in the front will prevent rainwater from accumulating inside the bin. This mechanism will keep the bin dry throughout the year.
Woodworking
Using 2 hammers I am dismantling the pallet. My aim is to reuse all the nails used in building this pallet so that, I can use them in building my project. After that, I sanded the pallet planks to give them a nice and smooth texture.
Then using a chop-saw or a hand-saw I extracted all the pieces of wood required for building this project.
As mentioned earlier, my pallet plank are 9cm wide and hence, all the onscreen measurements are based on that.
Final Assembly
Using wood-glue I am joining all pallet planks used in making the box.
I got a bit too excited and accidentally deleted one of my recordings. So, I am using 3D animation to show you guys how I joined the two sides of the box.
I used a plywood board to created the base of the bin.
I glued few cylindrical wooden sticks on the roof of the box. To be very frank these sticks changed the entire outlook of the peg-box.
Coloring
Since my aim is to install the peg-box outside the house, I have to make sure that I apply multiple coats of paint on the box to avoid the pallet wood from rotting. I applied 3 coats of paint on the entire setup and insulated all the holes that I found using wood putty.
So, this is how it looks like. The electronics bit will stay hidden under the roof of the box. Ha ha, Don't worry, I will obviously insulate them and make them weather-proof before installing them on the wall.
Installation
Now the next thing you need to do is to find a spot where you want to install this unit.
I am installing this near my clothesline, however you may want to install it in your pantry or behind a door or something like that. It totally depends on how much space you have and where you want to install it.
I am using metal frame hangers to hang this on the wall.
Place the unit against the wall, and using a pencil mark the points where you want to drilling the holes.
Now, using a hammer drill, drill the holes in the wall.
Then, put the wall plugs in the wall and then use a screw driver to install the screws.
Alright so, that's it. This unit is now all set to hold all my pegs in it.
Demo
So, this how my final setup looks like. Do comment and let me know if there are any scopes of improvement.
Thanks
Thanks again for checking my post. I hope it helps you.
If you want to support me subscribe to my YouTube Channel: https://www.youtube.com/user/tarantula3
Blog Posts:
1. Peg Box : https://diyfactory007.blogspot.com/2022/03/PegBoxv1.0.1.html
2. DHT11 & DHT22: https://diyfactory007.blogspot.com/2021/09/temperature-and-humidity-monitor-using.html
3. OLED Tutorial: https://diyfactory007.blogspot.com/2018/07/oled-i2c-display-arduinonodemcu-tutorial.html
Video references:
1. Peg Box : https://youtu.be/elH331NXPsU
2. DHT11 & DHT22: https://www.youtube.com/watch?v=w5tBtHsl7b4
3. OLED Tutorial: https://www.youtube.com/watch?v=_e_0HJY0uIo
Resources:
Gerber: https://drive.google.com/file/d/1H9noO2ppm0SM8HcJg1NWE2uTUJKw9SXH/view?usp=sharing
Schema: https://drive.google.com/file/d/1tWCxXBw3vzssVm6FtZDRI8ZIPCtmXp1t/view?usp=sharing
3D Model: https://drive.google.com/file/d/1QHejBBG78PG6q8ncP_xzElAXyKNA1G8h/view?usp=sharing
Code:
Code (Arduino + PHP + MySQL DB) : https://drive.google.com/file/d/1ji5TEvLbhe3GJiDgQRowDws5PdZZXqf9/view?usp=sharing
Code_With_OLED_Arduino : https://drive.google.com/file/d/1EEdhPuUiy8xWSD_s41iYAccTz8w-QF9C/view?usp=sharing
Code_With_OLED_NodeMCU : https://drive.google.com/file/d/1WFtdyu90gAqxhJq-Pur7w8fvXuuM85lt/view?usp=sharing
Code_With_PHP_NodeMCU : https://drive.google.com/file/d/1bT08x-h39NS1LdkCCH2F3ySG3hrht9U4/view?usp=sharing
Libraries:
DHTStable.h : https://github.com/RobTillaart/DHTstable
SSD1306.h : https://github.com/squix78/esp8266-oled-ssd1306
Adafruit display library: https://github.com/adafruit/Adafruit_SSD1306
Adafruit GFX library: https://github.com/adafruit/Adafruit-GFX-Library
Support My Work:
BTC: 1M1PdxVxSTPLoMK91XnvEPksVuAa4J4dDp
LTC: MQFkVkWimYngMwp5SMuSbMP4ADStjysstm
DOGE: DDe7Fws24zf7acZevoT8uERnmisiHwR5st
ETH: 0x939aa4e13ecb4b46663c8017986abc0d204cde60
BAT: 0x939aa4e13ecb4b46663c8017986abc0d204cde60
LBC: bZ8ANEJFsd2MNFfpoxBhtFNPboh7PmD7M2
Thanks, ca again in my next tutorial.
Peg Box with Temperature and Humidity Monitor using NodeMCU
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(2)
- Engineer Jun 16,2022
- Ashish Adhikari Mar 20,2022
- 1 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
10design
-
10usability
-
10creativity
-
10content
More by Ashish Adhikari
- Cute Medusa 3D Printed Humidifier Humidifiers add moisture to the air. They can help people with dry skin, allergies, and respiratory ...
- 4x4x4 PCB LED CUBE Note from PCBWay: This project includes two PCBs, if both need to be produced, please inform your sa...
- Getting Started With Raspberry Pi Pico Couple of months ago, I bought a "Raspberry Pi Pico" to get some hands-on experience of it and to cr...
- Destiny Internet Ghost - Internet Notifier The Internet has changed the way we live our lives. From communication, education, banking, entertai...
- Liquid level indicator Using ULN2003 A water level indicator detects and indicates the level of water in an overhead tank and relays the ...
- All About IC UNL2003 The UNL2003 IC contains 7 High Voltage, High Current NPN Darlington Transistor Arrays each rated at ...
- NodeMCU Based: 3D Printed Indoor Gauge Thermometer Had some time this weekend and a desire to create something new and interesting, so went ahead and c...
- Rechargeable Gothic Lantern A Gothic Lantern is a captivating piece of lighting that brings the allure of the Victorian Era into...
- 555 Adjustable Delay On Off Timer Circuit The 555 timer IC is an integrated circuit (IC) that is used in a variety of timer, delay, pulse gene...
- 3D Printed Arduino Halloween Décor When the full moon is shining and the wolves are howling, it's time for Halloween's spooky spectacle...
- All About RCWL-0516 Microwave Radar Motion Sensor Proximity sensing is a very common application in electronics.There are several ways to accomplish t...
- Transformers PCB BADGE It's been a while, the Autobots have appeared on the silver screen. Finally they are returning to th...
- LED Fader Using 555 Timer IC LED Fader Using 555 Timer ICWanted to generate a LED fading effect (fade-in and fade-out) for my upc...
- Arduino Based Concrete Clock With Touchless Night Lamp When you mix creativity with electronics, it becomes a masterpiece.Producing something original and ...
- DIY - PCB Christmas Forest Created a small "PCB Christmas Forest" which is going to light up my study table this Christmas.In t...
- PCB Christmas Forest A small Christmas Village For Someone You Love
- TM1637 Digit Display with Arduino IntroIn my hand is a 4-Digit 7-Segment display module.The heart of this module is an inexpensive Ser...
- IR Remote Tester and Decoder IntroWhat do you generally do when your remote controls starts playing up?Do you generally use a mul...
-
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
124 0 0 -
DIY Laser Power Meter with Arduino
173 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
163 0 2 -