GY BME280 barometrischer Sensor und BLYNK Anbindung - Produktvorstellung - AZ-Delivery

In this video, we would like to introduce you to the BME 280 and also explain the use of Blynk. As part of the video, the technical specifications of the products used are presented. In addition, we show a sample circuit to show how the sensor can be used, how the cabling works, and how the integration of Blynk works.


! Attention: If the video is not displayed for you, you should check your cookie settings. You have to accept all cookies so that the video is visible!


Here you will find the products used:

Gy-bme280 barometric sensor

ESP32 NODEMCU Module WiFi Development Board

Resistance resistor kit

LED light -emitting diodes range kit


Wiring:

Code:

 /*

    ___ _____        ____       ___                      
   /   /__  /       / __ \___  / (_)   _____  _______  __
  / /| | / / ______/ / / / _ \/ / / | / / _ \/ ___/ / / /
 / ___ |/ /_/_____/ /_/ /  __/ / /| |/ /  __/ /  / /_/ / 
/_/  |_/____/    /_____/\___/_/_/ |___/\___/_/   \__, /  
                                                /____/   
 Product, data sheet and Pinout at:
  https://www.az-delivery.de/

 Project: Send BME280 data to Blynk and control LED via Blynk
 Date: 02/2022

*/

#include <Wire.H>
#include <Adafruit_sensor.H>
#include <Adafruit_bme280.H>
Adafruit_bme280 BME; // i2c

#define Blynk_Print Serial
#define Blynk_Template_ID "Tmplwrohr9-B"
#define Blynk_Device_Name "Room data"
#include <Wifi.H>
#include <Wifi.H>
#include <BlynksimpleESP32.H>
#include "my_crediales.h"

intimately Ledpine = 25;

// LED control via web dashboard.
Blynk_write(V0){
  intimately LED status = param.Asint(); 
  IF(LED status==1) digital(Ledpine, HIGH);
  Else digital(Ledpine, Low);
}

void set up()
{
  Serial.Begin(115200);
  pin mode(Ledpine, OUTPUT);

   // 0x76 i2c address from the sensor
  IF (!BME.Begin(0x76)) {
    Serial.print("No BME280 sensor found!");
    while (1);
  }
  
  Blynk.Begin(auth, SSID, passport); 
}

void loop()
{

 IF(Millis()%3000==0){ 
    float tempo =BME.Reading temperature();
    float pressure =BME.reapressure() / 100.0f;
    float humble =BME.readhumidity();

    Serial.print(tempo +String(" | "));
    Serial.print(pressure +String(" | "));
    Serial.print(humble); 

    Blynk.virtualwrite(V1, tempo); 
    Blynk.virtualwrite(V2, pressure);
    Blynk.virtualwrite(V3, humble); 
 }
 
 Blynk.run();
}


Associated data:

Char Ssid [] = "MySSID";
Char Pass [] = "mypassword";
Char Auth [] = "Fe7p0avzti9izn877T04IVX_SUO2D2A_";

/*
	#define Blynk_auth_Token "Fe7p0avzti9izn877T04IVX_SUO2D2A_"
	#define Blynk_Template_ID "TMPlwrohr9-B"
	#define Blynk_Device_Name "Raumdaten"
*/

2 Reacties

Rudi

Rudi

Danke für den Tipp. Gerade wenn man selber keine Infrastruktur aufsetzen will ist das sehr hilfreich. habt ihr auch ein GitHub damit man die Datein clonen kann? das Copy und Paste ist doch sehr fehleranfällig?

WalTro

WalTro

Hallo, bin Anfänger.
Was und wo muss ich bei der Verwendung eines ESP8266 (NODEMCU) im quellcodde ändern??

Laat een reactie achter

Alle opmerkingen worden voor publicatie gecontroleerd door een moderator

Aanbevolen blogberichten

  1. ESP32 jetzt über den Boardverwalter installieren - AZ-Delivery
  2. Internet-Radio mit dem ESP32 - UPDATE - AZ-Delivery
  3. Arduino IDE - Programmieren für Einsteiger - Teil 1 - AZ-Delivery
  4. ESP32 - das Multitalent - AZ-Delivery