KevsRobots Learning Platform
60% Percent Complete
By Kevin McAleer, 6 Minutes
Four wires and a Β£5 breakout, and your mesh can tell you whether the greenhouse went below freezing last night. This is the most satisfying build in the course.
| BME280 pin | Heltec V3 pin | Wire colour convention |
|---|---|---|
| VCC / VIN / 3V3 | 3V3 | Red |
| GND | GND | Black |
| SDA / SDI | GPIO33 | Blue |
| SCL / SCK | GPIO34 | Yellow |
That is the entire build. Four Dupont jumpers, no resistors, no soldering if your breakout has a pre-fitted header.
Two things to check before you power up:
Voltage. Wire the breakout to 3V3, not 5V. Many BME280 modules include a regulator and tolerate 5V, but the ESP32-S3βs I2C lines are 3.3V logic, and a 5V-referenced bus can damage the microcontroller. 3V3 is always the safe answer here.
Pull-up resistors. I2C needs them, and essentially every BME280 breakout has them fitted on board. If you are using a bare chip rather than a breakout, you need 4.7kΞ© pull-ups from SDA and SCL to 3V3.
This is the one thing to get right. GPIO17 and GPIO18 are the OLEDβs I2C bus. The sensor firmware scans a second, separate bus on GPIO33 and GPIO34.
Wire your BME280 to 17 and 18 - as most generic Heltec tutorials will tell you to - and everything will look correct, the board will boot happily, the screen will work, and sensor list will show nothing at all. It is a frustrating fault precisely because nothing appears broken.
On its own bus your BME280 sits at 0x76 or 0x77, selected by the SDO pin. With only one device on that bus there is nothing to clash with.
With the sensor wired, power the board up and connect the console:
sensor list
You want to see the BME280 appear along with its readings. If it does not, work down the Common Issues at the end of this lesson.
Read a single value:
sensor get <key>
Use the key names exactly as sensor list reported them.
The sensor measures the air immediately around it, which sounds obvious right up until your greenhouse reads 45Β°C because the board is in direct sun.
Do:
Do not:
The classic mistake: mounting the whole thing inside a black plastic box in a greenhouse. You get beautiful, consistent, entirely meaningless data about the inside of a black box.
Keeping the sensor on a short lead away from the board is worth doing. It gets the measurement away from the boardβs own warmth and puts it in the air you actually care about.
Keep the lead short though. I2C is designed for centimetres, not metres. Under about 30cm is comfortable; a metre may work; several metres will not.
Temperature is the reliable one. Expect around Β±1Β°C accuracy from a BME280, which is more than adequate for βdid it freeze?β.
Humidity takes time to settle. Move the sensor from indoors to outdoors and it may take several minutes to stabilise. A step change in the reading is often the sensor catching up, not the weather.
Pressure is far more precise than it is accurate. The absolute figure may be off by a few hPa, but the trend is excellent - and the trend is what tells you weather is coming.
Self-heating is real. A BME280 sitting on a warm board reads high, often by a degree or two. This is the main argument for the short lead.
sensor list, and confirm all three readings appear.Problem: sensor list shows no BME280.
Solution: Check all four wires, confirm 3V3 not 5V, then reboot.
Why: Detection runs at boot only. A correct wiring job done after power-on looks identical to a broken one until you reset.
Problem: Everything looks right but sensor list is empty, and the screen still works fine.
Solution: Check you used GPIO33 and GPIO34, not GPIO17 and GPIO18.
Why: The OLED and the sensors are on different buses. A working screen tells you nothing about your sensor wiring, and the OLED bus is the one most tutorials name.
Problem: Temperature reads 2Β°C higher than a thermometer next to it.
Solution: Move the sensor away from the board, onto a short lead in free air.
Why: Self-heating from the boardβs regulator and radio. It is the single most common cause of a sensor that reads plausibly but consistently high.
Problem: Humidity is pinned at 100%.
Solution: Check for condensation on the sensor, and let it dry out somewhere warm.
Why: A saturated sensing element reads 100% until the moisture leaves. It usually recovers; repeated soaking degrades accuracy permanently.
Problem: I get temperature and pressure but no humidity.
Solution: You have a BMP280, not a BME280.
Why: The two share a breakout footprint and a bus address. Both have a hole in the lid, so that is not the tell - the BME280 is square with a centred hole, the BMP280 rectangular with a corner one. In practice, missing humidity data is the diagnosis.
You can use the arrows β β on your keyboard to navigate between lessons.
Comments