In this project, we will create a Environmental sensor using BME680 which can measure Temperature, Humidity, Altitude, Pressure & Gas resistance value. We use ESP 8266 D1 Mini as microcontroller along with a 0.66 inch OLED display to visualize the data comming form the sensor. We use a tripple adaptor as the PCB to connect all three hardwares (ESP8266 D1 Mini, BME680, 0.66 inch OLED Display) together (all hardware details are mention).
AbstractThis project focuses on the development of an environmental sensor leveraging the BME680 sensor module to measure a comprehensive set of parameters including Temperature, Humidity, Altitude, Pressure, and Gas Resistance. The core components of the system comprise an ESP8266 D1 Mini microcontroller and a 0.66-inch OLED display for real-time data visualization.
A key feature of this project is the utilization of a triple adaptor printed circuit board (PCB) design to seamlessly integrate the ESP8266 D1 Mini, BME680 sensor, and the OLED display. This approach enhances the modularity and connectivity of the system, allowing for efficient communication and collaboration between the hardware components.
The resulting environmental sensor promises versatility and accuracy in monitoring various environmental conditions. The integrated OLED display provides a user-friendly interface for real-time data presentation, offering a practical solution for applications ranging from home automation to industrial monitoring.
Project OverviewThis project consist of two different parts.1. Hardware setup.2. Firmware development.
Features of BME680The BME680 is a versatile environmental sensor developed by Bosch Sensortec, known for its ability to measure multiple environmental parameters. Some of its notable features include:
Multi-Parameter Measurement:
- The BME680 is capable of measuring various environmental parameters, including Temperature, Humidity, Pressure, and Gas Resistance. This makes it a comprehensive solution for environmental sensing applications.
- Multi-Parameter Measurement:The BME680 is capable of measuring various environmental parameters, including Temperature, Humidity, Pressure, and Gas Resistance. This makes it a comprehensive solution for environmental sensing applications.
Gas Sensing:
- One distinctive feature of the BME680 is its ability to measure gas resistance. This is particularly useful for monitoring indoor air quality, detecting volatile organic compounds (VOCs), and providing insights into the composition of the surrounding atmosphere.
- Gas Sensing:One distinctive feature of the BME680 is its ability to measure gas resistance. This is particularly useful for monitoring indoor air quality, detecting volatile organic compounds (VOCs), and providing insights into the composition of the surrounding atmosphere.
High Accuracy:
- The sensor is designed to provide accurate and reliable measurements, making it suitable for applications where precision is crucial, such as weather stations, environmental monitoring systems, and indoor air quality monitoring.
- High Accuracy:The sensor is designed to provide accurate and reliable measurements, making it suitable for applications where precision is crucial, such as weather stations, environmental monitoring systems, and indoor air quality monitoring.
Temperature Compensation:
- The BME680 incorporates temperature compensation mechanisms, ensuring that environmental measurements remain accurate even in varying temperature conditions. This feature enhances the sensor's performance and reliability.
- Temperature Compensation:The BME680 incorporates temperature compensation mechanisms, ensuring that environmental measurements remain accurate even in varying temperature conditions. This feature enhances the sensor's performance and reliability.
Altitude Measurement:
- In addition to basic environmental parameters, the BME680 includes an altimeter function, enabling it to measure changes in altitude. This is valuable for applications such as outdoor activity tracking and navigation.
- Altitude Measurement:In addition to basic environmental parameters, the BME680 includes an altimeter function, enabling it to measure changes in altitude. This is valuable for applications such as outdoor activity tracking and navigation.
Low Power Consumption:
- The sensor is designed with low power consumption in mind, making it suitable for battery-powered devices and applications where energy efficiency is a priority.
- Low Power Consumption:The sensor is designed with low power consumption in mind, making it suitable for battery-powered devices and applications where energy efficiency is a priority.
I2C and SPI Communication:
- The BME680 supports both I2C (Inter-Integrated Circuit) and SPI (Serial Peripheral Interface) communication protocols, providing flexibility in interfacing with various microcontrollers and systems.
- I2C and SPI Communication:The BME680 supports both I2C (Inter-Integrated Circuit) and SPI (Serial Peripheral Interface) communication protocols, providing flexibility in interfacing with various microcontrollers and systems.
Compact Design:
- The sensor is typically compact and lightweight, making it suitable for integration into small devices and systems with limited space.
- Compact Design:The sensor is typically compact and lightweight, making it suitable for integration into small devices and systems with limited space.
Extended Operating Temperature Range:
- The BME680 is designed to operate effectively across a wide temperature range, expanding its usability in diverse environmental conditions.
- Extended Operating Temperature Range:The BME680 is designed to operate effectively across a wide temperature range, expanding its usability in diverse environmental conditions.
Integrated Heater:
- The sensor includes an integrated heater that can be utilized to improve the accuracy of gas measurements by facilitating the release of previously adsorbed gases from the sensing elements.
- Integrated Heater:The sensor includes an integrated heater that can be utilized to improve the accuracy of gas measurements by facilitating the release of previously adsorbed gases from the sensing elements.
These features collectively make the BME680 a versatile and powerful tool for environmental sensing applications, offering a comprehensive set of measurements in a compact and energy-efficient package.
Tripple AdaptorThe Triple Adaptor is an innovative printed circuit board (PCB) designed to seamlessly integrate and interconnect three distinct hardware components. At its core, this PCB features three identical slots, each tailored to accommodate various hardware modules while maintaining a uniform package size. What sets the Triple Adaptor apart is the intelligent design that ensures all three slots are intricately connected to one another, establishing a common connectivity framework.
The layout of the Triple Adaptor is carefully crafted to facilitate the simultaneous connection of diverse hardware components, making it a versatile solution for various electronic projects. The unified design enables efficient communication and data exchange between the connected devices, creating a cohesive and streamlined system.
In a practical example of the Triple Adaptor's capabilities, the user can integrate an ESP 8266 D1 Mini, a compact yet powerful microcontroller, into one of the slots. Simultaneously, a 0.66-inch OLED display can be seamlessly added to another slot, offering a visual interface for real-time data presentation. Additionally, a BME680 sensor, renowned for its accuracy in measuring environmental parameters, can be effortlessly incorporated into the third slot. The brilliance of the Triple Adaptor lies in its ability to unite these disparate hardware components within a single interconnected system.
The common connectivity provided by the Triple Adaptor promotes synergy among the connected devices, fostering collaboration and enhancing the overall functionality of the integrated system. This unique PCB serves as a central hub, allowing data to flow seamlessly between the ESP 8266 D1 Mini, OLED display, and BME680 sensor. This capability opens up a myriad of possibilities for applications in home automation, IoT projects, or any scenario where multiple hardware components need to work in harmony.
In summary, the Triple Adaptor is not just a PCB with three slots; it is a sophisticated solution that bridges the gap between different hardware modules, fostering connectivity and collaboration in electronic projects. Its design excellence and versatile functionality make it a standout choice for enthusiasts and professionals alike seeking a unified platform for integrating diverse hardware components.
This project leverages a set of essential libraries to enable seamless communication and functionality. The inclusion of these libraries significantly enhances the capabilities of the project, providing a foundation for interfacing with specific hardware components. The following libraries are employed in this project:
SPI Library:
#include <SPI.h>
- The Serial Peripheral Interface (SPI) library is a fundamental component in many embedded systems. It facilitates communication between devices using a synchronous serial data link. In this project, SPI is likely used for efficient communication between microcontrollers and other peripherals.
Wire Library:
#include <Wire.h>
- The Wire library is instrumental in enabling I2C communication, a two-wire serial communication protocol widely used for connecting microcontrollers with various peripherals, such as sensors and displays. It simplifies the process of data transmission between devices.
Adafruit BME680 Library:
#include "Adafruit_BME680.h"
- This library is specific to the Adafruit BME680 sensor, a versatile environmental sensor capable of measuring temperature, humidity, pressure, and air quality. The Adafruit BME680 library provides the necessary functions and tools to interface with and extract data from the sensor seamlessly.
Adafruit GFX Library:
#include <Adafruit_GFX.h>
- The Adafruit Graphics Library (GFX) serves as a foundational library for graphics-oriented applications. It provides essential functions for drawing shapes, text, and images on various displays. In this project, it likely plays a role in rendering visual elements on a graphical display.
Adafruit SSD1306 Library:
#include <Adafruit_SSD1306.h>
- This library is tailored for SSD1306-based OLED displays. The SSD1306 is a popular display driver chip, and the Adafruit SSD1306 library simplifies the process of interfacing with these displays. It provides functions for drawing graphics and text on OLED screens.
For those interested in replicating or understanding the project, the specified libraries can be download from the below mentioned link:
Download library for <SPI.h> : https://www.arduino.cc/reference/en/language/functions/communication/spi/
Download library for <Wire.h> : https://www.arduino.cc/reference/en/language/functions/communication/wire/
Download library for "Adafruit_BME680.h" : https://github.com/adafruit/Adafruit_BME680
Download library for <Adafruit_GFX.h> : https://www.arduino.cc/reference/en/libraries/adafruit-gfx-library/
Download library for <Adafruit_SSD1306.h> : https://www.arduino.cc/reference/en/libraries/adafruit-ssd1306/
DemonstrationIn this project demonstration, we showcase the development of an advanced environmental sensor capable of measuring various parameters such as Temperature, Humidity, Altitude, Pressure, and Gas resistance. The project integrates cutting-edge components including the BME680 sensor, ESP8266 D1 Mini microcontroller, and a 0.66-inch OLED display. To facilitate seamless connectivity and collaboration among these components, a Triple Adaptor PCB is employed, connecting the ESP8266 D1 Mini, BME680 sensor, and OLED display in a unified system.
Components Used:
BME680 Environmental Sensor:
- The BME680 sensor is a state-of-the-art environmental sensor that can precisely measure temperature, humidity, altitude, pressure, and gas resistance values. Its versatility makes it an ideal choice for applications demanding comprehensive environmental monitoring.
ESP8266 D1 Mini Microcontroller:
- The ESP8266 D1 Mini serves as the brain of the system, functioning as a microcontroller to process data from the BME680 sensor and control the display. Known for its wireless capabilities, the ESP8266 D1 Mini facilitates data communication and integration with other devices.
0.66-inch OLED Display:
- The 0.66-inch OLED display is employed for visualizing the data collected by the BME680 sensor. Its compact size makes it suitable for embedded systems, providing a user-friendly interface to view real-time environmental parameters.
Triple Adaptor PCB:
- The Triple Adaptor PCB acts as the central hub for the project, enabling the seamless connection of the ESP8266 D1 Mini, BME680 sensor, and 0.66-inch OLED display. All three components are securely integrated into the PCB, fostering efficient communication and collaboration.
Connection Procedure:
BME680 Sensor Connection:
- Begin by connecting the BME680 sensor to the designated slot on the Triple Adaptor PCB. This establishes a direct link between the sensor and the central hub, ensuring accurate data transmission.
ESP8266 D1 Mini Connection:
- Proceed to connect the ESP8266 D1 Mini to another slot on the Triple Adaptor PCB. This step establishes the microcontroller's connection to the system, allowing it to receive and process data from the BME680 sensor.
0.66-inch OLED Display Connection:
- Conclude the hardware integration by connecting the 0.66-inch OLED display to the remaining slot on the Triple Adaptor PCB. This finalizes the visual component of the project, enabling the display of environmental data in a clear and concise manner.
Visual Reference:Please refer to the attached image for a visual representation of the hardware connections, showcasing the arrangement of the BME680 sensor, ESP8266 D1 Mini, and 0.66-inch OLED display on the Triple Adaptor PCB. This image serves as a helpful guide for replicating the project and understanding the interconnections between the components.
We use Arduino IDE for this project. Please go through the below attached code.Note: Select ESP8266 D1 R2 Mini as Board.
/*
Firmware name: BME980_OLED_Tripple_adapter
Created by Subhrajit Majumder
Modified on: 26/11/2023
More technical details: https://carenuity.com/
Required Hardware components:
A. Carenuity BME680 Shild.
B. D1 Mini
C. 0.66" OLED Display
D. Tripple Adapter.
This code is in the private (Organization) domain .
*/
#include <SPI.h>
#include <Wire.h>
#include "Adafruit_BME680.h"
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
/* OLED Definations */
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for SSD1306 display connected using I2C
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
/* BME680 Definations */
#define BME_SCK D5
#define BME_MISO D6
#define BME_MOSI D7
#define BME_CS D8
#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME680 bme; // I2C
/* User define variables */
int temp, pres, RH, gas, alt;
void setup(){
// Defination of Serial monitor for debugger
Serial.begin(9600);
// Searching for Display.
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// Searching for BME680.
if (!bme.begin()) {
Serial.println("Could not find a valid BME680 sensor, check wiring!");
// Clear the buffer.
display.clearDisplay();
// Display Text
display.setTextSize(1);
display.setTextColor(BLACK, WHITE);
display.setCursor(32,15);
display.println("No Sensor");
display.display();
delay(500);
while (1);
}
// Set up oversampling and filter initialization
bme.setTemperatureOversampling(BME680_OS_8X);
bme.setHumidityOversampling(BME680_OS_2X);
bme.setPressureOversampling(BME680_OS_4X);
bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
bme.setGasHeater(320, 150); // 320*C for 150 ms
// Clear the buffer.
display.clearDisplay();
// Display Text
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(44,20);
display.println("BME680");
display.setCursor(55,34);
display.println("by");
display.setCursor(36,49);
display.println("CARENUITY");
display.display();
delay(4000);
display.clearDisplay();
}
void loop(){
if (! bme.performReading()) {
Serial.println("Failed to perform reading :(");
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(32,15);
display.println("BME_Fail");
display.display();
delay(500);
return;
}
// Data fetch from sensor
temp = bme.temperature;
pres = (bme.pressure / 100.0);
RH = bme.humidity;
gas = (bme.gas_resistance / 1000.0);
alt = (bme.readAltitude(SEALEVELPRESSURE_HPA));
// Serial Printing (For debug).
// Serial.println(temp);
// Serial.println(pres);
// Serial.println(RH);
// Serial.println(gas);
// Serial.println(alt);
// Dispaly function
display.setTextSize(1);
display.setTextColor(WHITE);
/* 1st Screen */
// Display Temperature
display.setCursor(32,20);
display.println("Temp:");
display.setCursor(62,20);
display.println(temp);
display.setCursor(79,20);
display.println("C");
// Display Humidity
display.setCursor(32,34);
display.println("RH: ");
display.setCursor(52,34);
display.println(RH);
display.setCursor(70,34);
display.println("%");
// Display Altitude
display.setCursor(32,49);
display.println("ALT: ");
display.setCursor(62,49);
display.println(RH);
display.setCursor(79,49);
display.println("m");
display.display();
delay(4000);
display.clearDisplay();
/* 2nd Screen */
display.setTextSize(1);
display.setTextColor(WHITE);
// Display Pressure
display.setCursor(32,20);
display.println("P:");
display.setCursor(45,20);
display.println(pres);
display.setCursor(70,20);
display.println(" hPa");
// Display Gas
display.setCursor(32,34);
display.println("GAS: ");
display.setCursor(55,34);
display.println(gas);
display.setCursor(70,34);
display.println("KOhm");
// Display End data
display.setCursor(32,49);
display.println("------------");
display.display();
delay(4000);
display.clearDisplay();
}
Web FlashingIn collaboration with Carenuity, this project has been developed to offer a comprehensive environmental sensing solution using advanced components such as the BME680 sensor, ESP8266 D1 Mini microcontroller, and a 0.66-inch OLED display. As part of our commitment to user-friendly experiences, Carenuity proudly announces support for web flashing directly from its official website. This feature enhances the project's accessibility and simplifies the firmware updating process.
Web Flashing Support:Carenuity recognizes the importance of providing users with a hassle-free method for updating firmware and optimizing their environmental sensor projects. To streamline this process, we will soon release detailed web flashing procedures for this project. Users can conveniently access these instructions, ensuring a smooth and efficient update experience.
Benefits of Web Flashing:
User-Friendly Interface:
- The web flashing process is designed with user convenience in mind. Carenuity aims to provide an intuitive interface that simplifies the firmware update procedure, making it accessible to users of varying technical expertise.
Efficient Updates:
- Web flashing eliminates the need for complex manual flashing methods, allowing users to update their project's firmware efficiently. This ensures that users can take advantage of the latest features and improvements seamlessly.
Accessibility Anywhere:
- By offering web flashing support directly from the official Carenuity website, users can initiate updates from virtually anywhere with an internet connection. This accessibility promotes a more flexible and user-friendly experience.
Upcoming Web Flashing Procedures:Carenuity is committed to providing transparent and detailed instructions for the web flashing process. Users can expect the following key steps to be covered in the upcoming procedures:
- Accessing the official Carenuity website for web flashing support.
- Connecting the environmental sensor project to the web flashing interface.
- Initiating the firmware update process securely and reliably.
Comments