Skip to content

docs: add I2C environmental sensor HAT tutorial#656

Open
MolhamHamwi wants to merge 2 commits into
tscircuit:mainfrom
MolhamHamwi:molham/i2c-environmental-sensor-tutorial
Open

docs: add I2C environmental sensor HAT tutorial#656
MolhamHamwi wants to merge 2 commits into
tscircuit:mainfrom
MolhamHamwi:molham/i2c-environmental-sensor-tutorial

Conversation

@MolhamHamwi
Copy link
Copy Markdown

Adds a build-focused I2C Environmental Sensor HAT tutorial for BME280-based temperature, humidity, and pressure logging.

Covers:

  • BME280 integration in I2C mode
  • SDA/SCL pull-up resistors
  • local decoupling capacitors
  • optional OLED and external I2C headers
  • PCB layout guidance, Raspberry Pi bring-up, and Python logging example

/claim #602

Validation:

  • bun run build

Copilot AI review requested due to automatic review settings May 23, 2026 08:52
@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 23, 2026 10:04am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tscircuit snippets (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.

Comment on lines +22 to +28
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.
Comment on lines +145 to +147
## 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Ω.
Comment on lines +231 to +235
Install the library with:

```bash
pip3 install adafruit-circuitpython-bme280
```
@MolhamHamwi
Copy link
Copy Markdown
Author

Follow-up update: addressed the Copilot tutorial feedback in eff0887:\n\n- changed the BME280 example from an inaccurate bare soic8 sensor to a common 3.3 V I2C breakout/module modeled as pinrow4 (VCC, GND, SCL, SDA) and documented the bare LGA distinction\n- changed the external connector wording to an unkeyed 1x4 header and added guidance to use keyed cables/connectors when needed\n- added a duplicate I2C pull-up note/DNP guidance for modules with onboard pull-ups\n- updated Raspberry Pi setup to install/use python3-venv and a virtualenv for the CircuitPython library on PEP 668 systems\n\nPR checks are green (build, format-check, type-check, Vercel).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants