After the conciliation on the moisture within the tenement apartment could be settled by recording the moisture for a sufficient period, I had now withheld my loaned material. Check the history in this project.
So what to do with a BME280 sensor? The answer is obvious: the measured values are to be displayed. Thought, done: I was the LCD16x2 often too small in the representation, so I decided to bring the next larger LCD20x4 to use.
We look at how values are measured using the BME280 (temperature, humidity, air pressure) and can be combined with information from onboard functions of the Particle Photon (in this case the time, weekday in "German" and calendar week).
In sum, you get a digital watch with value-added information that is tailored to your requirements and quite cheap.
Schematic: Both the BME280 sensor and the LCD20x4 are controlled via the I2C interface (previously solder the I2C adapter plate to the LCD).
The Particle Photon provides SCL and SDA to D1 and D0.
// LIBs
#include <Adafruit_BME280.h>
#include <LiquidCrystal_I2C_Spark.h>
// Objects
LiquidCrystal_I2C *lcd;
Adafruit_BME280 bme; // I2C
// I2C wiring
#define BME_MOSI D0
#define BME_SCK D1
My challenge was the presentation of the weekday in German. I searched within the Particle documentation for a regional setting of the time; Except for the time zone I found nothing. So I took the analysis of the weekday through an IF / THEN clause.
// https://docs.particle.io/reference/firmware/photon/#weekday-
int wDayName = Time.weekday();
if (wDayName != wDayName)
{
lcd->clear();
}
if (wDayName == 1)
{
Wochentag = "Sonntag";
}
else if (wDayName == 2)
{
Wochentag = "Montag";
}
else if (wDayName == 3)
{
Wochentag = "Dienstag";
}
else if (wDayName == 4)
{
Wochentag = "Mittwoch";
}
else if (wDayName == 5)
{
Wochentag = "Donnerstag";
}
else if (wDayName == 6)
{
Wochentag = "Freitag";
}
else if (wDayName == 7)
{
Wochentag = "Samstag";
}
If your display does not display any characters, you can find help in this project: Whats my I2C address?
If you prefer to use a OLE Display, you can check this project here: BME280 measures and displays on OLED controlled by Photon.
Conclusions
Like my description? You will find more under my account.
Follow me to be notified when I publish new projects!
Here is my Paypal link.
You can also send me sensors, which I like to look at sometimes.
Update at 26.08.2017 - v1.1add a check for time to clear the LCD Display - else the Weekname will burn into LCD, example Donnerstag is longer then Freitag
Update at 08.01.2018 - v1.2add a function isDST() to check summer/winter-timezone
Update at 25.10.2018 - STL-File for a 3D-PrintoutYou will find a STL-File in the attachments for housing the components.
Comments