Sunday, November 15, 2015

Weather station with Arduino, DTH11 and MPL3115A2 Barometric pressure sensor

Nothing special here, I had the sensors laying around and a spare box and Arduino nano module so I just "glued" everything together. In the future I will proably put some remote sensors...if I have time and patience for it.

The finished product (with printed paper graphics glued on the plastic panel):


..This type of LCD is not the greatest of all, just used it because bought two out of curiosity, next time will stick with a classic one.


The internals:

..nothing special, there's a small hole near the humidity detector (blue module near the back panel) for faster response to temperature change.

View from the back, power is by USB directly on the Arduino nano module. The back of the Nokia LCD is visible on the back of the front panel:




Part of the code, just for future reference:
 -------------
 #include
#include
// Nokia 5110 libs
#include
#include
// alti/pressure sensor
#include
#include


 // DHT11 sensor
#define DHTPIN A1     // pin analog 1
#define DHTTYPE DHT11   // DHT 11
DHT dht(DHTPIN, DHTTYPE);

const int SENSORADDRESS = 0x60;

Adafruit_PCD8544 display = Adafruit_PCD8544(8, 9, 10, 11, 12); // arduino
Adafruit_MPL3115A2 baro = Adafruit_MPL3115A2();

  // readh dht11 variables
  float hum = dht.readHumidity();
  // Read temperature as Celsius
  float temp = dht.readTemperature();
  // read addfruit variables
  float pascals = baro.getPressure();
  float mb = pascals/100;
  // clear last data on display and display new data
  display.clearDisplay();
  display.print("--------------");
  //display.print("--- Sensor ---");
  display.print("Humi. "); display.print(hum); display.println(" %");
  display.print("Temp. "); display.print(temp); display.println(" C"); // dth not so accurate
  display.print("mB. "); display.println(mb);
  display.print("--------------");
 -------------



Have a nice week!


No comments: