Arduino UNO R4 WiFi Pinout Reference

The Arduino UNO R4 WiFi represents a major leap forward for the maker community, bringing seamless wireless connectivity to the classic UNO form factor. Just like its sibling, the UNO R4 Minima, it marks the definitive transition from the older 8-bit AVR architecture (the ATmega328P found in the Arduino UNO R3) to a modern and much more powerful 32-bit Arm Cortex-M ecosystem.

By integrating the powerful Renesas RA4M1 microcontroller alongside an ESP32-S3 coprocessor, the UNO R4 WiFi delivers a massive boost in speed, memory, and capabilities, while adding robust Wi-Fi and Bluetooth Low Energy (BLE) functionality.

In addition to wireless features, the UNO R4 WiFi retains the expanded capabilities of the R4 platform such as CAN bus, OPAMP, DAC, and HID support via USB. It also adds board-specific features like the built-in 12×8 LED matrix and a Qwiic connector.

However, this extra capability also means there are important differences to understand before wiring projects by habit. In particular, the UNO R4 WiFi introduces changes in power supply architecture, signal domains (including interaction between the 5 V RA4M1 side and the 3.3 V ESP32-S3 side), and GPIO current limits. If you are migrating from the Arduino UNO R3, you need to pay close attention to the pinout to safely and effectively leverage these new features.

Arduino UNO R4 WIFi Pinout

The UNO R4 WiFi has a total of 35 pins. The pinout is as follows:

arduino uno r4 wifi pinout

Let’s take a closer look at the Arduino pins and their functions, starting with the digital pins.

Arduino UNO R4 WIFi Digital I/O Pins

The UNO R4 WiFi includes 14 digital I/O pins, labeled D0 through D13.

arduino uno r4 wifi digital io pins

You can configure these pins to act as either Inputs or Outputs. When a pin is set as an input, it can read digital signals, such as whether a button is pressed or not. When a pin is set as an output, it can send digital signals to control other devices like LEDs, motors, or relays.

To use a digital pin, you first need to tell the Arduino how that pin should behave using the pinMode() function. If you want to set a pin as an input, you use pinMode(pin, INPUT), and then you can read the pin’s state using the digitalRead(pin) function. If you want to set a pin as an output, you use pinMode(pin, OUTPUT). You can then control the pin by writing digitalWrite(pin, HIGH) to turn it on or digitalWrite(pin, LOW) to turn it off.

When using digital I/O pins, there are a few important electrical limits to keep in mind. These pins operate at 5V logic level. Each digital pin can safely handle up to 8 mA of current, and all the digital pins together should not exceed a total of 60 mA.

This is an important difference compared to the ATmega328P microcontroller used on the UNO R3, where each pin could typically handle between 20 and 40 mA. If you are migrating from the UNO R3, you must be careful not to directly drive high-current loads (like low-resistance optocouplers or multiple LEDs) without using proper current-limiting resistors or driver transistors. If you exceed the 8 mA limit, the voltage on the pin may drop unexpectedly, or you could permanently damage the microcontroller’s internal output drivers.

Internal Pull-up Resistors

Each digital pin on the UNO R4 WiFi includes a built-in pull-up resistor. This feature is especially useful when a pin is used as an input and nothing is connected to it. Without a pull-up resistor, an input pin can “float”, which means it may randomly switch between HIGH and LOW because of electrical noise in the environment. This can cause unpredictable and confusing results.

The internal pull-up resistor helps solve this problem by gently pulling the voltage of the pin up to HIGH when no other signal is present. This keeps the input reading stable and reliable. When you connect a button or switch, pressing it can pull the pin down to LOW, allowing the Arduino to clearly detect a change.

To turn on the internal pull-up resistor, you use pinMode(pin, INPUT_PULLUP) instead of just pinMode(pin, INPUT).

Please note that the value of this internal pull-up resistor is not fixed, but it is usually around 20 kΩ.

Arduino UNO R4 WIFi Interrupt Pins

Interrupt pins are special digital input pins that can trigger a specific block of code (an interrupt service routine or ISR) when an external event occurs, such as a change in voltage level (HIGH to LOW or vice versa). This allows the Arduino to respond immediately to events without constantly checking the pin’s state in the main loop of your code.

The UNO R4 WiFi has two primary external interrupt pins, located on pins 2 and 3:

arduino uno r4 wifi interrupt pins

The UNO R4 WiFi supports four trigger modes that determine when your ISR executes, as shown in the table below:

ModeTrigger ConditionTypical Use Cases
RISINGPin transitions from LOW to HIGHButton press detection (pull-down)
FALLINGPin transitions from HIGH to LOWButton press detection (pull-up)
CHANGEPin changes state (either direction)Encoder reading, pulse counting
LOWPin remains at LOW levelLevel-triggered events

To set up an interrupt, the Arduino uses a function called attachInterrupt(interrupt, ISR, mode). In this function, the interrupt value tells the Arduino which interrupt to use, where interrupt 0 corresponds to digital pin 2 and interrupt 1 corresponds to digital pin 3. The ISR is the name of the function that should run when the interrupt happens. The mode defines how the interrupt is triggered, such as RISING, FALLING, CHANGE, or LOW.

It is also important to understand that the UNO R4 WiFi uses a modern Cortex-M4-based microcontroller, which includes a system called a Nested Vector Interrupt Controller, or NVIC. This system is far more sophisticated and supports interrupts on almost every digital and analog pin. However, to keep things simple and familiar for users, the Arduino software mainly focuses on pins D2 and D3 for external interrupts, matching the behavior of the classic UNO boards.

Arduino UNO R4 WIFi PWM Pins

PWM (Pulse-Width Modulation) pins on the UNO R4 WiFi are digital pins that can simulate analog output. They do this by switching the pin between HIGH and LOW extremely fast; so fast that it appears as a steady voltage somewhere in between. The key idea behind PWM is the duty cycle, which is the percentage of time the signal stays HIGH during one complete cycle. By varying the duty cycle, you can control the average voltage delivered to a connected component, allowing you to dim LEDs, control motor speeds, and even generate simple audio tones.

The UNO R4 WiFi provides 6 PWM-capable pins: D3, D5, D6, D9, D10, and D11. You can easily spot these on the board by the tilde symbol (~) printed next to the pin number.

arduino uno r4 wifi pwm pins

Note:

Please note that the D0, D1, D2, D4, D7, D8, D12, D13, SDA, and SCL pins are PWM capable, but they may interfere with other functionalities on the UNO R4 WiFi board. Therefore, you should avoid using these pins as they are not officially supported PWM pins.

To generate a PWM signal, you first need to set the desired PWM pin as an output using the pinMode(pin, OUTPUT) function inside the setup() part of your sketch. After that, you use the analogWrite(pin, value) function to set the PWM output. In this function, pin is the PWM-capable pin number, and value controls the duty cycle.

By default, the PWM resolution on the UNO R4 WiFi is set to 8 bits. This means PWM values range from 0 to 255. This ensures that code written for older Arduino boards works perfectly without modification.

However, the UNO R4 WiFi is more powerful and allows you to increase the PWM resolution. By using the analogWriteResolution() function, you can increase the resolution up to 12 bits, which allows values from 0 to 4096 and gives you finer control over the output.

analogWriteResolution(12);  //Sets the PWM resolution to 12 bits
analogWriteResolution(8);   //Sets the PWM resolution to 8 bits (default)

Arduino UNO R4 WIFi ADC Pins

Analog input pins on the UNO R4 WiFi are used to read continuous analog signals. These signals usually come from sensors that measure physical quantities such as temperature, light intensity, sound, or pressure. Unlike digital signals, which are only HIGH or LOW, analog signals can have many different voltage levels. To understand these signals, the Arduino uses a built-in Analog-to-Digital Converter, or ADC, which converts the analog voltage into a digital number that your program can use.

The UNO R4 WiFi has six analog input pins, labeled A0 through A5.

arduino uno r4 wifi adc pins

To read an analog value from a pin, you use the analogRead(pin) function. This function returns an integer value that represents the voltage on the selected pin.

By default, the ADC on the UNO R4 WiFi uses a 10-bit resolution for backward compatibility. With a 10-bit resolution, the returned value ranges from 0 to 1023. This means that an input voltage between 0 and 5 V is divided into 1024 equal steps. At this setting, the Arduino can detect voltage changes as small as 4.9 mV.

However, the R4 WiFi is much more powerful than its predecessors. You can boost the resolution up to 12 bits or even 14 bits, which allows the Arduino to detect much smaller changes in voltage. At 14-bit resolution, the voltage step size is approximately 0.3 mV when using a 5 V range. To change the ADC resolution, you use the analogReadResolution() function inside the setup() part of your sketch.

analogReadResolution(10); //(default)
analogReadResolution(12);
analogReadResolution(14);

It is also worth remembering that if you run out of standard digital pins, pins A0 through A5 can function as regular digital I/O pins as well.

Changing Analog Reference Voltage

By default, the UNO R4 WiFi measures analog voltages using a reference range of 0 to 5V (board’s 5V supply). This reference voltage determines the maximum voltage the ADC can measure. In some cases, such as if you’re using a sensor that operates at a lower voltage (like 3.3V), you may want to measure lower voltages more accurately.

To do this, you can change the analog reference voltage using the AREF pin and the analogReference(type) function.

analogReference(AR_DEFAULT);   //Uses the default analog reference of 5V.
analogReference(AR_INTERNAL);  //Uses an internal reference voltage of 1.5V.
analogReference(AR_EXTERNAL);  //Uses an external reference voltage applied to the AREF pin.

Arduino UNO R4 WIFi DAC Pin

The UNO R4 WiFi includes a built-in Digital-to-Analog Converter (DAC). A DAC does the opposite of an ADC: instead of reading an analog voltage and turning it into a number, it takes a digital value and converts it into a smooth analog voltage. This is a massive upgrade for the UNO R4 WiFi, making it perfect for projects like generating smooth sine waves, controlling Voltage Controlled Oscillators (VCOs) in synthesizers, or providing a variable reference voltage.

On the UNO R4 WiFi, the DAC is available on the A0 analog pin.

arduino uno r4 wifi dac pin

To use the DAC, you actually use the exact same analogWrite(pin, value) function that you use for generating PWM signals.

analogWrite(pin, value);

By default, the DAC pin operates at an 8-bit resolution, meaning it accepts values between 0 and 255. For example, writing a value of 0 will output close to 0 V, while writing 255 will output close to 5 V. A value around 127, which is roughly the middle of the range, will output about 2.5 V on the A0 pin.

For some applications, especially audio projects, an 8-bit resolution may not provide smooth enough output. In those cases, the UNO R4 WiFi allows you to increase the DAC resolution up to 12 bits. When using 12-bit resolution, the values you write to the pin will range from 0 to 4095, giving you incredibly fine control over the output voltage.

analogWriteResolution(12);

Just keep in mind that if you are using A0 as a DAC output, you cannot simultaneously use it as an analog input to read sensors.

Arduino UNO R4 WIFi OP-Amp Pins

One of the most powerful new features of the R4 WiFi is the inclusion of an Operational Amplifier (op-amp). Having a built-in op-amp saves you from needing external chips for tasks like buffering signals, amplifying weak sensor data, filtering noise, or performing many other analog tasks.

While the microcontroller used on the UNO R4 WiFi, the Renesas RA4M1, actually has four internal op-amps, the board exposes one of them for you to use on the analog header. Specifically, it uses A1 as the positive (Non-Inverting) input, A2 as the negative (Inverting) input, and A3 as the output.

arduino uno r4 wifi opamp pins

To start using the op-amp on the UNO R4 WiFi, you need to include the OPAMP.h library in your sketch and then initialize it using the OPAMP.begin(speed) function. The optional speed parameter allows you to choose between different operating modes. You can select OPAMP_SPEED_LOWSPEED for lower power usage or OPAMP_SPEED_HIGHSPEED for faster performance with higher power consumption.

#include <OPAMP.h>

void setup () {
  OPAMP.begin(OPAMP_SPEED_HIGHSPEED);
}

void loop() {
}

Use Cases

One simple way to use the op-amp is as a Voltage Follower, also known as a Buffer, by physically connecting A2 (the minus input) directly to A3 (the output). In this setup, whatever voltage you apply to A1 (the plus input) will be mirrored at the output A3, but with more current-driving capability.

You can also use it to build a Voltage Amplifier to boost a tiny signal. To do this, you connect a 10k resistor between A2 and ground, and a second 10k resistor between A3 and A2. With this setup, any signal fed into A1 will appear at A3 with double the amplitude. However, you must be careful when amplifying signals. The output voltage should not exceed approximately 4.7V. If you try to push it higher, the signal will be clipped, and in extreme cases, you could damage the board.

Or you can use the op-amp as a Comparator to compare two input voltages and output a digital-style HIGH or LOW result, or even use it for more advanced circuits such as integrating and differentiating signals.

Ofcorce these examples are just the beginning of what you can do with the built-in op-amp.

Arduino UNO R4 WIFi Capacitive-Touch Pins

The UNO R4 WIFi has 11 capacitive touch-sensing GPIOs: D0, D1, D2, D3, D8, D9, D11, D13, A1, A2, and LOVE_BUTTON (the heart shaped pad on the back of your Arduino).

arduino uno r4 wifi capacitive touch pins

These pins can detect when something conductive, like your finger, comes close to them. They work by measuring a change in capacitance. When your finger gets near the pin, it slightly changes the electrical properties of the circuit, and the board recognizes this change as a touch.

You are not limited to touching the pins directly. If you attach a conductive material such as aluminum foil, conductive fabric, or conductive paint to one of these pins, you can turn that material into a touch pad. This makes it easy to build creative projects, such as custom buttons, touch lamps, or interactive art.

To use the capacitive touch feature in your program, you first need to install and include the Arduino_CapacitiveTouch library. After including the library in your sketch, you create an object from the CapacitiveTouch class and specify which pin you want to use as a touch input. In the setup() function, you call begin() to initialize the sensor and configure the hardware. After everything is set up, you can use the read() function to get the raw sensor value. If you only want to know whether the pin is being touched or not, you can use isTouched(), which compares the sensor reading to a threshold value. You can adjust how sensitive the touch detection is by using the setThreshold(int threshold) function.

#include "Arduino_CapacitiveTouch.h"

CapacitiveTouch touchButton = CapacitiveTouch(D0);

void setup() {
  touchButton.begin();
  touchButton.setThreshold(2000);
}

void loop() {
  int sensorValue = touchButton.read();
  bool isTouched = touchButton.isTouched();
}

Arduino UNO R4 WIFi I2C Pins

One of the most important design improvements in the UNO R4 WiFi is that it includes two separate I2C buses. This change helps solve the long-standing 5 V vs. 3.3 V compatibility issue. Mixing these voltage levels incorrectly can damage sensitive components. By separating the buses, the board allows you to safely connect both types of devices.

The Legacy 5V Bus

The first I2C bus is the traditional 5V bus. On the UNO R4 WiFi, the I2C pins SDA and SCL are connected to analog pins A4 (SDA) and A5 (SCL). These pins are also available near the AREF pin on the board. This bus is available simply to remain compatible with older 5V shields and modules.

arduino uno r4 wifi i2c pins

It is important to know that the UNO R4 WiFi does not include built-in pull-up resistors on the I2C lines by default. However, there are solder pads available on the board if you want to add them yourself.

arduino uno r4 wifi i2c pullup pads

To use the 5V I2C bus, you include the Wire library at the top of your code. Inside the setup() function, you call Wire.begin() to initialize the I2C system. Once I2C is initialized, you can send data to a connected I2C device. Each I2C device has its own address, which tells the Arduino which device it is communicating with. The following example shows how to send data to a device with address 1 and how to properly close the connection afterwards:

#include <Wire.h>

void setup() {
  Wire.begin();

  Wire.beginTransmission(1);  //begin transmit to device 1
  Wire.write(byte(0x00));     //send instruction byte
  Wire.write(val);            //send a value
  Wire.endTransmission();     //stop transmit
}

void loop() {
}

The Qwiic / STEMMA QT Bus

The UNO R4 WiFi also includes a second I2C bus that is connected to the Qwiic/STEMMA QT connector. This connector is designed for easy plug-and-play use with many modern 3.3 V sensors made by SparkFun and Adafruit.

arduino uno r4 wifi qwiic stemma qt connector

Because this second bus is separate from the 5V bus, it protects 3.3V devices from being exposed to 5V signals. This means you can safely use both 5V and 3.3V devices at the same time without needing extra level shifters or special hardware.

If you want to use this Qwiic/STEMMA QT connector, you cannot use the primary Wire object for I2C as you normally would, but instead you’ll need to use secondary Wire1. The rest of the process is the same as for the first bus.

#include <Wire.h>

void setup() {
  Wire1.begin();  //join the second I2C bus

  Wire1.beginTransmission(1);  //begin transmit to device 1
  Wire1.write(byte(0x00));     //send instruction byte
  Wire1.write(val);            //send a value
  Wire1.endTransmission();     //stop transmit
}

void loop() {
}

Arduino UNO R4 WIFi SPI Pins

The UNO R4 WiFi also supports SPI, which stands for Serial Peripheral Interface. SPI is another type of serial communication, and it is generally faster than I2C. SPI uses separate pins for sending data, receiving data, and synchronizing communication with a clock signal.

arduino uno r4 wifi spi pins

Note:

The UNO R4 WiFi uses the modern naming convention Controller/Peripheral for SPI pins instead of the older Master/Slave terminology, although the function remains exactly the same.

On the UNO R4 WiFi, pin 11 is labeled COPI (Controller Out, Peripheral In), formerly known as MOSI. This pin is used by the Arduino to send data to another device. Pin 12 is labeled CIPO (Controller In, Peripheral Out), formerly known as MISO, and it is used by the peripheral device to send data back to the Arduino. Pin 13 is the SCK (Serial Clock) pin, which keeps the data transfer synchronized. Pin 10 is typically used as the CS (Chip Select) pin. This pin tells the Arduino which SPI device it wants to communicate with, which is especially important when multiple SPI devices are connected at the same time.

In addition to these standard SPI pins, the UNO R4 WiFi also includes an ICSP (In-Circuit Serial Programming) header. This header provides access to the same SPI signals. You can use either the standard digital pins or the ICSP header for SPI communication.

The following example shows how to use SPI:

#include <SPI.h>

const int CS = 10;

void setup() {
  pinMode(CS, OUTPUT);     // Set CS pin as output
  SPI.begin();             // Initialize SPI bus
  digitalWrite(CS, LOW);   // Pull CS low to start communication with the device
  SPI.transfer(0x00);      // Send a single byte (0x00) over SPI
  digitalWrite(CS, HIGH);  // Pull CS high to end communication
}

void loop() {
}

In this example, the Arduino sets the Chip Select pin as an output, starts the SPI system, selects the connected device by pulling CS LOW, sends a single byte of data, and then ends the communication by pulling CS HIGH.

Arduino UNO R4 WIFi UART Pins

The UNO R4 WiFi features a significant upgrade over its predecessor: it has two separate hardware UART interfaces.

  1. One port is exposed via USB-C, and
  2. One is exposed via RX/TX pins.
arduino uno r4 wifi uart pins

On the older UNO R3, the USB port and the digital pins 0/1 were connected to the same serial interface. This meant you couldn’t use the Serial Monitor on your computer and an external module (like a GPS or Bluetooth receiver) at the same time without them interfering with each other.

The UNO R4 WiFi solves this by separating them. The USB-C port connects to one serial interface (which you access in code as Serial), while pins 0 (RX) and 1 (TX) connect to a second, completely independent interface (which you access as Serial1). This allows you to debug your code on your computer while simultaneously communicating with an external device.

If you ever need even more serial ports, you can still use the SoftwareSerial library to create virtual serial ports on other digital pins. However, keep in mind that these software-based ports are slower and more CPU-intensive than the dedicated hardware ports.

To use the UART connected to the RX and TX pins, you first need to set the baud rate in the setup() function. When working with these pins on the UNO R4 WiFi, you use the Serial1 object instead of Serial.

Serial1.begin(9600);

To read incoming data, you can check whether data is available and then read it one character at a time. A simple loop might look like this:

while (Serial1.available()) {
  delay(2);
  char c = Serial1.read();
  incoming += c;
}

To send data through the UART connection, you can use the following command:

Serial1.write("Hello world!");

Arduino UNO R4 WIFi CAN Pins

The UNO R4 WiFi also supports CAN (Controller Area Network) communication. It is a reliable and noise-resistant communication protocol. CAN was originally developed by Bosch for use in cars, but it is now widely used in many industrial and automation systems. One of the main advantages of CAN is that devices can communicate with each other directly over a shared network without needing a central computer.

The UNO R4 WiFi includes a built-in CAN controller that supports both the CAN 2.0A and CAN 2.0B standards. The CAN signals are available on digital pin D4 for CAN TX (transmit) and digital pin D5 for CAN RX (receive).

arduino uno r4 wifi can pins

It is very important to understand that the UNO R4 WiFi only includes the CAN controller, not the CAN transceiver. The controller handles the data logic, but it does not generate the actual electrical signals used on a CAN bus. To connect the Arduino to other CAN devices, you must use an external CAN transceiver module (like an MCP2551 or TJA1050). These transceivers convert the Arduino’s 5V logic signals into the differential CAN-H and CAN-L signals required by the CAN network.

To communicate with CAN devices, you first will need to include the Arduino_CAN library at the top of your sketch.

#include <Arduino_CAN.h>

Next, you initialize the CAN system by selecting a bit rate. This is done using the CAN.begin(CanBitRate rate) function. The bit rate must match the speed used by the other devices on the CAN bus. Common options include 125 kbps, 250 kbps, 500 kbps, and 1 Mbps.

CAN.begin(CanBitRate::BR_125k);   //sets the bit rate to 125 kbps
CAN.begin(CanBitRate::BR_250k);   //sets the bit rate to 250 kbps
CAN.begin(CanBitRate::BR_500k);   //sets the bit rate to 500 kbps
CAN.begin(CanBitRate::BR_1000k);  //sets the bit rate to 1 Mbps

To send a CAN message, you first create a CAN message object. This message includes an identifier (CAN ID), the size of the data, and the data itself. Once the message is prepared, you send it using the CAN.write() function.

uint8_t const msg_data[] = {0xCA,0xFE,0,0,0,0,0,0};
memcpy((void *)(msg_data + 4), &msg_cnt, sizeof(msg_cnt));
CanMsg msg(CAN_ID, sizeof(msg_data), msg_data);
CAN.write(msg);

To receive a CAN message, you first check whether a message is available using CAN.available(). If one is available, you can then read it and process it in your program.

if (CAN.available()) {
  CanMsg const msg = CAN.read();
  Serial.println(msg);
}

Arduino UNO R4 WIFi ICSP Header

If you’ve used an UNO R3 before, you’ll immediately recognize the 6-pin ICSP (In-Circuit Serial Programming) header. However, its function has completely changed on the UNO R4 WiFi.

arduino uno r4 wifi icsp header

On the UNO R3, the ICSP header was commonly used for two main purposes: flashing the bootloader using an external programmer (such as an AVR ISP or another Arduino acting as an ISP), and communicating with SPI devices.

On the UNO R4 WiFi, the ICSP header is no longer used for flashing the bootloader. This is because the UNO R4 WiFi uses a completely different microcontroller, the Renesas RA4M1, which does not support programming over SPI. According to the Renesas RA4M1 Hardware User’s Manual, specifically in the section that describes “Operating Modes”, this microcontroller supports two primary methods for programming its flash memory. One method is SCI Boot Mode, which uses a UART interface, and the other is USB Boot Mode, which uses the built-in USB interface. Because of this, the traditional ISP method over SPI is not supported.

Therefore, the ICSP header on the UNO R4 WiFi is mainly kept for compatibility with SPI-based shields and hardware that expect the SPI signals to be available on this connector.

Arduino UNO R4 WIFi ESP Header

The Arduino UNO R4 WiFi includes a small 2×3 pin header located close to the RESET button. You can use this header to directly access and reprogram the ESP32-S3 module.

The pins accessible here are:

  • GPIO42 – MTMS debugging
  • GPIO41 – MTDI debugging
  • GPIO43 (TXD0) – Serial Transmit (UART)
  • GPIO0 – Boot
  • GPIO44 (RXD0) – Serial Receive (UART)
  • GND – Ground
arduino uno r4 wifi esp header

However, you must be very careful when using this header. All of these signals operate at 3.3 volts. The ESP32-S3 is not 5V tolerant. If you accidentally connect any of these pins to a 5V signal, you could permanently damage the ESP32-S3 chip.

Arduino UNO R4 WIFi LED Matrix

One of the most eye-catching features of the Arduino UNO R4 WiFi is its built-in 12×8 LED matrix. This matrix contains 96 small red LEDs arranged in 12 columns and 8 rows. You can program this display to show patterns, icons, scrolling text, animations, or even simple games.

arduino uno r4 wifi led matrix number mapping

All 96 LEDs are connected using a technique called Charlieplexing. Charlieplexing allows many LEDs to be controlled using fewer microcontroller pins. It works by carefully switching the direction of current through the pins so that only the desired LEDs light up at a given time. This method saves hardware resources while still giving you full control over the entire matrix.

To use the LED matrix in your program, you first include the Arduino_LED_Matrix library at the top of your sketch. Then, you create an object that represents the LED matrix. To display something on the matrix, you need to define a frame. A frame is simply a two-dimensional array of numbers where a 1 means the LED turns on, and a 0 means it stays off.

To start the LED Matrix, you call the begin() function inside your setup(). Finally, whenever you are ready to display your design, you simply call renderBitmap() and pass your frame to it.

Here is an example that displays a heart shape:

#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;

byte heart[8][12] = {
  { 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0 },
  { 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0 },
  { 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 },
  { 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0 },
  { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};

void setup() {
  Serial.begin(115200);
  matrix.begin();
}

void loop() {
  matrix.renderBitmap(heart, 8, 12);
}

Arduino UNO R4 WIFi Power Pins

The UNO R4 WiFi provides several power pins that are used to power the board itself and to supply power to connected sensors, modules, and other external components.

arduino uno r4 wifi power pins

To help you understand how the power flows through the board, here is a simplified block diagram of the power tree:

arduino uno r4 wifi power tree

VIN pin allows you to power the Arduino using an external power source, such as a wall adapter or a battery pack. This is perfect for standalone projects that are not connected to a computer through USB. The input voltage range for VIN is typically 6V to 24V. Any voltage supplied to this pin is regulated down to a stable 5V by ISL854102FRZ DC-DC Step-Down (Buck) Converter, which then powers the RA4M1 microcontroller and other parts of the board. The Vin pin is also connected to the DC-jack (barrel plug connector). This means that when you power the board through the barrel jack, that same voltage is also available on the VIN pin.

5V pin provides a regulated 5V (* read the note below) output that you can use to power external sensors, modules, and shields that require a stable 5V supply. The amount of current available here depends on how you are powering the board.

  1. If you are powering the board via the VIN pin or the barrel jack, the onboard buck converter is active, and the 5V pin can supply up to about 1.2 amps of current to the board and connected peripherals.
  2. If you are powering the board via the USB-C port, you bypass the buck converter entirely. In this case, the maximum available current depends on the USB power source, such as a computer or a wall adapter, and can be as high as around 2 amps without damaging the board.

If your project includes components that draw large amounts of current, such as servo motors, it is best to power those components using a separate external power supply rather than relying on the Arduino’s 5V pin.

Note: It is also important to note that when the board is powered via USB, the voltage on the 5V pin is slightly lower, typically around 4.7 V, due to the voltage drop across a Schottky protection diode.

3.3V pin provides a regulated 3.3-volt output. This voltage is created by stepping down the 5V line using SGM2205 secondary low dropout (LDO) regulator. The 3.3V rail powers the onboard ESP32-S3 Wi-Fi module, the Qwiic connector, and serves as the reference voltage for your 3.3V sensors. You must be careful not to overload this pin. The ESP32-S3 uses bursts of current when transmitting WiFi signals. If you connect external devices that draw too much current from the 3.3V pin while WiFi is active, the voltage may drop, leading to ESP32 brownouts and connection instability.

Arduino UNO R4 WIFi OFF and VRTC Pins

The Arduino UNO R4 WiFi introduces two pins that were not available on earlier UNO boards: the OFF pin and the VRTC pin. They give you more control over how the board manages power and timekeeping.

arduino uno r4 wifi off vrtc pins

The OFF Pin

The OFF pin is an active-low shutdown control pin. This means that when you connect the OFF pin to GND (ground), the onboard 5V buck converter turns off, and the board shuts down.

This feature is very useful in low-power projects, such as remote environmental monitoring systems that run on batteries. For example, a low-power timer circuit could pull the OFF pin low to completely shut down the board for several hours. Later, the timer could release the pin, waking the system up just long enough to take sensor readings, send data over WiFi, and shut down again. Using this method can extend battery life from just a few days to several months.

It is important to remember that the OFF pin only works when the board is powered through the VIN pin or the barrel jack. If the board is powered using USB-C, the 5V rail comes directly from the USB source, bypassing the buck converter. In that case, the OFF pin has no effect.

The VRTC Pin

The VRTC pin is related to the board’s built-in Real Time Clock (RTC). The UNO R4 WiFi includes an internal RTC that keeps track of the current time. This means you do not need to connect an external RTC module, such as a DS3231, for data logging projects. While the main power supply, either USB or VIN, is connected, the RTC keeps running normally. However, if the main power is disconnected, the RTC would normally stop. To prevent this, the board provides the VRTC pin near the barrel jack. By connecting a small backup power source, such as a CR2032 coin cell battery or a supercapacitor, to the VRTC pin, you can keep the RTC running even when the main power is removed. The VRTC pin accepts a voltage between 1.6 volts and 3.6 volts.

Amrit Prabhu

Amrit Prabhu

Amrit is an Electronics Engineer who loves making complex programming and hardware concepts accessible. He has more than 15 years of experience, having worked as a Senior Programmer Analyst at Mindtree Ltd. and Symantec on major projects like Windows 8, Wolters Kluwer CCH and NSE. Since 2018, he has authored hundreds of tutorials and guides for Last Minute Engineers, helping readers master everything from basic circuits to IoT. You can find him on LinkedIn