UNO BME680 Sensor Output 

In this simple simple example we use one Arduino UNO connected to the BME680 sensor using I2C to output data on the television.Look at the pictures at the bottom of page !!!
NOTE: The example is a modification for ArduTV of the original code by Arnd\@SV-Zanshin. You can find on the header of the code all the references .

The code of the Example

/*

@section I2CDemo_intro_section Description

Example program for using I2C to set and read the Bosch BME680 sensor. The sensor measures
temperature, pressure and humidity and is described at
https://www.bosch-sensortec.com/bst/products/all_products/BME680. The datasheet is available from
Bosch at https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME680_DS001-11.pdf \n\n

The most recent version of the BME680 library is available at https://github.com/SV-Zanshin/BME680
and the documentation of the library as well as example programs are described in the project's wiki
pages located at https://github.com/SV-Zanshin/BME680/wiki. \n\n

The BME680 is an extremely small physical package that is so tiny as to be impossible to solder at
home, hence it will be used as part of a third-party breakout board. There are several such boards
available at this time, for example \n Company  | Link
-------  | ----------
Sparkfun | https://www.sparkfun.com/products/14570
BlueDot  | https://www.bluedot.space/sensor-boards/bme680/
Adafruit |
https://learn.adafruit.com/adafruit-BME680-humidity-barometric-pressure-temperature-sensor-breakout
\n\n

Bosch supplies sample software that runs on various platforms, including the Arduino family; this
can be downloaed at https://github.com/BoschSensortec/BSEC-Arduino-library . This software is part
of the Bosch "BSEC" (Bosch Sensortec Environmental Cluster) framework and somewhat bulky and
unwieldy for typical Arduino applications, hence the choice to make a more compact and rather less
abstract library.

This example program initializes the BME680 to use I2C for communications. The library does not
using floating point numbers to save on memory space and computation time. The values for
Temperature, Pressure and Humidity are returned in deci-units, e.g. a Temperature reading of "2731"
means "27.31" degrees Celsius. The display in the example program uses floating point for
demonstration purposes only.  Note that the temperature reading is generally higher than the ambient
temperature due to die and PCB temperature and self-heating of the element.\n\n

The pressure reading needs to be adjusted for altitude to get the adjusted pressure reading. There
are numerous sources on the internet for formulae converting from standard sea-level pressure to
altitude, see the data sheet for the BME180 on page 16 of
http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf. Rather than put a floating-point
function in the library which may not be used but which would use space, an example altitude
computation function has been added to this example program to show how it might be done.

@section I2CDemolicense License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version. This program is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have
received a copy of the GNU General Public License along with this program.  If not, see
<http://www.gnu.org/licenses/>.

@section I2CDemoauthor Author

Written by Arnd\@SV-Zanshin

@section I2CDemoversions Changelog

Version | Date       | Developer  | Comments
------- | ---------- | ---------- | ---------------------------------------------------------------
1.0.3   | 2020-07-04 | SV-Zanshin | Issue #25 implement clang-formatting
1.0.2   | 2020-05-09 | SV-Zanshin | Issue #8  clean up comments and code
1.0.1   | 2019-01-30 | SV-Zanshin |           Removed old comments
1.0.1   | 2019-01-26 | SV-Zanshin | Issue #3  convert documentation to Doxygen
1.0.0b  | 2018-06-30 | SV-Zanshin |           Cloned from original BME280 program
*/
#include "Zanshin_BME680.h"  // Include the BME680 Sensor library
#include <ArduTV.h> //ArduTV Library to be included

/**************************************************************************************************
** Declare all program constants                                                                 **
**************************************************************************************************/
const uint32_t SERIAL_SPEED{115200};  ///< Set the baud rate for Serial I/O
ArduTV HDMI1(10); //Set the CS pin for ArduTV
/**************************************************************************************************
** Declare global variables and instantiate classes                                              **
**************************************************************************************************/
BME680_Class BME680;  ///< Create an instance of the BME680 class
///< Forward function declaration with default value for sea level
float altitude(const int32_t press, const float seaLevel = 1013.25);
float altitude(const int32_t press, const float seaLevel) {
  /*!
  @brief     This converts a pressure measurement into a height in meters
  @details   The corrected sea-level pressure can be passed into the function if it is known,
             otherwise the standard atmospheric pressure of 1013.25hPa is used (see
             https://en.wikipedia.org/wiki/Atmospheric_pressure) for details.
  @param[in] press    Pressure reading from BME680
  @param[in] seaLevel Sea-Level pressure in millibars
  @return    floating point altitude in meters.
  */
  static float Altitude;
  Altitude =
      44330.0 * (1.0 - pow(((float)press / 100.0) / seaLevel, 0.1903));  // Convert into meters
  return (Altitude);
}  // of method altitude()

void setup() {
  /*!
  @brief    Arduino method called once at startup to initialize the system
  @details  This is an Arduino IDE method which is called first upon boot or restart. It is only
            called one time and then control goes to the main "loop()" method, from which
            control never returns
  @return   void
  */
  Serial.begin(SERIAL_SPEED);  // Start serial port at Baud rate

  HDMI1.begin();//Initialize ArduTV
  HDMI1.BGColor(31, 31, 31);//ArduTV Background color setting (blsck)
  HDMI1.Clear(); //ArduTV Command Clear the screen
  HDMI1.PenColor(0, 20, 10);
  HDMI1.printString("Il tuo progetto in TV con", 30, 15, 2);
  HDMI1.PenColor(23,0, 0);
  HDMI1.printString("ArduTV", 450, 15, 2);
  HDMI1.PenColor(0,0, 0);
  HDMI1.Rect(50, 40, 540, 5, 1);
  HDMI1.Rect(458, 140, 150, 80, 0);
  //HDMI1.Rect(0, 200, 640, 5, 1);
    HDMI1.PenColor(5,10, 0);
  HDMI1.printString("Esempio di output del sensore BME680", 20, 90, 2);


#ifdef __AVR_ATmega32U4__      // If this is a 32U4 processor, then wait 3 seconds to init USB port
  delay(3000);
#endif
  Serial.print(F("Starting I2CDemo example program for BME680\n"));
  Serial.print(F("- Initializing BME680 sensor\n"));
  while (!BME680.begin(I2C_STANDARD_MODE)) {  // Start BME680 using I2C, use first device found
    Serial.print(F("-  Unable to find BME680. Trying again in 5 seconds.\n"));
    delay(5000);
  }  // of loop until device is located
  Serial.print(F("- Setting 16x oversampling for all sensors\n"));
  BME680.setOversampling(TemperatureSensor, Oversample16);  // Use enumerated type values
  BME680.setOversampling(HumiditySensor, Oversample16);     // Use enumerated type values
  BME680.setOversampling(PressureSensor, Oversample16);     // Use enumerated type values
  Serial.print(F("- Setting IIR filter to a value of 4 samples\n"));
  BME680.setIIRFilter(IIR4);  // Use enumerated type values
  Serial.print(F("- Setting gas measurement to 320\xC2\xB0\x43 for 150ms\n"));  // "�C" symbols
  BME680.setGas(320, 150);  // 320�c for 150 milliseconds
}  // of method setup()
void loop() {
  /*!
  @brief    Arduino method for the main program loop
  @details  This is the main program for the Arduino IDE, it is an infinite loop and keeps on
            repeating. The "sprintf()" function is to pretty-print the values, since floating
            point is not supported on the Arduino, split the values into those before and those
            after the decimal point.
  @return   void
  */
  static int32_t  temp, humidity, pressure, gas;  // BME readings
  static char     buf[16];                        // sprintf text buffer
  static float    alt;                            // Temporary variable
  static uint16_t loopCounter = 0;                // Display iterations
  if (loopCounter % 25 == 0) {                    // Show header @25 loops
    Serial.print(F("\nLoop TempC    Humid% Press hPa   Alt m Air m"));
     HDMI1.PenColor(0, 0, 20);
    HDMI1.printString("Loop  Temp    Humid%  Press(hPa)   Alt m   Air m", 30, 140, 1);
    Serial.print(F("\xE2\x84\xA6\n==== ====== ====== ========= ======= ======\n"));  // "�C" symbol
  }                                                     // if-then time to show headers
  BME680.getSensorData(temp, humidity, pressure, gas);  // Get readings
     HDMI1.PenColor(0, 10, 2);
   sprintf(buf, "%3d",(int8_t)(temp / 100));
    HDMI1.printString(buf, 460, 170, 4);
    HDMI1.printString("C", 550, 170, 4);
    HDMI1.printString("o", 580, 160, 3);

   HDMI1.PenColor(20, 2, 2);
  if (loopCounter++ != 0) {                             // Ignore first reading, might be incorrect
    sprintf(buf, "%4d %3d.%02d", (loopCounter - 1) % 9999,  // Clamp to 9999,
            (int8_t)(temp / 100), (uint8_t)(temp % 100));   // Temp in decidegrees      
    Serial.print(buf);
    HDMI1.printString(buf, 24, 170+(10*(loopCounter % 25)), 1);

   

    sprintf(buf, "%3d.%03d", (int8_t)(humidity / 1000),
            (uint16_t)(humidity % 1000));  // Humidity milli-pct
    Serial.print(buf);
    HDMI1.printString(buf, 130, 170+(10*(loopCounter % 25)), 1);
    sprintf(buf, "%7d.%02d", (int16_t)(pressure / 100),
            (uint8_t)(pressure % 100));  // Pressure Pascals
    Serial.print(buf);
    HDMI1.printString(buf, 188, 170+(10*(loopCounter % 25)), 1);
    alt = altitude(pressure);                                                // temp altitude
    sprintf(buf, "%5d.%02d", (int16_t)(alt), ((uint8_t)(alt * 100) % 100));  // Altitude meters
    Serial.print(buf);
    HDMI1.printString(buf, 280, 170+(10*(loopCounter % 25)), 1);
    sprintf(buf, "%4d.%02d\n", (int16_t)(gas / 100), (uint8_t)(gas % 100));  // Resistance milliohms
    Serial.print(buf);
    HDMI1.printString(buf, 360, 170+(10*(loopCounter % 25)), 1);
    delay(1000);  // Wait 10s
  }                // of ignore first reading
}  // of method loop()


Lo store di tecnologia online

Data Output on television

Temperature, Humidity, Pressure, Altitude and Air quality are printed on television every 5 seconds.

Arduino UNO + ArduTV + BME680

The BME680 is connected to the boards for power supply and I2C pins (SCL and SDA).

BME680

This module with sensor found on internet sellers.