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 add sensors: 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

What's My I2C Address?
Easy
  • 72
  • 3

The story of how to make a clock through using a LCD 1602 or LCD 2004 over I2C.

MyHumidity Controlled by BME280 and Photon
Easy
  • 181
  • 4

Full instructions

Checks if humidity threshold is reached and informs the user by using Blynk/IFTTT-services with softAP integration.

Tweeting Particle Photon
Easy
  • 42
  • 1

Full instructions

Tweet your friends with only the press of a button!

MyLight-Clock with NeoPixel Ring 12 Controlled by Photon
Easy
  • 260
  • 2

Full instructions

Read the time at night? Without glasses? Impossible? Focus on 2 light points, which will tell you the hour and the minute.

Map Your Particles!
Easy
  • 1,354
  • 20

Protip

Locate your Particle Photons, P1s and Electrons on a map without needing extra hardware. Use Ubidots or an offline map alternative

MyDallas DS18B20 Controlled by Photon
Easy
  • 85
  • 0

Protip

A water-resistant temperature sensor is suitable to signal the reaching of the core temperature of the meat during the grilling time.

Add projectSign up / Login