> For the complete documentation index, see [llms.txt](https://docs.protoboard.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.protoboard.xyz/tutorials-and-examples/mcu-sensor-regulator.md).

# MCU + Sensor + Regulator

Build a complete Arduino + BME280 sensor + voltage regulator system from library parts and validate every connection.

## Goal

Build a real-world 3-part system from the Protoboard parts library: an **Arduino Uno Rev3** microcontroller, a **BME280** environmental sensor, and an **MCP16251T** boost regulator. You'll wire power and data connections, run DRC, fix any issues, and review the BOM. This is the flagship tutorial; it covers the full Protoboard workflow in depth.

{% hint style="info" %}
**Time:** About 25 minutes. **What you need:** A free Protoboard account. No hardware required.
{% endhint %}

## What you're building

An environmental monitoring system that reads temperature, humidity, and barometric pressure. The MCP16251T voltage regulator steps up a low-voltage source to provide clean 3.3V power to the BME280 sensor, while the Arduino Uno Rev3 communicates with the sensor over the I2C bus (SCL and SDA lines).

This is a common pattern in real hardware projects: a microcontroller needs to talk to a sensor, but the sensor requires a different voltage rail than what the MCU provides directly. The regulator bridges that gap.

{% columns %}
{% column %}

### Parts you'll use

| Part                 | Role                                                |
| -------------------- | --------------------------------------------------- |
| **Arduino Uno Rev3** | Microcontroller: reads sensor data over I2C         |
| **BME280**           | Sensor: measures temperature, humidity, pressure    |
| **MCP16251T**        | Regulator: boosts low voltage to stable 3.3V output |
| {% endcolumn %}      |                                                     |

{% column %}

### Connections you'll make

| Harness               | Type                               |
| --------------------- | ---------------------------------- |
| MCP16251T to BME280   | Power (regulated 3.3V supply)      |
| Arduino Uno to BME280 | Data (I2C bus: SCL, SDA, VCC, GND) |
| {% endcolumn %}       |                                    |
| {% endcolumns %}      |                                    |

***

## Steps

{% stepper %}
{% step %}

### Create a new board

Open Protoboard and click the **Project menu** in the top-left corner. Select **New Board**. Name it "Environmental Sensor Station" or similar.

You'll land on an empty canvas ready for parts.
{% endstep %}

{% step %}

### Search and place the Arduino Uno Rev3

Open the **Parts Bin** (cuboid icon in the left sidebar). Type **"Arduino Uno"** in the search field.

When the **Arduino Uno Rev3** appears, drag it onto the left side of the canvas. Click it once to select it, and glance at the **Inspector** panel on the right. You'll see its full list of interfaces and resources:

* **Electrical domain** with multiple power domains (VIN at 7-12V, 5V regulated, 3.3V output)
* **I2C interface** (master role) with SCL and SDA lines
* **Digital and analog GPIO** resources
* **SPI, UART** interfaces

{% hint style="info" %}
**What matters for this tutorial:** The Arduino's **I2C master** interface and its **5V power domain**. The I2C bus is how the Arduino will communicate with the BME280.
{% endhint %}
{% endstep %}

{% step %}

### Search and place the BME280 sensor

Clear the search in the Parts Bin and type **"BME280"**. Drag the **BME280 Environmental Sensor Breakout** onto the canvas to the right of the Arduino.

The BME280 breakout board (Adafruit variant) has these key properties:

* **Power input:** Accepts 3V to 5.5V (the onboard regulator and level shifters handle the rest)
* **I2C interface** (slave/device role): this is how it reports sensor readings
* **SPI interface** (alternative to I2C; we won't use it in this tutorial)

{% hint style="info" %}
**Why the BME280 is great for beginners:** The Adafruit breakout includes onboard level shifting, so it works with both 3.3V and 5V logic. This makes it forgiving when connecting to the 5V Arduino.
{% endhint %}
{% endstep %}

{% step %}

### Search and place the MCP16251T voltage regulator

Clear the search and type **"MCP16251T"**. Drag the **MCP16251T-I/CH** onto the canvas between the Arduino and the BME280 (or below them, wherever feels natural).

The MCP16251T is a synchronous boost regulator from Microchip:

* **Input range:** 0.35V to 5.5V (can start from a single-cell battery)
* **Output:** Adjustable 1.8V to 5.5V (we'll use it configured for 3.3V)
* **Role:** Steps up a low-voltage source to provide clean, regulated power

{% hint style="warning" %}
**Why include a regulator?** In a real design, you might power this system from a coin cell or a depleted battery. The MCP16251T ensures the BME280 gets a stable 3.3V even as the input voltage sags. Protoboard lets you model this power chain and validate that voltages are compatible.
{% endhint %}
{% endstep %}

{% step %}

### Connect the regulator to the sensor (power harness)

Now create the first harness: the **power connection** from the MCP16251T to the BME280.

1. Hover near the edge of the **MCP16251T** part until a **connection handle** appears
2. Click and drag toward the **BME280** to create a harness
3. Protoboard auto-detects compatible interfaces; it should find the regulator's **power output** and the sensor's **power input**

In the **Inspector** panel, review the proposed interface link. You should see:

* The regulator's output power domain paired with the BME280's input power domain
* Function links for **VOUT to VIN** and **GND to GND**

{% tabs %}
{% tab title="If auto-detect works" %}
Great. The interface link is created and function links are proposed. Review them in the Inspector to make sure the power output role connects to the power input role.
{% endtab %}

{% tab title="If you need to link manually" %}
Select the harness, open the Inspector, and create the interface link yourself. Pair the MCP16251T's power output interface with the BME280's power input interface. Then create function links mapping VOUT to VIN and GND to GND.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**What this harness represents:** In real hardware, this would be a pair of wires (power and ground) running from the regulator's output to the sensor's power input. The MCP16251T provides clean 3.3V; the BME280 accepts 3-5.5V on its VIN.
{% endhint %}
{% endstep %}

{% step %}

### Connect the Arduino to the BME280 (I2C data harness)

Create the second harness: the **I2C data connection** from the Arduino Uno Rev3 to the BME280.

1. Hover near the edge of the **Arduino Uno Rev3** until a handle appears
2. Drag toward the **BME280** to create a harness
3. Protoboard should auto-detect the **I2C** interfaces on both parts

This is a data connection, not just power. The interface link should pair:

* Arduino's **I2C master** interface with the BME280's **I2C slave** interface

The function links inside should map:

| Arduino (Master)  | BME280 (Slave)    | Signal        |
| ----------------- | ----------------- | ------------- |
| SCL output        | SCL input         | Clock line    |
| SDA bidirectional | SDA bidirectional | Data line     |
| VCC (5V)          | VCC               | Bus power     |
| GND               | GND               | Common ground |

{% hint style="info" %}
**Role matching in action:** Notice that the Arduino's I2C role is **master** and the BME280's role is **slave** (or **device**). This complementary pairing is one of Protoboard's compatibility rules. Two masters can't connect to each other; you'd get an INCOMPATIBLE error.
{% endhint %}
{% endstep %}

{% step %}

### Run the Design Rule Check (DRC)

Click the **Board Review** icon (shield icon) in the left sidebar. The DRC engine scans every harness, interface link, and function link on your board.

For each connection, you'll see one of four states:

* **CONFIGURED** (green): fully valid, all functions mapped, roles are complementary
* **PARTIALLY\_CONFIGURED** (amber): some function links exist but others are missing
* **NOT\_CONFIGURED** (red): an interface link exists but no function links have been created
* **INCOMPATIBLE** (red): fundamental mismatch (wrong protocol, conflicting roles, etc.)

{% hint style="warning" %}
**Don't worry if you don't get all green immediately.** It's normal to see amber or red on the first DRC run. The next step walks through the most common issues and how to fix them.
{% endhint %}

**What to look for in the results:**

{% tabs %}
{% tab title="Power harness (Regulator to BME280)" %}
This should ideally show **CONFIGURED**. If it shows **PARTIALLY\_CONFIGURED**, check whether both VOUT-to-VIN and GND-to-GND function links are present.
{% endtab %}

{% tab title="I2C harness (Arduino to BME280)" %}
This might show **PARTIALLY\_CONFIGURED** if resource allocation hasn't been completed. The Arduino has multiple pins that can serve as I2C, and Protoboard needs to know which specific pins you're using (A4 for SDA, A5 for SCL on the Uno).
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### Fix any DRC issues

Here are the most common issues you'll encounter with this build, and how to resolve each one:

**Issue 1: Resource allocation needed (amber)**

The I2C harness may need explicit pin assignment on the Arduino side. The Uno has dedicated I2C pins (A4/SDA, A5/SCL), but Protoboard needs you to confirm the allocation.

**Fix:** Select the I2C harness, open the Inspector, and look for the resource allocation section. Assign the Arduino's A4 pin to SDA and A5 pin to SCL. Alternatively, ask ProtoBot to auto-allocate.

**Issue 2: Voltage domain configuration (amber or red)**

The DRC may flag that the regulator's output voltage domain isn't explicitly configured to match the sensor's expected input range.

**Fix:** Select the MCP16251T on the canvas, open the Inspector, and check its output voltage configuration. Ensure the output is set to a value within the BME280's acceptable input range (3V to 5.5V). A 3.3V output setting works perfectly.

**Issue 3: Missing ground reference (amber)**

If the GND function links aren't present on one or both harnesses, the DRC will flag incomplete connections.

**Fix:** Open each harness in the Inspector and ensure GND-to-GND function links exist for both the power harness and the I2C harness.

{% tabs %}
{% tab title="Fix manually" %}
Select each flagged harness in the Inspector. Use the interface link detail view to add missing function links, assign resources (pins), and configure voltage domains. Re-run DRC after each fix.
{% endtab %}

{% tab title="Let ProtoBot help" %}
Open **ProtoBot** (bot icon in the left sidebar) and try a prompt like:

> "Fix all DRC issues on my board. Allocate I2C pins on the Arduino and make sure voltage domains are configured correctly."

ProtoBot can auto-allocate resources, add missing function links, and suggest configuration changes. It has access to over 100 tools for board manipulation.
{% endtab %}
{% endtabs %}

**Re-run DRC** after making fixes. Repeat until all connections show **CONFIGURED** (green).

{% hint style="success" %}
**All green?** Your 3-part system is fully validated. The regulator provides clean power to the sensor, and the Arduino can communicate with the BME280 over I2C.
{% endhint %}
{% endstep %}

{% step %}

### Review the Bill of Materials (BOM)

Click the **BOM** icon (cart icon) in the left sidebar. You'll see a list of all three parts:

| Part                                 | Manufacturer         | Part Number    | Estimated Cost |
| ------------------------------------ | -------------------- | -------------- | -------------- |
| Arduino Uno Rev3                     | Arduino              | A000066        | Varies         |
| BME280 Environmental Sensor Breakout | Adafruit             | 2652           | Varies         |
| MCP16251T-I/CH                       | Microchip Technology | MCP16251T-I/CH | Varies         |

From the BOM panel you can:

* **Refresh prices** to pull the latest supplier data
* **Export to CSV** for purchasing spreadsheets
* **Export to PDF** for documentation or project proposals
* Review supplier links and availability

{% hint style="info" %}
**Cost note:** Prices vary by supplier and region. The BOM gives you estimates and links; always verify with your preferred distributor before ordering.
{% endhint %}
{% endstep %}
{% endstepper %}

***

## What you just learned

| Concept                 | What it means                                                                 |
| ----------------------- | ----------------------------------------------------------------------------- |
| **Library parts**       | Pre-defined components with full metadata, domains, interfaces, and resources |
| **Power harness**       | A connection that carries voltage and ground between parts                    |
| **Data harness**        | A connection that carries communication signals (I2C, SPI, UART, etc.)        |
| **I2C bus**             | A two-wire protocol (SCL + SDA) with master/slave roles                       |
| **Resource allocation** | Assigning specific physical pins to logical functions                         |
| **Voltage domain**      | A defined voltage range that parts operate within                             |
| **BOM**                 | The bill of materials: your shopping list with costs and suppliers            |

***

## Understanding the architecture

Here's how the three parts relate in this design:

{% columns %}
{% column %}

### Power flow

```
[MCP16251T] --3.3V--> [BME280]
  (boost regulator)      (sensor)
```

The regulator takes a low-voltage input and boosts it to a stable 3.3V for the sensor. This is important when your power source might sag below the sensor's minimum operating voltage.
{% endcolumn %}

{% column %}

### Data flow

```
[Arduino Uno] --I2C--> [BME280]
  (master)               (slave)
```

The Arduino initiates communication over the I2C bus. It sends a request to the BME280's I2C address, and the sensor responds with temperature, humidity, and pressure readings.
{% endcolumn %}
{% endcolumns %}

***

## Common failures

<details>

<summary>The I2C harness shows PARTIALLY_CONFIGURED</summary>

This usually means resource allocation is incomplete. The Arduino needs specific pins assigned to the I2C functions (A4 for SDA, A5 for SCL on the Uno). Select the harness, open the Inspector, and assign the missing resources. Or ask ProtoBot: "Allocate I2C pins on the Arduino."

</details>

<details>

<summary>DRC says INCOMPATIBLE on the power harness</summary>

Check the voltage domain configuration. If the MCP16251T output is configured for a voltage outside the BME280's input range (3V to 5.5V), the DRC will flag it as incompatible. Adjust the regulator's output setting to 3.3V.

</details>

<details>

<summary>I can't find the MCP16251T in the Parts Bin</summary>

Try searching for "MCP16251" (without the full suffix) or "boost regulator" or "Microchip regulator". The AI-powered search understands natural language, so descriptive queries often work better than exact part numbers.

</details>

<details>

<summary>ProtoBot suggests a different regulator</summary>

ProtoBot may suggest alternatives based on your design context. If you want to stick with the MCP16251T for this tutorial, you can ignore the suggestion or explore it. The MCP16251T is a good choice for low-power sensor applications, but there are valid alternatives.

</details>

<details>

<summary>The BME280 shows both I2C and SPI interfaces. Which do I use?</summary>

For this tutorial, use the **I2C** interface. The BME280 breakout supports both protocols, but I2C is simpler (only two data lines vs. four for SPI) and is the standard choice for single-sensor setups. Protoboard won't auto-connect both; it only links interfaces you explicitly choose.

</details>

***

## Taking it further

Once your 3-part system validates clean, try these extensions:

* **Add a second sensor** (e.g., a VL53L0X time-of-flight sensor) to the same I2C bus and see how Protoboard handles multiple devices on one bus
* **Swap the Arduino Uno for a Seeed XIAO ESP32C3** to explore how a different MCU affects compatibility
* **Remove the regulator** and connect the BME280 directly to the Arduino's 3.3V output pin to see how the DRC results change
* **Use ProtoBot** to suggest improvements: "How can I make this design more power-efficient?"

***

## Next steps

* [**Motor Control Chain**](/tutorials-and-examples/motor-control-chain.md): Model a battery-to-motor power flow with real parts
* [**Common DRC Failures**](/tutorials-and-examples/common-drc-failures.md): Learn what broken builds look like and how to fix them
* [**Validation (DRC)**](/user-guide/validation-drc.md): Deep dive into how the design rule check works
* [**ProtoBot Overview**](/protobot/overview.md): Learn how the AI assistant can speed up your workflow


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.protoboard.xyz/tutorials-and-examples/mcu-sensor-regulator.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
