docs: add I2C environmental sensor HAT tutorial#656
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a new Raspberry Pi HAT tutorial documenting an I2C environmental sensor design centered around a BME280, including supporting passives, optional headers, layout guidance, and a basic Raspberry Pi/Python bring-up flow.
Changes:
- Added a new MDX tutorial for an I2C Environmental Sensor HAT (BME280 + pull-ups + decoupling + optional OLED/external header).
- Embedded interactive
tscircuitsnippets (3D overview + schematic-focused step). - Included PCB layout guidance, Raspberry Pi I2C enablement steps, and a Python logging example.
Comments suppressed due to low confidence (1)
docs/tutorials/pi-hats/i2c-environmental-sensor-hat.mdx:131
- Same issue as above in the Step 2 snippet:
footprint="soic8"/pin labeling for BME280 does not match the actual BME280 package/pinout, which can mislead readers into generating an unusable board. Align the footprint and labeled pins with the real BME280 (or model a breakout/module explicitly).
<chip
name="U1"
manufacturerPartNumber="BME280"
footprint="soic8"
pinLabels={{ pin1: ["SDA"], pin2: ["SCL"], pin3: ["GND"], pin4: ["VCC"], pin5: ["CSB"], pin6: ["SDO"] }}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| manufacturerPartNumber="BME280" | ||
| footprint="soic8" | ||
| pinLabels={{ | ||
| pin1: ["SDA"], | ||
| pin2: ["SCL"], | ||
| pin3: ["GND"], | ||
| pin4: ["VCC"], |
|
|
||
| ## Overview | ||
|
|
||
| This tutorial walks through a compact Raspberry Pi HAT for logging temperature, relative humidity, and barometric pressure with a BME280 over I2C. The design includes the support parts that make an I2C sensor board reliable in the field: local decoupling, SDA/SCL pull-up resistors, an optional OLED display header, and a keyed external header for mounting the sensor away from the Pi. |
| ## Step 3: Add I2C pull-up resistors | ||
|
|
||
| I2C lines are open-drain, so the bus needs pull-ups. Use 4.7 kΩ as a good default for a short Pi HAT. If you add long cables or several modules, verify rise time with an oscilloscope and consider stronger pull-ups such as 2.2 kΩ. |
| Install the library with: | ||
|
|
||
| ```bash | ||
| pip3 install adafruit-circuitpython-bme280 | ||
| ``` |
|
Follow-up update: addressed the Copilot tutorial feedback in |
Adds a build-focused I2C Environmental Sensor HAT tutorial for BME280-based temperature, humidity, and pressure logging.
Covers:
/claim #602
Validation: