Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
If you’ve ever tried building a weather station or environmental monitoring system, you’ve likely encountered Bosch’s environmental sensor lineup. After designing dozens of IoT devices using these sensors, I can confidently say the BME 280 and BME 680 have become the go-to choices for accurate temperature, humidity, and pressure measurements. This tutorial covers everything you need to know to get these sensors working in your projects.
Understanding Environmental Sensors from Bosch
Bosch Sensortec has established itself as the leader in compact environmental sensing. Their sensor family evolved from the BMP085 and BMP180 pressure-only sensors to the feature-packed BME series we have today. Both the BME 280 and BME 680 pack multiple sensing elements into remarkably small packages, making them perfect for space-constrained applications.
What sets these sensors apart from alternatives like the DHT11 or DHT22 is their integration, accuracy, and digital interface. Rather than dealing with analog signals or proprietary one-wire protocols, you get clean I2C or SPI communication with factory-calibrated sensors that deliver consistent results.
Adafruit BME280: The Essential Temperature Humidity Sensor
The Adafruit BME280 breakout board packages Bosch’s precision environmental sensor into a maker-friendly format. This 3-in-1 sensor measures temperature, barometric pressure, and relative humidity simultaneously—everything you need for a complete weather monitoring solution.
BME280 Technical Specifications
Parameter
Specification
Temperature Range
-40°C to +85°C
Temperature Accuracy
±1.0°C (0 to 65°C)
Humidity Range
0% to 100% RH
Humidity Accuracy
±3% RH
Pressure Range
300 to 1100 hPa
Pressure Accuracy
±1 hPa absolute
Altitude Accuracy
±1 meter
Operating Voltage
1.71V to 3.6V (chip), 3-5V (breakout)
Current Consumption
<1mA during measurement, 5µA idle
Communication
I2C (up to 3.4MHz), SPI (up to 10MHz)
I2C Addresses
0x77 (default), 0x76 (SDO to GND)
Why Choose the BME280?
The BME 280 hits a sweet spot between capability and cost. For standard weather station applications, it provides everything you need without the complexity or expense of more advanced sensors. The pressure measurements are precise enough to calculate altitude with roughly 1-meter accuracy—useful for drones, GPS enhancement, and indoor navigation systems.
One thing worth noting: the BME280 exhibits some self-heating during operation, which can cause temperature readings to run 2-3°C higher than actual ambient temperature. For critical applications, either compensate in software or use forced mode sampling to minimize heat buildup.
Adafruit BME680: The 4-in-1 Air Quality Sensor
The Adafruit BME680 takes environmental sensing to the next level by adding a gas sensor to the temperature, humidity, and pressure measurements. This fourth sensing element detects Volatile Organic Compounds (VOCs), making the BME 680 capable of indoor air quality monitoring.
BME680 Technical Specifications
Parameter
Specification
Temperature Range
-40°C to +85°C
Temperature Accuracy
±0.5°C to ±1.0°C
Humidity Range
0% to 100% RH
Humidity Accuracy
±3% RH
Pressure Range
300 to 1100 hPa
Pressure Accuracy
±1 hPa absolute
Gas Sensor
MOX-based VOC detection
Gas Sensor Output
Resistance value (Ohms)
Operating Voltage
1.71V to 3.6V (chip), 3-5V (breakout)
Current Consumption
0.15µA sleep, up to 12mA with gas sensor active
Communication
I2C, SPI
I2C Addresses
0x77 (default), 0x76 (SDO to GND)
Understanding the Gas Sensor
The BME 680’s Metal-Oxide (MOX) gas sensor deserves special explanation. When heated, the metal oxide layer changes resistance based on the concentration of VOCs in the surrounding air. This allows detection of gases like ethanol, alcohol, acetone, and carbon monoxide—common indoor pollutants from cleaning products, paints, adhesives, and office equipment.
However, the gas sensor has important limitations. It provides a single resistance value representing total VOC content—it cannot identify specific gases or distinguish between different compounds. The sensor requires a warm-up period of 5-20 minutes for stable readings, and the resistance values need interpretation through Bosch’s proprietary BSEC library to convert to an Indoor Air Quality (IAQ) index.
BME280 vs BME680: Choosing the Right Sensor
Feature
BME280
BME680
Temperature
✓
✓
Humidity
✓
✓
Pressure
✓
✓
Gas/VOC Sensing
✗
✓
Power Consumption
Lower
Higher (with gas)
Warm-up Time
Minimal
5-20 minutes for gas
Price
Lower
Higher
Complexity
Simple
More complex
Best For
Weather stations
Air quality monitoring
Choose BME280 when: You need basic environmental monitoring for weather stations, HVAC control, or altitude tracking. The simpler sensor draws less power and costs less while delivering the same accuracy for temperature, humidity, and pressure.
Choose BME680 when: Indoor air quality matters for your application. Smart home systems, office environmental monitors, and health-focused devices benefit from VOC detection capabilities.
Wiring the BME280 and BME680 to Arduino
Both sensors share identical pinouts and wiring requirements, making it easy to swap between them if needed.
I2C Wiring (Recommended)
Sensor Pin
Arduino UNO
Arduino Mega
ESP32
VIN
5V
5V
3.3V
GND
GND
GND
GND
SCL/SCK
A5
21
GPIO 22
SDA/SDI
A4
20
GPIO 21
The Adafruit breakout boards include onboard voltage regulators and level shifters, so you can safely connect to 5V Arduino boards or 3.3V ESP32 boards without additional components.
SPI Wiring (Higher Speed)
Sensor Pin
Arduino UNO
Notes
VIN
5V
Power supply
GND
GND
Common ground
SCK
D13
SPI clock
SDO/MISO
D12
Data from sensor
SDI/MOSI
D11
Data to sensor
CS
D10
Chip select
SPI offers faster data transfer (up to 10MHz vs 3.4MHz for I2C) and avoids I2C address conflicts when using multiple sensors. However, it requires more wiring and dedicated pins.
Changing the I2C Address
Both sensors default to I2C address 0x77. To use address 0x76 instead (useful when combining with other 0x77 devices), connect the SDO pin to GND. On Adafruit boards, you can simply solder the ADDR jumper on the back of the PCB.
Installing the Adafruit BME280 Library
Getting the software side working requires installing Adafruit’s libraries through the Arduino IDE.
Step 1: Open Arduino IDE and navigate to Sketch → Include Library → Manage Libraries.
Step 2: Search for “Adafruit BME280” and click Install.
Step 3: When prompted, also install the dependencies, particularly “Adafruit Unified Sensor.”
Step 4: For BME680 projects, search for and install “Adafruit BME680” instead.
For more accurate altitude readings, replace SEALEVELPRESSURE_HPA with the current sea level pressure for your location, available from local weather services.
The gas resistance value requires interpretation—higher resistance generally indicates cleaner air, while lower resistance suggests higher VOC concentrations.
Practical Applications for Environmental Sensors
Home Weather Stations
Both sensors excel at weather monitoring. Combine with an ESP32 for WiFi connectivity and you can build a complete weather station that logs data to cloud services or displays on a web dashboard. The pressure readings enable weather prediction based on barometric trends.
Indoor Air Quality Monitoring
The BME 680 shines in IAQ applications. Deploy sensors throughout a home or office to monitor ventilation effectiveness, detect when rooms need airing out, or trigger HVAC systems when air quality drops.
Smart HVAC Control
Use temperature and humidity readings to intelligently control heating, cooling, and humidification systems. The fast response time and low power consumption make these sensors ideal for battery-powered wireless sensor nodes.
Altitude and Navigation
The precise pressure measurements enable altitude tracking for drones, hiking applications, and indoor navigation (floor detection in multi-story buildings). GPS systems can use barometric data to improve vertical positioning accuracy.
Wearable Devices
Both sensors’ tiny footprints and low power consumption suit wearable applications. Fitness trackers can count stairs climbed, smartwatches can display local conditions, and health monitors can track environmental factors affecting wellbeing.
Troubleshooting Common Problems
Sensor Not Detected
If your code returns “Could not find sensor,” check these common issues:
Wiring connections — Verify SDA and SCL are connected to the correct pins
I2C address — Try both 0x77 and 0x76 in your code
Power supply — Ensure adequate voltage and current
Pull-up resistors — Adafruit boards include these, but generic modules may not
Inaccurate Temperature Readings
The BME280 and BME680 both exhibit self-heating. For better accuracy:
Use forced mode instead of continuous sampling
Reduce oversampling settings
Apply a software offset based on comparison with a reference thermometer
Mount the sensor away from heat-generating components
Unstable Gas Readings (BME680)
Gas sensor readings require stabilization time:
Allow 5-20 minutes warm-up before trusting readings
Use the reading after warm-up as your baseline
Monitor relative changes rather than absolute values
Consider implementing Bosch’s BSEC library for IAQ calculations
I2C Communication Failures
If you experience intermittent communication:
Keep I2C wires short (under 30cm for reliable operation)
Add external pull-up resistors if using long cables
Yes, as long as they have different I2C addresses. Set one sensor to 0x77 (default) and the other to 0x76 (by connecting SDO to GND). This allows simultaneous operation on the same I2C bus with no conflicts.
How accurate is the altitude measurement?
Under optimal conditions with correct sea level pressure calibration, both sensors achieve approximately ±1 meter altitude accuracy. However, atmospheric pressure changes throughout the day, so altitude readings will drift without periodic recalibration. For relative altitude changes (like counting floors), accuracy improves significantly.
Does the BME680 replace dedicated air quality sensors like the CCS811?
The BME680 provides VOC detection but outputs raw resistance values rather than calibrated CO2 equivalent or TVOC readings that dedicated sensors provide. For serious air quality monitoring, the BME680 works best with Bosch’s BSEC library, which calculates an Indoor Air Quality (IAQ) index from 0-500. Dedicated sensors may still be preferable for regulatory compliance or specific gas detection.
Why do my temperature readings seem too high?
Both sensors experience self-heating during operation, causing readings 2-3°C above actual ambient temperature. To minimize this effect, use forced mode sampling (taking readings on demand rather than continuously), reduce oversampling settings, and ensure adequate airflow around the sensor. Some users apply a fixed offset correction based on comparison with a calibrated reference thermometer.
Can these sensors work outdoors?
The sensors themselves can operate in the full -40°C to +85°C range, but the breakout boards and exposed components need protection from moisture. For outdoor deployment, house the sensor in a weatherproof enclosure with adequate ventilation for accurate readings. The BME680’s gas sensor is particularly sensitive to moisture and should be protected from direct water exposure.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.