If you are searching for the Arduino Pinbelegung (the German term for pinout assignment), you already know that plugging a sensor into the wrong header can fry your board or cause silent communication failures. While the physical 14-pin digital and 6-pin analog headers have remained mechanically identical since the original Uno, the internal silicon routing and electrical limits between the classic Uno R3 (ATmega328P) and the modern Uno R4 Wi-Fi (Renesas RA4M1) are radically different.
The direct answer to your pinout query: The physical pin locations are identical, but the Uno R4 operates on a 3.3V logic core (with 5V tolerant I/O), while the Uno R3 is a native 5V logic device. Misunderstanding this logic-level shift is the number one cause of I2C bus lockups when upgrading from an R3 to an R4. Below is the definitive electrical pinout guide, followed by a complete, tested I2C sensor build to verify your wiring.
The Definitive Arduino Pinbelegung Table (Uno R3 vs R4)
This table maps the physical header pins to their internal silicon functions and highlights the electrical gotchas that destroy sensors. Keep this bookmarked on your bench.
| Pin Label | Uno R3 (ATmega328P) Function | Uno R4 Wi-Fi (RA4M1) Function | Electrical Limits & Bench Gotchas |
|---|---|---|---|
| 5V | 5V Power (USB/VIN dependent) | 5V Power (USB-C buck converter) | R4 can source up to 1A safely. R3 uses a linear regulator; drawing >500mA from VIN will cause thermal shutdown. |
| 3.3V | 3.3V Output (Max 150mA) | 3.3V Output (Max 500mA) | Critical: Never draw >150mA from the R3 3.3V pin. It is tapped from the onboard USB-to-Serial chip and will brownout the ATmega16U2. |
| A4 (SDA) | I2C Data (Native 5V logic) | I2C Data (3.3V native, 5V tolerant) | R4 requires 3.3V I2C pull-ups. If your breakout board has hardcoded 5V pull-ups, you risk damaging the R4's RA4M1 GPIO over time. |
| A5 (SCL) | I2C Clock (Native 5V logic) | I2C Clock (3.3V native, 5V tolerant) | Same as SDA. Use a logic level shifter (like the BSS138) if interfacing with strict 5V industrial I2C equipment on the R4. |
| D0 (RX) | Hardware UART0 RX | Hardware UART0 RX | Do not use for GPIO if Serial is active. On the R4, this routes to the ESP32-S3 USB bridge. |
| D1 (TX) | Hardware UART0 TX | Hardware UART0 TX | Same as RX. Disconnect external wiring on D0/D1 before uploading sketches via USB to prevent bootloader sync errors. |
| D8-D13 | Digital I/O / Hardware SPI | Digital I/O / Hardware SPI | R4 SPI runs at higher base clock speeds. Watch for signal integrity and crosstalk on long, unshielded jumper wires. |
Serial object, you are communicating through the ESP32-S3. For direct hardware debugging, refer to the official Arduino Uno R4 Wi-Fi Documentation to map the internal UART bridges.
Hardware Build: I2C Sensor & Display Wiring
To prove out your Pinbelegung, we will wire an environmental sensor and an OLED display to the I2C bus. This build targets the Arduino Uno R4 Wi-Fi (ABX00087), but the code and wiring are backward-compatible with the Uno R3 if you adjust the logic-level assumptions.
Exact Parts List
- Microcontroller: Arduino Uno R4 Wi-Fi (Part: ABX00087)
- Sensor: Adafruit BME280 I2C Breakout (Product ID: 2652) - Includes onboard 3.3V regulator and I2C pull-ups.
- Display: 0.96" SSD1306 128x64 I2C OLED (Standard 4-pin header, Address: 0x3C)
- Wiring: 22 AWG solid core jumper wires (Dupont female-to-female)
Wiring Steps
- De-energize the board. Unplug the USB-C cable before making I2C connections to prevent latch-up on the SSD1306 controller.
- Connect Power: Wire the BME280
VINand OLEDVCCto the Arduino 5V pin. Wire bothGNDpins to the Arduino GND header. - Connect I2C Data (SDA): Wire the BME280
SDIand OLEDSDAto Arduino pin A4. - Connect I2C Clock (SCL): Wire the BME280
SCKand OLEDSCLto Arduino pin A5. - Verify Pull-ups: The Adafruit BME280 has 10kΩ pull-ups tied to 3.3V. Most cheap SSD1306 OLEDs have 4.7kΩ pull-ups tied to VCC (5V). Because the R4 is 5V tolerant on A4/A5, this mixed pull-up voltage will work for short bench wires, but for permanent installs, use a dedicated 3.3V I2C bus.
Compilable Code with Error Handling
This sketch initializes both devices, reads temperature and pressure, and renders the data on the OLED. It includes explicit pin definitions and robust I2C initialization checks to catch wiring faults immediately.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// --- PIN DEFINITIONS & ADDRESSES ---
#define PIN_I2C_SDA A4
#define PIN_I2C_SCL A5
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C
#define BME_ADDRESS 0x77 // Adafruit breakouts default to 0x77; cheap clones often use 0x76
// --- OBJECT INSTANTIATION ---
Adafruit_BME280 bme;
Adafruit_SSD1306 display(128, 64, &Wire, OLED_RESET);
void setup() {
Serial.begin(115200);
while (!Serial) delay(10); // Wait for serial port to connect (R4 native USB behavior)
// Initialize I2C bus with explicit pins for clarity
Wire.begin(PIN_I2C_SDA, PIN_I2C_SCL);
// --- BME280 INITIALIZATION WITH ERROR HANDLING ---
if (!bme.begin(BME_ADDRESS, &Wire)) {
Serial.println("ERROR: Could not find a valid BME280 sensor, check wiring!");
Serial.println("Hint: Verify I2C address (0x76 vs 0x77) and SDA/SCL continuity.");
while (1) { delay(10); } // Halt execution to prevent reading garbage data
}
Serial.println("BME280 initialized successfully.");
// --- OLED INITIALIZATION WITH ERROR HANDLING ---
if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println("ERROR: SSD1306 allocation failed. Check I2C address and pull-ups.");
while (1) { delay(10); }
}
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
}
void loop() {
float tempC = bme.readTemperature();
float pressureHpa = bme.readPressure() / 100.0F;
// Print to Serial for plotter/debugging
Serial.print("Temp: "); Serial.print(tempC);
Serial.print(" C | Pressure: "); Serial.print(pressureHpa); Serial.println(" hPa");
// Render to OLED
display.clearDisplay();
display.setCursor(0, 0);
display.println("Env Monitor R4");
display.drawLine(0, 12, 127, 12, SSD1306_WHITE);
display.setCursor(0, 18);
display.print("Temp: "); display.print(tempC, 1); display.println(" C");
display.setCursor(0, 32);
display.print("Pres: "); display.print(pressureHpa, 1); display.println(" hPa");
display.display();
delay(1000);
}
Debugging: When Your Pinbelegung Fails
I2C is an open-drain protocol. It doesn't push voltage high; it relies on pull-up resistors to bring the line high, and the microcontroller pulls it low. If your Pinbelegung is correct but the bus fails, you will see this exact error string in your Serial Monitor:
ERROR: Could not find a valid BME280 sensor, check wiring!
Hint: Verify I2C address (0x76 vs 0x77) and SDA/SCL continuity.
The First Three Things to Check
- Measure Pull-Up Voltage: Set your multimeter to DC Volts. Measure between GND and the SDA line. It should read ~3.3V (if using Adafruit breakouts) or ~5V (if using cheap clone OLEDs). If it reads 0V or floating millivolts, your pull-up resistors are missing or broken.
- Run an I2C Scanner: Upload the standard Arduino
I2CScannerexample. If the scanner hangs indefinitely, your SDA line is being held low by a stuck sensor or a short to ground. If it returns "No I2C devices found", your address is wrong or the wires are crossed. - Check Continuity: De-energize the board. Set your multimeter to continuity/resistance. Probe from the Arduino A4 header to the sensor SDA pin. It must read < 1 ohm. Repeat for A5 to SCL.
Ranked Causes for I2C Failure
| Rank | Cause | Fix / Measurement Threshold |
|---|---|---|
| 1 | Wrong I2C Address | Check datasheet. Adafruit BME280 is 0x77. Bosch raw chips and cheap clones are often 0x76. Change the #define in code. |
| 2 | SDA/SCL Swapped | Swap the physical wires on A4 and A5. I2C will not auto-negotiate crossed lines. |
| 3 | Missing Pull-ups | Add external 4.7kΩ resistors from SDA to 3.3V and SCL to 3.3V. Bus capacitance >400pF requires lower resistance (e.g., 2.2kΩ). |
| 4 | Logic Level Mismatch | If using a strict 5V sensor on an Uno R4 (3.3V core), the R4 may not recognize the 5V HIGH signal if it exceeds VCC + 0.5V tolerance. Use a BSS138 level shifter. |
Extending and Simplifying the Build
Once your baseline Pinbelegung and I2C bus are verified, you will inevitably want to add more sensors. Here is how to scale the project up or strip it down for production.
How to Extend: Adding Multiple Identical Sensors
The BME280 only has one address select jumper, meaning you can only put two on a single I2C bus (0x76 and 0x77). To monitor temperature in three different rooms or enclosures, you need an I2C multiplexer. Add a TCA9548A I2C Multiplexer (Adafruit Product ID: 2717) to your primary A4/A5 bus. The TCA9548A acts as a digital switch, allowing you to route the I2C signals to up to 8 separate sub-buses, each capable of hosting a BME280 at the same address. Refer to the Adafruit BME280 Wiring Guide for multiplexer library examples.
How to Simplify: Drop the OLED for Data Logging
OLED displays consume ~20mA and add I2C bus capacitance. If you are building a remote weather station powered by a 3.7V LiPo battery, drop the SSD1306 entirely.
Instead, use the Uno R4 Wi-Fi's native capabilities to push data via MQTT, or simply use the Arduino IDE Serial Plotter (Ctrl+Shift+L). By formatting your Serial.print statements with comma-separated values (e.g., Serial.print(tempC); Serial.print(","); Serial.println(pressureHpa);), the IDE will automatically render a real-time, multi-axis graph of your environmental data without requiring external display hardware.






