header.html

eulenbit.net

Technik, Computer, Linux, Open Source

Benutzer-Werkzeuge

Webseiten-Werkzeuge


user:wellenschrat:projekte:wetterstation:w1

Arduino-"Wetterstation"

Artikel in Bearbeitung

Status: Wetterstation ist derzeit im internen Netzs und die daten sind dort per Computer abzulesen und auch auf dem Display sichtbar. Die Reduktion auf Normalnull mittels Umstellung der Höhenformel ist auch implementiert. Es muss noch ein Gehäuse gefunden werden und die Ladetechnik mit Akku.
Als Board wurde ein Wemos D1 Mini gewählt, weil das WiFi kann. Ausserdem soll das erweitert werden zum SQM. Da muss allerdings noch ein Display mit roter Schrift gefunden werden.

Mit dieser kleinen „Wetterstation“ hat man Temperatur, Luftfeuchtigkeit und Luftdruck immer im Blick. Gedacht ist sie natürlich für den Innenbereich, also die Wohnung etc. Wenn diese Wetterstation draußen betrieben werden soll, müssen Sensor und Elektronik entsprechend vor Witterungseinflüssen geschützt werden.

Diese kleine Wetterstation kann als „echte“ Wetterstation genutzt werden oder als Raumklimaanzeige. Dabei gibt es einige Punkte zu berücksichtigen.


Teileliste (BOM)

Verdrahtung

Arduino Nano BME280 SSD1306
3.3V Vin VCC
GND GND GND
A5 SCL SCL
A4 SDA SDA

ArduinoIDE

Damit der Code auf den Arduino geschrieben werden kann, muss u.a. die ArduinoIDE installiert, die serielle Schnittstelle den „normalen“ Benutzer zugänglich gemacht und die Bilbliotheken eingebungen werden.

Serielle Schnittstelle

Ob der aktuelle Benutzer in der Gruppe dialout ist, kann mit dem Kommando groups im Terminal heraus gefunden werden. Falls dialout dort nicht gelistet wird, fügt man den aktuellen Benutzer wie folgt hinzu:

sudo adduser $USER dialout

Danach muss der Rechner einmal neu gestartet werden.

ArduinoIDE

ArduinoIDE installieren.

Bibliotheken einbinden

Folgende Bibliotheken über die Bibliotheksverwaltung installieren:

Wetterstation oder Raumklimaanzeige

Dieses Projekt kann als einfache Wetterstation oder als Raumklimaanzeige genutzt werden. Dabei sollte, um höhere Genauigkeit zu erziehlen, je nach Anwendung, das Barometer eingestellt werden.

Wetterstation

Bei einer Wetterstation müssen einige Sensoren geschützt untergebracht werden.

Raumklimaanzeige

Barometrische Höhenformel

\[P_0 = \dfrac{P}{ \mathrm{e}^{ \frac{-g \cdot M \cdot (h-h_0)}{R \cdot T}}}\]

\(P_0\) Luftruck auf der Bezugshöhe \(h_0\) (Meereshöhe, Normalnull)
\(P\) Luftdruck auf Höhe \(h\) (dort, wo sich der Sensor befindet)
\(\mathrm{e}\) Eulersche_Zahl = 2.718281828459 …
\(g\) Normfallbeschleunigung = 9.80665 m / s^2
\(M\) molare Masse von Luft = 0,0289644 kg / mol
\(h\) Höhe über NN in Meter
\(h_0\) 0 (Bezugshöhe, also Meereshöhe bzw. NN)
\(R\) Gaskonstante = 8.31446261815324 J / mol K
\(T\) Temperatur in Kelvin

Quelltext

arduino-wetter-v1

klicken zum Aufklappen

klicken zum Aufklappen

Diser Quelltext geht zwar, ist aber noch nicht fertig.

arduino-wetter-v1.ino
//#include <Wire.h>
#include <Adafruit_BME280.h>
#include <Adafruit_SSD1306.h>
 
Adafruit_BME280 bme; // I2C
 
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 64, &Wire);
unsigned long delayTime;
 
static const unsigned char PROGMEM image_data_ARDUINOarray[] = { 
  // ARDUINO Logo C-File Array
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0x80, 0x0f, 0xfc, 0x1f, 0xff, 0xc0, 0x03, 0xc1, 0xff, 0x0c, 0x1f, 0xc1, 0xff, 0xff, 
	0xff, 0xff, 0x80, 0x03, 0xfc, 0x1f, 0xff, 0xc0, 0x03, 0xc1, 0xfe, 0x0c, 0x1f, 0xc1, 0xff, 0xff, 
	0xff, 0xff, 0x80, 0x01, 0xfc, 0x1f, 0xff, 0xc0, 0x03, 0xe1, 0xfe, 0x0c, 0x1f, 0xc1, 0xff, 0xff, 
	0xff, 0xff, 0x80, 0x00, 0xfc, 0x1f, 0xff, 0xc0, 0x03, 0xe1, 0xfe, 0x1c, 0x1f, 0xc1, 0xff, 0xff, 
	0xff, 0xff, 0x83, 0xe0, 0x7c, 0x1f, 0xff, 0xc3, 0xff, 0xe0, 0xfe, 0x1c, 0x1f, 0xc1, 0xff, 0xff, 
	0xff, 0xff, 0x83, 0xf0, 0x7c, 0x1f, 0xff, 0xc3, 0xff, 0xf0, 0xfc, 0x1c, 0x1f, 0xc1, 0xff, 0xff, 
	0xff, 0xff, 0x83, 0xf8, 0x3c,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0xfe, 0x1f, 0x83, 0xff, 0xff, 
	0xff, 0xff, 0x83, 0xc0, 0xfc, 0x1f, 0xff, 0x9f, 0x81, 0xfe, 0x01, 0xfe, 0x0f, 0x83, 0xff, 0xff, 
	0xff, 0xff, 0x80, 0x00, 0xfc, 0x00, 0x0f, 0x80, 0x03, 0xff, 0x01, 0xfe, 0x00, 0x03, 0xff, 0xff, 
	0xff, 0xff, 0x80, 0x01, 0xfc, 0x00, 0x0f, 0x80, 0x07, 0xff, 0x03, 0xff, 0x00, 0x07, 0xff, 0xff, 
	0xff, 0xff, 0x80, 0x07, 0xfc, 0x00, 0x0f, 0x80, 0x0f, 0xff, 0x03, 0xff, 0x80, 0x0f, 0xff, 0xff, 
	0xff, 0xff, 0xc0, 0x1f, 0xfc, 0x00, 0x0f, 0xc0, 0x3f, 0xff, 0x83, 0xff, 0xe0, 0x3f, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,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, 0xf1, 0xc6, 0x31, 0xf1, 0xfc, 0xff, 0x9f, 0x1c, 0x63, 0xfe, 0x3f, 
	0xe0, 0x18, 0x07, 0x00, 0xe0, 0x31, 0xc6, 0x01, 0x80, 0x7c, 0x0f, 0x0f, 0x1c, 0x60, 0x1e, 0x07, 
	0xf8, 0x1c, 0x26, 0x00, 0xf0, 0x31, 0xc6, 0x43, 0x80, 0x3e, 0x0f, 0x9f, 0x1c, 0x78, 0x1f, 0x07, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
 
 
 
 
 
 
 
 
 
 
 
 
 
void setup() {
 
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x64)
   // init done
 
//////////////////
delay(2000); // Pause for 2 seconds
display.clearDisplay();  // Clear the buffer
display.setTextSize(1);
// Displays ARDUINOarray on the screen
display.drawBitmap(0, 0, image_data_ARDUINOarray, 128, 64, 1);
display.display();
delay(5000); // Keeps ARDUINOarray on OLED 5 seconds before Looping  
////////////////
 
 
  display.clearDisplay();
  display.display();
  display.setTextSize(2);
  display.setTextColor(WHITE);
 
  bool status;
  status = bme.begin(0x76);  
}
 
void loop() { 
 
  display.setCursor(0,0);
  display.clearDisplay();
 
 display.setTextSize(3);
  //display.write("T:");
  display.print(bme.readTemperature());
  display.cp437(true);  display.setTextSize(2); display.write(0xF8);  display.println("C");
  display.println();
 
 
 //display.setTextSize(2);
  display.write("F:"); display.print(bme.readHumidity()); display.println(" %");
 
 //display.setTextSize(2);
  display.write("F:"); display.print(bme.readHumidity()); display.println(" %");
 
 
  display.display();
  delay(1000);
}


Ardunio Wetter 2

klicken zum Aufklappen

klicken zum Aufklappen

Diser Quelltext geht zwar, ist aber noch nicht fertig.

arduino-wetter-v2.ino
 
//#include <Wire.h>
//#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
//#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
 
 
Adafruit_BME280 bme;  // I2C
 
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 64, &Wire);
unsigned long delayTime;
 
static const unsigned char PROGMEM image_data_ARDUINOarray[] = {
  // ARDUINO Logo C-File Array
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0x80, 0x0f, 0xfc, 0x1f, 0xff, 0xc0, 0x03, 0xc1, 0xff, 0x0c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x80, 0x03, 0xfc, 0x1f, 0xff, 0xc0, 0x03, 0xc1, 0xfe, 0x0c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x80, 0x01, 0xfc, 0x1f, 0xff, 0xc0, 0x03, 0xe1, 0xfe, 0x0c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x80, 0x00, 0xfc, 0x1f, 0xff, 0xc0, 0x03, 0xe1, 0xfe, 0x1c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xe0, 0x7c, 0x1f, 0xff, 0xc3, 0xff, 0xe0, 0xfe, 0x1c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf0, 0x7c, 0x1f, 0xff, 0xc3, 0xff, 0xf0, 0xfc, 0x1c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf8, 0x3c, 0x1f, 0xff, 0xc3, 0xff, 0xf0, 0xfc, 0x1c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf8, 0x3c, 0x1f, 0xff, 0xc3, 0xff, 0xf0, 0x7c, 0x3c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf8, 0x3c, 0x1f, 0xff, 0x80, 0x3f, 0xf0, 0x7c, 0x3c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf8, 0x3c, 0x1f, 0xff, 0x80, 0x0f, 0xf8, 0x78, 0x3c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf8, 0x3c, 0x1f, 0xff, 0x80, 0x07, 0xf8, 0x78, 0x7c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xfc, 0x3c, 0x1f, 0xff, 0x80, 0x03, 0xf8, 0x38, 0x7c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf8, 0x3c, 0x1f, 0xff, 0xef, 0x01, 0xfc, 0x38, 0x7c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf8, 0x3c, 0x1f, 0xff, 0xff, 0xc1, 0xfc, 0x30, 0x7c, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf8, 0x3c, 0x1f, 0xff, 0xff, 0xc1, 0xfc, 0x30, 0xfc, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf8, 0x3c, 0x1f, 0xff, 0xff, 0xc1, 0xfc, 0x10, 0xfc, 0x1f, 0xc1, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf0, 0x7c, 0x1f, 0xff, 0xff, 0xc1, 0xfe, 0x10, 0xfc, 0x1f, 0xc3, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xf0, 0x7c, 0x1f, 0xff, 0xff, 0xc1, 0xfe, 0x11, 0xfe, 0x1f, 0x83, 0xff, 0xff,
  0xff, 0xff, 0x83, 0xc0, 0xfc, 0x1f, 0xff, 0x9f, 0x81, 0xfe, 0x01, 0xfe, 0x0f, 0x83, 0xff, 0xff,
  0xff, 0xff, 0x80, 0x00, 0xfc, 0x00, 0x0f, 0x80, 0x03, 0xff, 0x01, 0xfe, 0x00, 0x03, 0xff, 0xff,
  0xff, 0xff, 0x80, 0x01, 0xfc, 0x00, 0x0f, 0x80, 0x07, 0xff, 0x03, 0xff, 0x00, 0x07, 0xff, 0xff,
  0xff, 0xff, 0x80, 0x07, 0xfc, 0x00, 0x0f, 0x80, 0x0f, 0xff, 0x03, 0xff, 0x80, 0x0f, 0xff, 0xff,
  0xff, 0xff, 0xc0, 0x1f, 0xfc, 0x00, 0x0f, 0xc0, 0x3f, 0xff, 0x83, 0xff, 0xe0, 0x3f, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xfe, 0x7f, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0x87, 0xff, 0xff, 0xfe, 0x7f, 0xf1, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
  0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x3f,
  0xfc, 0xff, 0xff, 0xe7, 0xf9, 0xff, 0x3e, 0x67, 0xff, 0xf8, 0xff, 0xff, 0xf3, 0xfc, 0xfe, 0x3f,
  0xf0, 0x39, 0xe7, 0xe7, 0xe0, 0x70, 0x0e, 0x03, 0xc1, 0xe0, 0x0f, 0xff, 0x00, 0xf0, 0x38, 0x07,
  0xe3, 0x19, 0xe7, 0xe7, 0xc6, 0x30, 0x06, 0x01, 0xe1, 0xf0, 0x1f, 0xff, 0x00, 0x63, 0x18, 0x07,
  0xe7, 0x99, 0xe7, 0xe7, 0xcf, 0x31, 0xc6, 0x71, 0xf1, 0xf8, 0xff, 0xff, 0x1c, 0x67, 0x9e, 0x3f,
  0xe0, 0x19, 0xe7, 0xe7, 0xc0, 0x31, 0xc6, 0x79, 0xf1, 0xf8, 0xff, 0xff, 0x1c, 0x60, 0x1e, 0x3f,
  0xc0, 0x19, 0xe7, 0xe7, 0xc0, 0x31, 0xc6, 0x79, 0xf1, 0xf8, 0xff, 0xff, 0x1c, 0x40, 0x1e, 0x3f,
  0xe7, 0xf9, 0xe7, 0xe7, 0xcf, 0xf1, 0xc6, 0x79, 0xf1, 0xf8, 0xff, 0xff, 0x1c, 0x67, 0xfe, 0x3f,
  0xe3, 0xf8, 0xc7, 0xe7, 0xc7, 0xf1, 0xc6, 0x31, 0xf1, 0xfc, 0xff, 0x9f, 0x1c, 0x63, 0xfe, 0x3f,
  0xe0, 0x18, 0x07, 0x00, 0xe0, 0x31, 0xc6, 0x01, 0x80, 0x7c, 0x0f, 0x0f, 0x1c, 0x60, 0x1e, 0x07,
  0xf8, 0x1c, 0x26, 0x00, 0xf0, 0x31, 0xc6, 0x43, 0x80, 0x3e, 0x0f, 0x9f, 0x1c, 0x78, 0x1f, 0x07,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
 
 
 
 
 
void setup() {
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x64)
                                              // init done
 
 
  //////////////////
  delay(2000);             // Pause for 2 seconds
  display.clearDisplay();  // Clear the buffer
  display.setTextSize(1);
  // Displays ARDUINOarray on the screen
  display.drawBitmap(0, 0, image_data_ARDUINOarray, 128, 64, 1);
  display.display();
  delay(5000);  // Keeps ARDUINOarray on OLED 5 seconds before Looping
  ////////////////
 
 
 
 
 
  //display.display();
  //delay(100);
  display.clearDisplay();
  display.display();
  display.setTextSize(2);
  display.setTextColor(WHITE);
 
  bool status;
  // default settings
  // (you can also pass in a Wire library object like &Wire2)
  status = bme.begin(0x76);
 
  delayTime = 1000;
}
 
 
void loop() {
 
  display.setCursor(0, 0);
  display.clearDisplay();
 
  display.setTextSize(3);
  display.print(bme.readTemperature(), 1);
  display.cp437(true);
  display.setTextSize(2);
  display.print("  ");
  display.write(0xF8);
  display.println("C");
  display.println();
 
  display.print("D:");
  display.print(bme.readPressure() / 100.0 + 9.2, 2);
  display.println("");
 
  display.print("F:");
  display.print(bme.readHumidity());
  display.println("  %");
 
  display.display();
  delay(1000);
}


Fritzing Parts

Falls man plant mit Fritzing einen schönen Verdrahtungsplan mit Steckbrett zu zeichnen, benötigt man noch zwei Bauteile (Parts). Beim OLED ist ist allerdings GND und Vcc vertauscht, was es beim Verdrahten zu berücksichtigen gilt.

Luftdruck und Höhe

user/wellenschrat/projekte/wetterstation/w1.txt · Zuletzt geändert: 24.08.2024 von Wellenschrat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki