|
Arduino Nano IoT 33Arduino
|
x 1 | |
|
NodeMCU-32S Lua WiFi IoT Development Board |
x 1 | |
|
DHT11 Temperature and Relative Humidity Sensor Module |
x 1 |
Weather Station Using Arduino and NodeMCU
In this tutorial I am going to show you guys how to make an Arduino or NodeMCU based Weather Station using DHT11 or DHT22 temperature and humidity sensor and display it using an OLED Display.
DHT11 vs DHT22
The DHT11 and DHT22 are both low-cost very basic and slow temperature and humidity sensors which can be used for basic data logging.
Despite being slower, they are very stable and consumes low power and provides relatively high measurement accuracy. The single-bus digital signal is output through a built-in ADC which is easy to read using any microcontroller. Single bus interface saves the I/O resources of any microcontroller board.
The operating voltage is between 3.3V to 5V and the sampling period for DHT11 is 1Hz or one reading every second and for DHT22 is 0.5Hz or one reading every two seconds. Hence, you can not query them more than once every second or two.
The DHT sensors are made of two parts, a capacitive humidity sensor and a Negative Temperature Coefficient or NTC temperature sensor (or thermistor).
The NTC temperature sensor is actually a variable resistor whose resistance decreases with increase in the temperature.
For measuring humidity, two electrodes with a moisture holding substrate between them is used. When the humidity changes, the conductivity of the substrate changes or in other words the resistance between these electrodes changes. This change in resistance is measured and processed and is sent to the microcontroller.
A very basic chip inside the sensor does the analog to digital conversion and spits out a digital signal which is read using a microcontroller.
Here is a comparison chart of the two sensors. Looking at this it is very clear that DHT22 outshines the DHT11 in every aspect.
However, if accuracy is your concern, and you are ready to pay a bit higher price, go for DHT22. Otherwise, DHT11 should be good enough for you.
OLED Display
OLED or organic light-emitting diode is a light-emitting diode (LED) in which the emissive electroluminescent layer is a film of organic compound (millions of small LED lights) that emits light in response to an electric current.
OLEDs are used to create digital displays in devices such as television screens, computer monitors, portable systems such as mobile phones, hand-held game consoles and PDAs. An OLED display works without a backlight because it emits visible light.
There are many types of OLED displays available in the market based on their:
Sizes
Color
Brands
Protocol
SPI (Serial Peripheral Interface) or I2C
Passive-matrix (PMOLED) or active-matrix (AMOLED) control scheme
To know more about OLED Display and to know how to connect multiple OLED Displays using TCA9548 multiplexer check out my tutorial number 7
OLED Display with Arduino and NodeMCU link is in the description below: https://www.youtube.com/watch?v=_e_0HJY0uIo
Lets have a closer at these two displays.
At the back of these displays there are heaps of SMD capacitors and resistors soldered on-board; but, since its an I2C device we only care about these 2 pins (SCL and SDA)
The display connects to Arduino using only four wires – two for power (VCC and GND) and two for data (serial clock SCL and serial data SDA), making the wiring very simple. The data connection is I2C (I2C, IIC or Inter-Integrated Circuit) and this interface is also called TWI (Two Wire Interface).
The on-board pins can be in different order, so always triple check before hooking it up to your project.
Operating voltage is between 3v to 5v but, it is best to use the guidance from the manufacturer's datasheet.
Sometimes we need to use 2 displays in our projects. So, how can we achieve this?
The trick is to have a configurable address on your display. This unit has a configurable address between 0x78 and 0x7A. Just by unsoldering the 0Ohm resistor from one side and hoking it up to the other side or just by putting a global solder we can change the address.
In picture these displays look very big. But, practically speaking they are tiny. They are made of 128 x 32/64 individual OLED pixels and do not require any back-light. Just have a look at this and see how small it is. Even though they are small they can be very useful in any electronic projects.
This is how an OLED Display is connected to either Arduino or NodeMCU.
Setup Using Arduino
The setup using either Arduino or NodeMCU is very simple.
We just need to connect the OLED to the I2C Pins and the Temperature and Humidity sensor to any one of the Digital pins.
In this setup I have connected the OLED to A5 and A4 and the Sensor to D8.
Now, lets look at the code. Lets start by including the DHT and OLED libraries.
Then, in the setup section we initialize the display and then in the loop section we loop through every 2 seconds and read the sensor and display the result on the OLED display.
Here is a quick demo using Arduino.
Setup Using NodeMCU
Same as the previous setup, the OLED display connects to the NodeMCU using D2 and D1 pins and the Sensor connects to the D3 pin.
The code starts by including the DHT and OLED libraries.
Then, in the setup section we initialize the display and then in the loop section we loop through every 2 seconds and read the sensor and display the result on the OLED display.
So, this is how the actual setup looks like.
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.
The Board can be used with either NodeMCU or Arduino Nano.
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.
Soldering
Since I care a lot about my Sensors and Microcontrollers I am not soldering them directly to the board. Instead I am soldering, female pin headers to the board which will house all the sensors and microcontrollers.
Just for the sake of this video I am soldering female pin headers on both sides for Arduino and NodeMCU. However, In your setup you will need either Arduino or NodeMCU.
Final Demo
Lets first test this with an Arduino.
Now, lets test this setup using a NodeMCU board.
Looks perfect, I am going to use this board in my next project where I will be sending Temperature and Humidity readings to my Raspberry Pi based home server where I will be storing it in a MySQL database, so stay tuned....
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. DHT11 & DHT22: https://diyfactory007.blogspot.com/2021/09/temperature-and-humidity-monitor-using.html
2. OLED Tutorial: https://diyfactory007.blogspot.com/2018/07/oled-i2c-display-arduinonodemcu-tutorial.html
Video references:
1. DHT11 & DHT22: https://youtu.be/w5tBtHsl7b4
2. OLED Tutorial: https://www.youtube.com/watch?v=_e_0HJY0uIo
Gerber: https://drive.google.com/file/d/1H9noO2ppm0SM8HcJg1NWE2uTUJKw9SXH/view?usp=sharing
Schema: https://drive.google.com/file/d/1tWCxXBw3vzssVm6FtZDRI8ZIPCtmXp1t/view?usp=sharing
Code:
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
Code_With_PHP_OLED_NodeMCU: https://drive.google.com/file/d/1ji5TEvLbhe3GJiDgQRowDws5PdZZXqf9/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.
Weather Station Using Arduino and 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(4)
- Engineer Jul 09,2023
- Engineer Jun 16,2022
- John John Vu Sep 26,2021
- Ashish Adhikari Sep 25,2021
- 0 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
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...
-
-
Helium IoT Network Sensor Development board | H2S-Dev V1.2
116 0 0 -
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
181 1 1