Hello friends,
Today we will be learning how to make a simple weather station using an OLED display module and Temperature and Humidity sensor. I will be using a 0.96" OLED display module that features 128 x 64 pixels and uses the SPI bus.
Before we start, lets get familiar with the OLED display.
In the image above, you can see seven pins on the module, which are:
- GND - Ground
- VCC - Power Input (5V in this case)
- D0 - Acts as clock pin
- D1 - Data pin for the module
- RES - Reset
- DC - Data Command
- CS - Chip select (Useful when more than one module is used under SPI protocol)
You will also need some essential libraries installed on your Arduino IDE. The libraries are:
- DHT sensor library by Adafruit (You will need this for your DHT11)
- U8glib by Oliver ( I found this library more convenient than the Adafruit SSD1306 by Adafruit)
Here is the user reference manual for the U8glib if you are unfamiliar with this library:
- DHT sensor library by Adafruit (You will need this for your DHT11)
- U8glib by Oliver ( I found this library more convenient than the Adafruit SSD1306 by Adafruit)
Here is the user reference manual for the U8glib if you are unfamiliar with this library:
Supplies
- Arduino Uno/ Nano
- Type A/B cable (for Arduino Uno)
- Solderless Breadboard
- OLED display module - 0.96"
- Temperature and Humidity sensor (DHT11)
- LEDs (x2) - Blue and Red
- Resistor (x2) - 220Ω
- Male-to-male Jumper wires (x22) - 10cm
- Female-to-male Jumper wire - 20cm
- 3 pin female-to-female jumper wires (x3) - 70cm
I have used the 70cm jumper wires to make the setup look neat and prevent messy wires.
Setup
Your hardware setup must look somewhat similar to this.
Connections
DHT 11
- DHT11 - D7
- (+) of DHT11 - 5V
- (-) of DHT11 - GND (Ground)
OLED Display Module
- GND - Ground
- VCC - 5V
- D0 - D10
- D1 - D9
- RES - D13
- DC - D11
- CS - D12
Coding
If you are unsure where to start, install the Adafruit SSD1306 library and in the examples menu, you can find ssd1306_128x64_spi file. Open and upload it to your Arduino Uno, while your OLED display module is connected, to see how the code works.
You must learn how to print statements, shapes and images in your OLED display module. I would recommend the Adafruit GFX library as it comes with many functions that make drawing shapes such as circles, rectangles, triangles, etc. really easy.
- GND - Ground
- VCC - 5V
- D0 - D10
- D1 - D9
- RES - D13
- DC - D11
- CS - D12
Coding
If you are unsure where to start, install the Adafruit SSD1306 library and in the examples menu, you can find ssd1306_128x64_spi file. Open and upload it to your Arduino Uno, while your OLED display module is connected, to see how the code works.
You must learn how to print statements, shapes and images in your OLED display module. I would recommend the Adafruit GFX library as it comes with many functions that make drawing shapes such as circles, rectangles, triangles, etc. really easy.
Comments
Post a Comment