The Arduino UNO R4 WiFi has two independent I²C buses, and understanding the difference between Wire and Wire1 is essential if you want to use the onboard Qwiic connector correctly.
The short version is:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Wire → main I²C bus → A4 / A5 → also mirrored to SDA / SCL header pins → 5 V logic environment Wire1 → secondary I²C bus → onboard Qwiic connector → 3.3 V |
This is more than a naming detail. The two buses are physically separate peripherals on the Renesas RA4M1 and they operate in different voltage environments.
This guide explains the UNO R4 WiFi I²C architecture, how to scan each bus, how to connect Qwiic and conventional I²C devices, how to use libraries that accept a TwoWire object, and what to check when a sensor works on Wire but not on Wire1.
UNO R4 WiFi I²C at a Glance
| Feature | Main I²C Bus | Qwiic I²C Bus |
|---|---|---|
| Arduino object | Wire |
Wire1 |
| Physical pins | A4 = SDA, A5 = SCL | Qwiic connector |
| Extra header access | SDA/SCL pins on digital-side header | No standard UNO header mirror |
| Internal Arduino pin numbers | A4/A5 | D27 SDA, D26 SCL |
| Logic voltage | 5 V environment | 3.3 V |
| Typical use | Classic Arduino shields and 5 V I²C devices | Qwiic/STEMMA QT sensors and modern 3.3 V modules |
| Can both be used simultaneously? | Yes | |
Why the UNO R4 WiFi Has Two I²C Buses
The UNO family has traditionally exposed I²C on A4 and A5.
Arduino kept that behaviour on the R4 so older shields and wiring remain familiar.
At the same time, modern plug-and-play sensor ecosystems such as Qwiic and STEMMA QT normally operate at 3.3 V.
Rather than force the classic 5 V UNO bus and the 3.3 V Qwiic ecosystem onto the same electrical interface, Arduino gave the R4 WiFi a second I²C bus.
This produces a very useful split:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
legacy / shield I²C ↓ Wire 5 V modern Qwiic sensors ↓ Wire1 3.3 V |
Wire: The Main UNO I²C Bus
The standard Arduino I²C object is:
|
1 2 3 4 |
Wire |
On UNO R4 WiFi, it is available through:
|
1 2 3 4 5 |
A4 = SDA A5 = SCL |
The same electrical bus is also exposed on the dedicated:
|
1 2 3 4 5 |
SDA SCL |
header positions near AREF.
So these are not two additional I²C buses. They are two physical access points to the same main bus.
A4/A5 and SDA/SCL Are the Same Bus
You can connect one sensor to A4/A5 and another sensor to the SDA/SCL header pins and both devices will appear on Wire.
Conceptually:
|
1 2 3 4 5 6 7 8 |
+---- sensor A | Wire -----+ | +---- sensor B |
Both devices must use unique I²C addresses unless they provide a method to change address.
Do Not Use A4/A5 as Analog Inputs While I²C Is Active
A4 and A5 are multifunction pins.
They can be used as analog inputs when the main I²C bus is not being used.
But once Wire owns those pins:
|
1 2 3 4 5 |
A4 = SDA A5 = SCL |
you should not simultaneously treat them as normal ADC inputs.
This is one advantage of the separate Qwiic bus: you can use Qwiic sensors on Wire1 while leaving A4/A5 available for analog work.
Wire1: The Qwiic Bus
The onboard Qwiic connector uses:
|
1 2 3 4 |
Wire1 |
not:
|
1 2 3 4 |
Wire |
This is the single most common source of confusion.
A sensor physically connected to the Qwiic socket will normally not respond to code that only initialises Wire.
Use:
|
1 2 3 4 |
Wire1.begin(); |
UNO R4 WiFi Qwiic Pins
Arduino’s current Wire reference maps the Qwiic bus internally as:
|
1 2 3 4 5 |
D27 = SDA D26 = SCL |
These pins are mainly relevant when reading board definitions or low-level code.
For normal applications, simply use the Qwiic connector and the Wire1 object.
Qwiic Voltage
The UNO R4 WiFi Qwiic connector is a 3.3 V interface.
That matches the normal Qwiic convention and makes it suitable for many modern sensors.
Do not assume that because the main UNO R4 GPIO is 5 V, the Qwiic connector is also 5 V.
It is specifically intended as a 3.3 V sensor bus.
Qwiic Connector Pinout
A standard Qwiic connector carries four signals:
|
1 2 3 4 5 6 7 |
3.3 V GND SDA SCL |
The keyed connector greatly reduces wiring mistakes compared with loose jumper wires.
Many Qwiic modules include two identical connectors, allowing them to be daisy-chained.
Daisy-Chaining Qwiic Sensors
A typical chain looks like:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
UNO R4 WiFi │ Qwiic │ sensor 1 │ sensor 2 │ sensor 3 |
All devices share the same SDA and SCL lines.
The only fundamental addressing requirement is that each active device must have a unique I²C address.
Address Conflicts Still Apply
Qwiic makes wiring easier but does not change how I²C addressing works.
If two identical sensors both use:
|
1 2 3 4 |
0x44 |
and neither allows its address to be changed, connecting both to the same bus creates an address conflict.
Possible solutions include:
- change one device address if supported;
- use an I²C multiplexer such as TCA9548A;
- put one sensor on
Wireand the other onWire1if their voltage requirements allow it.
Two Buses Can Solve Duplicate Address Problems
This is one of the most useful advanced features of the UNO R4 WiFi.
Suppose you have two devices that both use address:
|
1 2 3 4 |
0x40 |
You can put one on:
|
1 2 3 4 |
Wire |
and the other on:
|
1 2 3 4 |
Wire1 |
Because they are separate hardware buses, the address can exist once on each bus without conflict.
Basic Wire Example
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#include <Wire.h> void setup() { Serial.begin(115200); Wire.begin(); } void loop() { } |
This initialises the main A4/A5 I²C bus.
Basic Wire1 Example
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#include <Wire.h> void setup() { Serial.begin(115200); Wire1.begin(); } void loop() { } |
This initialises the secondary Qwiic bus.
Use Both Buses at the Same Time
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include <Wire.h> void setup() { Serial.begin(115200); Wire.begin(); Wire1.begin(); } void loop() { } |
The RA4M1 has separate I²C peripherals behind these two Arduino objects, so they can operate independently.
Basic I²C Write on Wire
For a device at address 0x40:
|
1 2 3 4 5 6 7 8 9 |
Wire.beginTransmission(0x40); Wire.write(0x01); Wire.write(0x55); uint8_t error = Wire.endTransmission(); |
This sends two bytes on the main I²C bus.
The Same Write on Wire1
The equivalent Qwiic-bus operation is simply:
|
1 2 3 4 5 6 7 8 9 |
Wire1.beginTransmission(0x40); Wire1.write(0x01); Wire1.write(0x55); uint8_t error = Wire1.endTransmission(); |
The API is the same because both objects use Arduino’s TwoWire interface.
Reading from a Device
Example using Wire1:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
const uint8_t address = 0x40; Wire1.beginTransmission(address); Wire1.write(0x00); Wire1.endTransmission(false); Wire1.requestFrom(address, (uint8_t)2); if (Wire1.available() >= 2) { uint8_t msb = Wire1.read(); uint8_t lsb = Wire1.read(); uint16_t value = (msb << 8) | lsb; } |
The repeated-start pattern using:
|
1 2 3 4 |
endTransmission(false) |
is common for register-based I²C devices.
Scan the Main Wire Bus
An I²C scanner is one of the fastest troubleshooting tools.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#include <Wire.h> void setup() { Serial.begin(115200); Wire.begin(); Serial.println("Scanning Wire..."); for (uint8_t address = 1; address < 127; address++) { Wire.beginTransmission(address); uint8_t error = Wire.endTransmission(); if (error == 0) { Serial.print("Found 0x"); if (address < 16) Serial.print("0"); Serial.println(address, HEX); } } } void loop() { } |
Scan the Qwiic Wire1 Bus
Use the same scanner but replace Wire with Wire1:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#include <Wire.h> void setup() { Serial.begin(115200); Wire1.begin(); Serial.println("Scanning Wire1 / Qwiic..."); for (uint8_t address = 1; address < 127; address++) { Wire1.beginTransmission(address); uint8_t error = Wire1.endTransmission(); if (error == 0) { Serial.print("Found 0x"); if (address < 16) Serial.print("0"); Serial.println(address, HEX); } } } void loop() { } |
Dual-Bus Scanner
A useful R4-specific diagnostic sketch can scan both buses:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
#include <Wire.h> void scanBus(TwoWire &bus, const char *name) { Serial.print("Scanning "); Serial.println(name); int found = 0; for (uint8_t address = 1; address < 127; address++) { bus.beginTransmission(address); uint8_t error = bus.endTransmission(); if (error == 0) { Serial.print(" 0x"); if (address < 16) Serial.print("0"); Serial.println(address, HEX); found++; } } if (found == 0) { Serial.println(" No devices found"); } } void setup() { Serial.begin(115200); Wire.begin(); Wire1.begin(); scanBus(Wire, "Wire / A4-A5"); scanBus(Wire1, "Wire1 / Qwiic"); } void loop() { } |
This immediately tells you which physical bus a device is actually connected to.
Library Compatibility Is the Main Software Catch
Many Arduino sensor libraries were originally written for boards with only one I²C bus.
Some initialise themselves internally using:
|
1 2 3 4 |
Wire |
and provide no way to select another bus.
Such a library may work perfectly on A4/A5 but fail on the Qwiic connector even though the sensor and wiring are correct.
Look for a TwoWire Parameter
A well-designed multi-bus library often has an initialisation function such as:
|
1 2 3 4 |
sensor.begin(address, &Wire1); |
or:
|
1 2 3 4 |
sensor.begin(Wire1); |
or:
|
1 2 3 4 |
sensor.begin(&Wire1); |
The exact syntax depends on the library.
The important feature is that it accepts a TwoWire object or pointer rather than hard-coding Wire.
Example with a Configurable Library
Conceptually:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include <Wire.h> #include <SomeSensor.h> SomeSensor sensor; void setup() { Wire1.begin(); if (!sensor.begin(0x44, &Wire1)) { // sensor not found } } |
Check the actual sensor-library documentation because parameter order differs between libraries.
What If the Library Hard-Codes Wire?
You have several options:
- Connect the device to the main
Wirebus instead. - Check whether a newer library version adds
Wire1/TwoWiresupport. - Use another library that supports bus selection.
- Modify the library to accept a
TwoWire&orTwoWire*.
For reusable code, option 2 or 3 is usually preferable to maintaining a custom patch forever.
Writing Your Own Bus-Agnostic Driver
If you write your own sensor class, store a reference to the chosen I²C bus.
Conceptually:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
class MySensor { public: MySensor(TwoWire &wire) : _wire(wire) {} bool begin() { _wire.beginTransmission(0x40); return _wire.endTransmission() == 0; } private: TwoWire &_wire; }; |
Then:
|
1 2 3 4 5 |
MySensor sensorA(Wire); MySensor sensorB(Wire1); |
This makes the same driver usable on either R4 I²C peripheral.
I²C Clock Speed
Arduino’s Wire API provides:
|
1 2 3 4 |
setClock() |
to request a bus frequency.
Common values are:
|
1 2 3 4 5 |
100000 // 100 kHz 400000 // 400 kHz |
For example:
|
1 2 3 4 5 |
Wire1.begin(); Wire1.setClock(400000); |
Do Not Assume Every Sensor Supports 400 kHz
Many modern Qwiic devices support Fast-mode 400 kHz, but not every I²C peripheral does.
Check the sensor datasheet before increasing the bus speed.
A chain runs only as fast as the slowest device that must communicate reliably.
Long Qwiic Chains and Clock Speed
I²C was designed for relatively short board-level connections.
As cable length and device count increase, bus capacitance rises.
This slows the SDA/SCL rise time and can make 400 kHz operation unreliable.
If a long chain is unstable:
- reduce I²C clock speed;
- shorten cables;
- reduce device count;
- check pull-up strength;
- use an I²C buffer/extender if the physical installation requires it.
Pull-Up Resistors
I²C SDA and SCL are open-drain signals.
Devices pull the line low but do not actively drive it high.
Pull-up resistors provide the high state.
|
1 2 3 4 5 6 7 8 |
3.3 V or 5 V | pull-up | SDA/SCL |
The correct pull-up voltage is therefore extremely important.
Main Bus Pull-Ups vs Qwiic Pull-Ups
The main Wire bus belongs to the UNO’s 5 V I/O environment.
The Qwiic Wire1 bus belongs to the 3.3 V Qwiic environment.
Do not bridge the two buses together physically.
If you connect SDA from Wire to SDA from Wire1, you defeat the separation and may connect incompatible pull-up voltage domains.
Multiple Modules Mean Multiple Pull-Ups
Many sensor breakout boards include their own I²C pull-up resistors.
Daisy-chain several such modules and the resistors appear in parallel.
For example, four identical 4.7 kΩ pull-ups in parallel are equivalent to approximately:
|
1 2 3 4 5 |
4.7 kΩ / 4 ≈ 1.18 kΩ |
That may be stronger than necessary and increases the current devices must sink when pulling the bus low.
Small Qwiic systems usually work fine, but large chains should not ignore pull-up accumulation.
Mixing 5 V and 3.3 V I²C Devices
Do not decide compatibility based only on the device’s power-supply pin.
You must know:
- the allowed SDA/SCL voltage;
- where the pull-ups are connected;
- whether the breakout includes level shifting;
- whether the device itself is 5 V tolerant.
A sensor powered from 5 V can still have 3.3 V-only I/O, and a 3.3 V sensor breakout may include circuitry that makes it safe on a 5 V bus.
Read the breakout documentation.
Do Not Power a 3.3 V Qwiic Sensor from 5 V Without Checking
The Qwiic connector supplies 3.3 V specifically because many modern sensors are 3.3 V devices.
If you move the same sensor to the main UNO header, do not automatically power it from 5 V.
Some breakouts include regulators and level shifters; some do not.
Wire and Wire1 Can Run at Different Speeds
Because they are independent buses, you can configure them separately.
For example:
|
1 2 3 4 5 6 7 8 |
Wire.begin(); Wire.setClock(100000); Wire1.begin(); Wire1.setClock(400000); |
This is useful when:
- an older 5 V shield only supports 100 kHz;
- modern Qwiic sensors support 400 kHz;
- you want high-rate acquisition on one bus without disturbing the other.
Example: Legacy LCD + Qwiic Sensor
A very natural R4 setup is:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Wire A4/A5 5 V bus ↓ legacy I²C LCD Wire1 Qwiic 3.3 V bus ↓ modern environmental sensor |
Both devices can use the same I²C address if necessary because they are on different buses.
Example: Two Identical Sensors
Suppose two identical sensors are fixed at address:
|
1 2 3 4 |
0x76 |
You can connect:
|
1 2 3 4 5 6 7 8 9 10 |
Sensor 1 → Wire → A4/A5 Sensor 2 → Wire1 → Qwiic |
This can avoid adding an I²C multiplexer.
Only do this if each sensor’s voltage interface is compatible with its selected bus.
Example: Separate Fast and Slow Buses
A project might use:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
Wire @ 100 kHz → LCD → RTC module → slow legacy devices Wire1 @ 400 kHz → IMU → environmental sensor → fast Qwiic peripherals |
The two buses operate independently.
Can Two Devices Have the Same Address on Wire?
No.
If two active devices on the same physical I²C bus respond to the same address, their replies collide.
Use:
- a configurable address;
- separate bus;
- I²C multiplexer;
- enable/shutdown pins if the devices support changing address at startup.
Using a TCA9548A
If you need more than two address-isolated groups, an I²C multiplexer such as the TCA9548A can split one bus into several downstream channels.
For example:
|
1 2 3 4 5 6 7 8 9 10 |
Wire1 ↓ ├── channel 0 → sensor 0x40 ├── channel 1 → sensor 0x40 ├── channel 2 → sensor 0x40 └── channel 3 → sensor 0x40 |
The UNO R4’s dual buses and an external multiplexer can be combined when a project becomes large.
Qwiic vs STEMMA QT
Qwiic and STEMMA QT use the same small 4-pin JST-SH connector style for I²C devices and are commonly electrically compatible.
Arduino’s UNO R4 WiFi Qwiic port is therefore useful with a very broad ecosystem of modules.
Always verify the specific breakout’s voltage and pinout, especially with unusual third-party boards.
Qwiic and Arduino Modulino
Arduino also uses the Qwiic-style connector for Modulino nodes.
This allows plug-and-play expansion without breadboard wiring.
Examples of devices suited to this type of bus include:
- environmental sensors;
- distance sensors;
- IMUs;
- light sensors;
- button modules;
- small displays.
Does Wire1 Mean “Second Connector”?
Not exactly.
The important concept is that Wire1 represents a second hardware I²C controller.
It happens to be routed to the Qwiic connector on UNO R4 WiFi.
This is why its address space and clock configuration are independent from Wire.
Why Some Example Code Fails on Qwiic
A tutorial written for a traditional UNO may contain:
|
1 2 3 4 5 |
Wire.begin(); sensor.begin(); |
If the sensor library internally uses Wire, plugging that sensor into the R4 WiFi Qwiic socket will not magically redirect the library to Wire1.
The physical connector and the software bus must match.
Debugging a Sensor That Is Not Found
Use this sequence:
- Confirm whether the sensor is physically on A4/A5 or Qwiic.
- Use
Wirefor A4/A5 andWire1for Qwiic. - Run an I²C scanner on that exact bus.
- Check the expected device address.
- Check sensor supply voltage.
- Confirm SDA and SCL are not reversed.
- Check pull-ups and cable length.
- Confirm the sensor library can accept the selected
TwoWirebus.
Troubleshooting: Scanner Finds the Sensor but Library Does Not
This normally means the electrical connection is working.
Check:
- library is using the correct bus;
- device address in the library matches the scanner result;
- library supports the sensor revision;
- initialisation requires an extra delay or reset;
- library is hard-coded to
Wire.
Troubleshooting: Wire Works but Wire1 Does Not
Check:
- you called
Wire1.begin(); - the sensor is safe at 3.3 V;
- the library accepts
Wire1; - the Qwiic cable is fully inserted;
- the sensor is actually powered from the connector;
- the device does not require a voltage above 3.3 V.
Troubleshooting: Wire1 Works but Wire Does Not
Check:
- the device tolerates the main 5 V I²C environment;
- A4 and A5 are correctly wired;
- the device does not contain 3.3 V-only pull-ups without level shifting;
- another shield is not pulling SDA/SCL incorrectly;
- A4/A5 are not simultaneously being used as analog inputs.
Troubleshooting: Bus Locks Low
If SDA or SCL remains low, possible causes include:
- miswired sensor;
- device held in reset or brownout;
- damaged peripheral;
- wrong voltage;
- interrupted I²C transaction;
- excessive pull-up loading;
- short circuit.
Power-cycle the peripheral and disconnect devices one at a time until the bus is released.
Troubleshooting: Works at 100 kHz but Fails at 400 kHz
This usually points toward signal integrity or device limitations.
Check:
- sensor maximum I²C speed;
- cable length;
- bus capacitance;
- pull-up resistance;
- number of connected modules.
If 100 kHz is reliable and your data rate is sufficient, there is no obligation to use 400 kHz.
Troubleshooting: Wrong Pull-Up Voltage
This is one of the more dangerous faults.
A 3.3 V-only sensor can be damaged if SDA/SCL are pulled to 5 V and the device is not 5 V tolerant.
Do not mix the main and Qwiic buses just because both speak I²C.
Using an Oscilloscope
For difficult faults, probe SDA and SCL.
A healthy I²C bus should show:
- clean low levels;
- consistent high levels;
- reasonable rise times;
- clock pulses at the configured frequency;
- ACK bits after addressed bytes.
Slow rounded rising edges are a classic sign of excessive bus capacitance or pull-ups that are too weak.
Using a Logic Analyser
A logic analyser with I²C decoding can show:
- device addresses;
- read/write direction;
- register bytes;
- ACK/NACK;
- repeated starts;
- unexpected bus traffic.
This is extremely useful when a scanner succeeds but the high-level library fails during initialisation.
Wire vs Wire1 and the UNO R4 Minima
The focus of this guide is the UNO R4 WiFi because that board has the physical Qwiic connector.
Both R4 variants use the same RA4M1 family and Arduino core, but the WiFi board is the one where the dual-bus distinction is most visible to normal users because Wire1 is presented directly as Qwiic.
For a broader comparison of the boards, see our UNO R4 WiFi vs UNO R4 Minima guide.
Wire1 and Analog Projects
Using Qwiic on Wire1 has another benefit: the main A4/A5 pins remain available for analog inputs.
This is particularly useful in measurement systems where you want:
- A0-A5 for analog sensing;
- Qwiic digital sensors on a separate bus;
- no conflict between I²C and ADC use on A4/A5.
For more on the R4 analog subsystem, see our UNO R4 ADC and DAC guide.
Wire1 and CAN Projects
The Qwiic bus is also useful when the normal headers are crowded by shields or CAN wiring.
A project can combine:
|
1 2 3 4 5 6 7 8 9 10 11 |
CAN → machine/vehicle network Wire → legacy I²C shield Wire1 → 3.3 V Qwiic sensors |
For the CAN side, see our UNO R4 CAN bus guide.
Recommended Architecture for Mixed Sensors
A clean UNO R4 WiFi sensor system might use:
| Device type | Suggested bus |
|---|---|
| Old 5 V Arduino I²C shield | Wire |
| 3.3 V Qwiic sensor | Wire1 |
| Modern STEMMA QT breakout | Wire1 if electrically compatible |
| Two identical fixed-address devices | One on each bus if voltage-compatible |
| Many identical devices | TCA9548A or similar multiplexer |
Best Practices
- Remember that
WireandWire1are separate hardware buses. - Use
Wirefor A4/A5 and the SDA/SCL header pins. - Use
Wire1for the onboard Qwiic connector. - Treat Qwiic as a 3.3 V interface.
- Check library support for a selectable
TwoWireobject. - Run a scanner before blaming the sensor library.
- Use lower clock speeds if long cables or many modules cause instability.
- Watch accumulated pull-up resistance when daisy-chaining many breakouts.
- Do not connect the two buses together electrically.
- Exploit the dual buses to separate voltage domains or duplicate I²C addresses.
Final Thoughts
The UNO R4 WiFi’s dual-I²C architecture is one of those features that seems confusing at first but becomes extremely useful once understood.
The key rule is simple:
|
1 2 3 4 5 6 7 8 9 10 |
Wire = A4/A5 + SDA/SCL = main 5 V UNO I²C bus Wire1 = Qwiic connector = secondary 3.3 V I²C bus |
The two buses can be used simultaneously, can run at different clock speeds and can even host devices with the same I²C address because they are independent peripherals.
The most common software problem is not wiring. It is a sensor library that assumes every Arduino has only one I²C bus and hard-codes Wire.
Whenever possible, use libraries that accept a TwoWire object so you can explicitly select:
|
1 2 3 4 |
Wire |
or:
|
1 2 3 4 |
Wire1 |
With that distinction clear, the Qwiic connector becomes one of the most convenient features of the UNO R4 WiFi: plug in a 3.3 V I²C sensor, initialise Wire1, and leave the classic UNO bus free for shields, 5 V hardware or separate devices.