Things used in this project

Hardware components:
Photon new
Particle Photon
×1
13676 01
SparkFun SparkFun Atmospheric Sensor Breakout - BME280
https://www.amazon.de/gp/product/B01GQ3T1A
×1
OLE Display 128x64
https://www.amazon.de/gp/product/B00NHKM1C0
×1
12002 04
Breadboard (generic)
×1
11026 02
Jumper wires (generic)
×1
Software apps and online services:
Particle Particle WebIDE

Schematics

Code

Example to display temp, humidity & clockC/C++
#include "Particle.h"
#include "Adafruit_BME280.h"
#include "Adafruit_Sensor.h"
#include "Adafruit_SSD1306.h"
#include <math.h> // isnan()

Adafruit_BME280 bme; // I2C
//#define OLED_RESET D4
//Adafruit_SSD1306 display(OLED_RESET);
Adafruit_SSD1306 display(-1);

const unsigned long UPDATE_PERIOD_MS = 2000;

// I2C wiring
#define BME_MOSI D0
#define BME_SCK D1

#define SEALEVELPRESSURE_HPA (1013.25)

unsigned long lastUpdate = 0;
char buf[64];

void setup() {
	Serial.begin(9600);
	
    Serial.println(F("BME280 + OLEDisplay 128x64"));

    if (bme.begin()) {
        Serial.println("BME280 sensor works!");
    }
	
	display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

    display.display(); // show splashscreen
    delay(2000);
    display.clearDisplay();   // clears the screen and buffer

    Time.zone(+2.00);  // setup a time zone, which is part of the ISO6801 format 
}


void loop() { 
	if (millis() - lastUpdate >= UPDATE_PERIOD_MS) {
		lastUpdate = millis();
		
    	Serial.print("Temperature = ");
    	float temp = bme.readTemperature(); // degrees C
        Serial.print(temp);
        Serial.println(" *C");
    
        Serial.print("Pressure = ");
    	float pressure = (bme.readPressure() / 100.0F); // hPa
        Serial.print(pressure);
        Serial.println(" hPa");
    
        Serial.print("Approx. Altitude = ");
        float altitude = (bme.readAltitude(SEALEVELPRESSURE_HPA)); 
        Serial.print(altitude);
        Serial.println(" m");
    
        Serial.print("Humidity = ");
        float humidity = bme.readHumidity(); // % 
        Serial.print(humidity);
        Serial.println(" %");
		
	if (!isnan(temp) && !isnan(humidity)) {
	    
	    	display.clearDisplay();
		    
			display.setTextSize(2);
			display.setTextColor(WHITE);
			display.setCursor(0,0);
//			display.println("Hello, world!");

			snprintf(buf, sizeof(buf), "%.2f C", temp);
			display.println(buf);

			//snprintf(buf, sizeof(buf), "%.1f F", temp * 9.0 / 5.0 + 32.0);
			//display.println(buf);

			snprintf(buf, sizeof(buf), "%.2f %%", humidity);
			display.println(buf);
			
//			snprintf(buf, sizeof(buf), "%.1f %% hPa", pressure);
//			display.println(buf);

//			snprintf(buf, sizeof(buf), "%.1f %% m", altitude);
//			display.println(buf);

            display.println(Time.format(Time.now(), "%H:%M h"));
           	
  		}
		display.display();
	}
}

Credits

Img 6554 3ywwumwxbh
Ingo Lohs

I am well over 40 years and come from the middle of Germany. You can contact me also in German. Donation for projects: paypal.me/ingolohs

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

E-Paper Weather Display with Photon and IFTTT
Easy
  • 4,154
  • 19

Full instructions

Create a beautiful medium for weather information using Particle's cloud services and IFTTT.

2-Way Particle Photon Communication
Easy
  • 194
  • 4

Make two Particle Photons "talk" via the usage of webhooks!

WiFi Strength Meter
Easy
  • 469
  • 6

A meter that indicates the Wi-Fi signal strength in an intuitive way, using the parts I had on hand.

IFTTT - Enabled Sensors with Particle Photon
Easy
  • 727
  • 12

Full instructions

Connect any sensor to Particle Photon and use it to trigger an IFTTT action with just a few lines of code.

Light Detecting Email Sender
Easy
  • 230
  • 4

Full instructions

Receive an email about when the light is too strong on your device; nobody wants a heated device left directly under the sun. Photon + IFTTT

Internet-Connected Popcorn Popper
Easy
  • 164
  • 1

Full instructions

A hot air popcorn popper triggered via the Internet! (Built for the Bellingham Codes May event.)

Add projectSign up / Login