Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsThe Nicla Sense ME carries Bosch's BME688 gas sensor, a BHI260AP smart sensor hub, a pressure sensor and a magnetometer. Bosch's BSEC software runs on the hub and turns the gas sensor's readings into an indoor air quality (IAQ) index and an estimated CO2 equivalent. The Arduino_BHY2 library reads all of this. The sketch prints IAQ, temperature, humidity and pressure every few seconds.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB, or a small LiPo on its battery connector.
air_index.inoVerify & upload in Electrolark#include <Arduino_BHY2.h>
SensorBSEC bsec(SENSOR_ID_BSEC);
Sensor temp(SENSOR_ID_TEMP), hum(SENSOR_ID_HUM), baro(SENSOR_ID_BARO);
void setup() {
Serial.begin(115200);
BHY2.begin();
bsec.begin(); temp.begin(); hum.begin(); baro.begin();
}
void loop() {
static unsigned long last = 0;
BHY2.update();
if (millis() - last < 3000) return;
last = millis();
Serial.print("IAQ "); Serial.print(bsec.iaq());
Serial.print(" (accuracy "); Serial.print(bsec.accuracy()); Serial.print(") CO2eq "); Serial.print(bsec.co2_eq());
Serial.print(" ppm "); Serial.print(temp.value(), 1); Serial.print(" C ");
Serial.print(hum.value(), 0); Serial.print(" % "); Serial.print(baro.value(), 1); Serial.println(" hPa");
}
Normal at first; leave it running for a few hours.
Double-tap the reset button to enter the bootloader.
The board warms itself slightly; keep it away from the USB charger.
No, it is estimated from VOCs; use an NDIR or photoacoustic sensor for true CO2.
Yes, it has a LiPo charger and is made for wearables.
Yes, it has Bluetooth LE; the library has BLE examples.
1 part: Arduino Nicla Sense ME ABX00050 Dev Board. On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 1 hour. The build on this page has 5 steps.
No. This page has the complete, tested code (air_index.ino).
About ₹4,599 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
What an IAQ index means; Using a smart sensor hub; Why gas sensors need a burn-in period.
Your first MicroPython project: temperature and humidity on an OLED.
A web page with ON and OFF buttons that switches a relay over Wi-Fi.
A warm ring light that fades up at dusk and down at dawn.
Turn a Pi and a touchscreen into a home command centre with a clock and to-do list.
Learning project. Check every circuit and the datasheet of each part before you power it up.