-->
Notification texts go here Contact Us pelacakan

Classic Style Arduino Weather Station with three Oled Displays


Classic Style Arduino Weather Station with three Oled Displays

Project description : 

So far I have made several weather stations that display local values as well as internet data, which you can view on my $ playlist $ 


This time I will present you a way of making a very interesting desktop weather station that displays the values of the three basic weather parameters, Atmospheric Pressure, Air Humidity, and Temperature on three separate Oled Displays. The idea is to resemble a classic retro weather station that has three separate instruments, one for each parameter.

This is a very simple, visually effective, but also very useful device that accurately displays the three basic meteorological parameters using only one inexpensive sensor.

Components and supplies :

SSD1306 OLED Display

BME280/BMP280

I2C Hub 1 to 6 Expansion TCA9548A Module

Arduino Nano

- On the back there is a power input connector, a switch as well as a BME280 sensor module 

- Arduino Nano Microcontroller 

- Three SSD1306 OLED displays with I2C communication 

- and TCA9548a multiplexer module 


Schematic :

code arduino :

#include <Wire.h>

#include <Adafruit_Sensor.h>

#include <Adafruit_BME280.h>

#include <Adafruit_SSD1306.h>


Adafruit_SSD1306 display(128, 64, &Wire, 4);

Adafruit_BME280 bme;

int temp, hum, pressure;


void TCA9548A(uint8_t bus)

{

  Wire.beginTransmission(0x70);

  Wire.write(1 << bus);

  Wire.endTransmission();

}


void setup()

{

  TCA9548A(1);

  bme.begin(0x76, &Wire);

    

  TCA9548A(2);

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

  display.clearDisplay();

  display.setTextSize(4);

  display.setTextColor(WHITE);

  display.setCursor(18,20);

  display.println("HUM.");// Print text

  display.display();


  TCA9548A(3);

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

  display.clearDisplay();

  display.setTextSize(4);

  display.setTextColor(WHITE);

  display.setCursor(10,20);

  display.println("PRES");// Print text

  display.display();

  

  TCA9548A(4);

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

  display.clearDisplay();

  display.setTextSize(4);

  display.setTextColor(WHITE);

  display.setCursor(10,20);

  display.println("TEMP.");// Print text

  display.display();

  delay(5000);

 

}


void loop()

{

  TCA9548A(1);

  temp = bme.readTemperature();

  hum = bme.readHumidity();

  pressure = bme.seaLevelForAltitude(700.0, bme.readPressure())/100.0;


  TCA9548A(2);

  display.setTextColor(WHITE); display.clearDisplay();

  display.setTextSize(2); display.setCursor(0,0); display.print("Humidity %");

  display.setTextSize(4); display.setCursor(45,30);

  display.print(hum);

  display.display();


  TCA9548A(3);

  display.setTextColor(WHITE); display.clearDisplay();

  display.setTextSize(2); display.setCursor(5,0); display.print("Press. hPa");

  display.setTextSize(4); display.setCursor(15,30);

  display.print(pressure);

  display.display();

  

  TCA9548A(4);

  display.setTextColor(WHITE); display.clearDisplay();

  display.setTextSize(2); display.setCursor(30,0); display.print("Temp C");

  display.setTextSize(4); display.setCursor(45,30);

  display.print(temp);

  display.display();

  

  delay(1000);

}

إرسال تعليق

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.