Show Temperate and Humidity on an OLED screen 128x64 pi


Show Temperate and  Umidity on an OLED screen 128x64 pi

LCD Screen

Show Temperate and  Umidity on an OLED screen 128x64 pi




Living on an island I'm used to a fairly high humidity rate, especially in summer, the evening is almost unbearable.
I was curious to know how much moisture saturation (%) was in my house, then in the future logging data on an SD card to compare the data with the dehumidifier switched on and not ..... but we will talk about this later on!

Today we talk about how to display data on an OLED screen of the smallest size of just 0.96 "

Let's Prepare the Soup



What you need:



Arduino + LCD Screen + DHT11


Wiring Up


Now let's connect the modules with our Arduino Nano.
Having Male Pin on Arduino and Modules I do not need a Breadboard as the links will be direct.
If in your case it is different adapt accordingly.


Let's connect as following:

  • Arduino 3.3V  --- OLED Vcc
  • Arduino GND --- OLED GND
  • Arduino A4  --- OLED SDA
  • Arduino A5  --- OLED SCL
  • Arduino D2  --- DHT11 Data 
  • Arduino 5V  --- DHT Vcc
  • Arduino GND --- DHT11 GND

Or grafically better shown below:


Arduino + LCD Screen + DHT11 wiring

The OLED screen is usually powered at 5V but for comfort in this circuit I'll feed it with 3.3V as it does not compromises the brightness of the screen.




This is mine once connected:



Arduino + LCD Screen + DHT11 final




Coding Time!



The code is very simple, OLED uses the Adafruit SSD1306 library while I had an old DHT11 bought on Amazon from an Elegoo kit I use their SimpleDHT library (the zip file comes from my google drive).

To you the code:






In the dataShow () function we only set the size, color then show the temperature and humidity with the display.print () function with update set every second.


For the rest there is not much to say except to build a nice container, to add some more sensors, and to play with other features in the examples of the Adafruit library.




The end result is a cute and tiny tool that can be installed with a battery in a small box to keep in the desk!




Arduino + LCD Screen + DHT11 powered





I hope You enjoyed the Tutorial,  leave some comments if you find something wrong or improve it! 


And Dont Forget To Subscribe!😇




A noob like me



Comments

Potrebbe interessarti anche:

Use a Telegram Bot to receive data from a Thingspeak channel