Table of Contents
Today, we will be looking at the Arduino Nano R4 board, a unique microcontroller with several interesting features. The Nano family is getting even bigger!
Introduction
The original Arduino Nano was an 8-bit microcontroller that used an ATMega286 MCU, the same one used in the popular Arduino Uno R3. It was followed by many other Nano boards, a few of which we have reviewed here in the DroneBot Workshop.

Now Arduino has repeated itself with the Arduino Nano R4. This board uses the same Renesas microcontroller as the newer Arduino Uno R4 Minima and WiFi boards (the Nano R4 does NOT have WiFi).
It’s an interesting board with some unique features, and at less than 12 dollars, it is among the least expensive Nano boards.
Let’s take a look at the new Nano R4.
Arduino Nano R4
At the heart of the Arduino Nano R4 is the Renesas RA4M1 (Arm® Cortex®-M4) microcontroller. This MCU runs at 48 MHz and provides a significant performance boost compared to the classic 8-bit Nano.
As with the Arduino Uno R4 boards, the Nano R4 uses 5-volt logic instead af the more common 3.3-volt. It does, however, have a Qwiic connector, which provides an I²C connection at 3.3 volts.
Nano R4 Specifications
Here are some of the key specifications of the Arduino Nano R4:
- Microcontroller: Renesas RA4M1 (Arm Cortex-M4, 48 MHz)
- Flash Memory: 256 KB
- SRAM: 32 KB
- EEPROM: 8 KB
- Operating Voltage: 5 V
- I/O Pins: 14 digital, 8 analog (including DAC support, can also be used as digital)
- DAC (Digital to Analog Converter): 1 channel, 12-bit
- Op Amp: 1 integrated operational amplifier
- RTC (Real Time Clock): With optional battery backup
- Communication: UART, SPI, I²C (5 V & 3.3 V Qwiic), CAN (with transceiver)
- USB-C Connector for power and programming
- Form Factor: Compatible with classic Arduino Nano pinout
- Dimensions: 18 × 45 mm
As the board retains the standard Nano form factor, it can be used with all of the accessories for the Nano series.
Arduino Nano Pinouts
The Arduino Nano has an identical pinout to other Nano boards:

A summary of the pinouts:
- A0 – Analog in / DAC out
- A1–A3 – Analog in / Op Amp inputs & output
- A4/A5 – Analog in / I²C SDA & SCL
- D0/D1 – UART RX/TX
- D4/D5 – CAN TX/RX
- D10–D13 – SPI CS, MOSI, MISO, SCK
- VBATT – RTC battery backup input
The Nano also has other connections, including a Qwiic connector and a connection for a battery to back up the RTC:

And there are LEDs and a Reset switch on the Nano as well:

Getting Started with the Nano R4
We will be using the Arduino IDE to program the Nano R4. It uses the same Boards Manager as the Arduino Uno R4 series.
To program the Nano R4 in the Arduino IDE:
- Install Arduino IDE 2.0+ (or use the Arduino Web Editor).
- Connect the board via USB-C.
- Open Boards Manager:
- Go to Tools → Board → Boards Manager
- Search for “UNO R4”
- Install the Arduino UNO R4 Boards package.
- Select the Board:
- Tools → Board → Arduino UNO R4 Minima (Nano R4 shares the same core).
- Select the Port and upload your first sketch.
The Nano R4 is fully compatible with existing UNO R4 libraries. Note that features such as WiFi and an LED Matrix are not included in the Nano R4, but they are included in the sample code. The code was obviously written for the Uno R4 WiFi board. Sketches written for Arduino UNO R4 Minima are directly compatible with the Nano R4.
Now that we have the Nano R4 connected to our Arduino IDE, we can start experimenting with it.
Arduino Nano R4 – Real Time Clock

The Arduino Nano R4 features a sophisticated Real-Time Clock (RTC) system built into the RA4M1 microcontroller, enhanced with an external 32.768 kHz crystal oscillator for improved accuracy. This RTC capability allows your projects to maintain accurate time and date information even when the main power is disconnected, provided a backup battery (1.6V to 3.6V power source to the VBATT pin) is connected.
RTC Features and Capabilities
Hardware Specifications:
- Crystal Oscillator: External 32.768 kHz crystal for high accuracy
- Calendar Range: 100-year calendar from 2000 to 2099
- Leap Year Support: Automatic leap year calculation
- Operating Modes: Calendar count mode and binary count mode
- Backup Power: VBATT pin for battery backup (1.6V to 3.6V)
- Power Switching: Automatic switchover between main power and battery backup
Programming the Real Time Clock
The Real Time Clock is programmed using the Arduino RTC Library. This library will be installed when the Boards Manager for the R4 is installed. The RTC library is a thin, Arduino-style wrapper around the RA4M1 microcontroller’s built-in real-time clock.
Here is some sample code, provided by the Arduino Product Experience Team, that you can use to set the time and test the RTC:
|
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
/** RTC Basic Example for the Arduino Nano R4 Board Name: nano_r4_rtc_basic.ino Purpose: This sketch demonstrates how to use the built-in RTC to keep track of date and time. @author Arduino Product Experience Team @version 1.0 01/06/25 */ #include "RTC.h" void setup() { // Initialize serial communication and wait up to 2.5 seconds for a connection Serial.begin(115200); for (auto startNow = millis() + 2500; !Serial && millis() < startNow; delay(500)); Serial.println("- Arduino Nano R4 - RTC Basic Example started..."); Serial.println("- Initializing RTC..."); // Initialize RTC RTC.begin(); //Set initial time: January 15, 2025, 12:00:00 PM, Monday RTCTime startTime(15, Month::JANUARY, 2025, 12, 0, 0, DayOfWeek::MONDAY, SaveLight::SAVING_TIME_INACTIVE); RTC.setTime(startTime); //Serial.println("- RTC time has been set to January 15, 2025, 12:00:00 PM"); Serial.println("- Current date and time will be displayed every second"); } void loop() { // Get current time from RTC RTCTime currentTime; RTC.getTime(currentTime); // Get individual values int year = currentTime.getYear(); int month = Month2int(currentTime.getMonth()); int day = currentTime.getDayOfMonth(); int hour = currentTime.getHour(); int minute = currentTime.getMinutes(); int second = currentTime.getSeconds(); // Display date (YYYY/MM/DD) Serial.print("Date: "); Serial.print(year); Serial.print("/"); if (month < 10) Serial.print("0"); Serial.print(month); Serial.print("/"); if (day < 10) Serial.print("0"); Serial.print(day); // Display time (HH:MM:SS) Serial.print(" | Time: "); if (hour < 10) Serial.print("0"); Serial.print(hour); Serial.print(":"); if (minute < 10) Serial.print("0"); Serial.print(minute); Serial.print(":"); if (second < 10) Serial.print("0"); Serial.print(second); // Display day of week Serial.print(" | Day: "); DayOfWeek dayOfWeek = currentTime.getDayOfWeek(); if (dayOfWeek == DayOfWeek::MONDAY) { Serial.print("Monday"); } else if (dayOfWeek == DayOfWeek::TUESDAY) { Serial.print("Tuesday"); } else if (dayOfWeek == DayOfWeek::WEDNESDAY) { Serial.print("Wednesday"); } else if (dayOfWeek == DayOfWeek::THURSDAY) { Serial.print("Thursday"); } else if (dayOfWeek == DayOfWeek::FRIDAY) { Serial.print("Friday"); } else if (dayOfWeek == DayOfWeek::SATURDAY) { Serial.print("Saturday"); } else if (dayOfWeek == DayOfWeek::SUNDAY) { Serial.print("Sunday"); } Serial.println(); // Wait one second before next reading delay(1000); } |
The code is pretty simple. We start by including the RTC library.
In Setup, we start the serial monitor and the real-time clock. Next, we create an object of the class “RTCTime” called “startTime“. This object contains the date and time we want to set the clock to (January 15, 2025, 12:00:00 PM, Monday). We follow with an “RTC.setTime(startTime)“, which sets the clock.
In the Loop, we create another RTCTime object called “currentTime”. This is used with an “RTC.getTime(currentTime)” statement to retrieve the time from the running clock.
We then extract all of the values (i.e., year, month, day, hours, minutes, and seconds) and print them on the serial monitor. After that, we pause for a second and repeat the whole process.
Load the code and test it out. You should see the time updated every second. You can, of course, change the date and time to match your correct time.
If you have a battery attached to the clock, you can test it by modifying the above sketch after you have first run it. Remark out the following lines:
|
1 2 3 |
//Set initial time: January 15, 2025, 12:00:00 PM, Monday //RTCTime startTime(15, Month::JANUARY, 2025, 12, 0, 0, DayOfWeek::MONDAY, SaveLight::SAVING_TIME_INACTIVE); //RTC.setTime(startTime); |
Now compile and upload the sketch to the Arduino Nano R4. The clock should keep the initial time instead of resetting to the original.

After you have confirmed that, remove the USBC cable. The battery should keep the clock running. Wait a few seconds and plug the USBC cable back into the Nano.
If the battery is working, the clock will still be keeping time.
This is just a sample sketch, but it has all the elements you will need to create a sketch of your own that uses the RTC.
Arduino Nano R4 – DAC

Unlike most Arduino boards that only provide PWM for analog output, the Nano R4 includes a true 12-bit DAC (Digital to Analog Converter). This means you can generate smooth analog voltages instead of PWM waveforms filtered by external components.
The DAC is useful for applications like audio generation, waveform synthesis, or setting reference voltages for sensors. It is connected to pin A0 and can generate precise analog voltages from nearly 0V to approximately 5V with 4,096 discrete output levels.
Note that pin A0 cannot be used as an analog input while using the DAC.
Digital to Analog Converter Specs
Here are the specifications of the DAC in the Arduino Nano R4:
Hardware Characteristics:
- Resolution: 12-bit (4,096 discrete levels)
- Output Pin: A0 (dedicated DAC output)
- Voltage Range: 0V to ~4.95V (limited by supply voltage)
- Reference Voltage: 5V (VCC)
- Output Current: Limited to 8mA maximum
- Update Rate: High-speed capable (suitable for audio applications)
- Impedance: Low output impedance for direct driving of loads
Resolution and Accuracy:
- Step Size: 5V / 4096 = ~1.22mV per step
- Theoretical Maximum: 4095 (actual output ~4.998V)
- Minimum Value: 0 (0V output)
- Linearity: Excellent linearity across the full range
The DAC can be used for single-channel audio purposes as well.
Programming the DAC
The key to using the DAC is the analogWrite command. It uses the following format:
analogWrite(DAC, value)
The “value” variable is what sets the output level of the DAC. Its range depends upon the resolution the DAC is set to, which is done as follows:
analogWriteResolution(12)
As shown this will set the DAC to the maximum 12-bit resolution. You may also set it to 8 or 10 bits.
Here is a sketch that will output a series of voltages on the DAC. You can read them using a multimeter attached to pin A0 and Ground.
|
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 44 45 |
/** DAC Basic Output Example for the Arduino Nano R4 Board Name: nano_r4_dac_basic.ino Purpose: This sketch demonstrates how to use the DAC to generate precise analog voltages on pin A0. @author Arduino Product Experience Team @version 1.0 01/06/25 */ void setup() { // Initialize serial communication and wait up to 2.5 seconds for a connection Serial.begin(115200); for (auto startNow = millis() + 2500; !Serial && millis() < startNow; delay(500)); // Set DAC resolution to 12-bit for maximum precision analogWriteResolution(12); Serial.println("- Arduino Nano R4 - DAC Basic Output Example started..."); Serial.println("- Generating precise voltages on pin A0"); Serial.println("- Connect a multimeter to A0 to measure output"); } void loop() { // Generate different voltage levels // 0, +1.25, +2.5, +3.75 and +5 VDC int dacValues[] = {0, 1024, 2048, 3072, 4095}; float voltages[] = {0.0, 1.25, 2.5, 3.75, 5.0}; for (int i = 0; i < 5; i++) { analogWrite(DAC, dacValues[i]); Serial.print("- DAC Value: "); Serial.print(dacValues[i]); Serial.print(" | Target Voltage: "); Serial.print(voltages[i], 2); Serial.println(" VDC"); // Hold each voltage for 2 seconds delay(2000); } Serial.println("- Cycle completed, repeating..."); delay(1000); } |
This is another simple sketch. It starts by starting the serial monitor and setting the DAC resolution (to 12 bits) in the Setup function.
In the Loop function, we build two arrays:
- dacValues[] – The values we will be sending to the DAC.
- voltages[] – The expected output voltages that correspond to the first array’s values.
Next, we use a for-next loop to step through the elements of each array. Each time we (a) set the DAC voltage to the current dacValues variable and (b) print the current voltages value to the serial monitor.
After exiting the for-next loop, we delay for two seconds before starting the main Loop again.

Load the sketch to the Nano R4. Attach a multimeter’s positive lead to the A0 pin and the negative lead to one of the Nano R4’s grounds.
You should see the voltage step through on both the serial monitor and multimeter.
As you have seen, the DAC is straightforward to use.
Arduino Nano R4 – Op Amp

One unique addition to the Nano R4 is a built-in operational amplifier.
Having an op amp directly inside the microcontroller allows you to amplify weak sensor signals, build active filters, or even buffer the DAC output without extra ICs.
The op-amp is connected to pins A1 (positive input), A2 (negative input), and A3 (output). It can be configured in different modes, such as buffer, inverting amplifier, or non-inverting amplifier.
Op Amp Specifications
The Op Amp can be run in two different performance modes:
- Low Speed
- High Speed
The specifications of the Op Amp in both modes are illustrated in the following chart:

Programming the Op Amp
There isn’t much to do to get the Op Amp working. The “OPAMP.begin” command is all you really need to know. The Op Amp is an analog device, like any discrete Op Amp, and it is configured with analog components like resistors and capacitors. The same sketch can be used for a variety of configurations.
The following sketch is one of the examples included with the Nano R4:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#include <OPAMP.h> void setup () { Serial.begin(9600); delay(2000); // serial monitor delay // activate OPAMP, default channel 0 // Plus: Analog A1 // Minus: Analog A2 // Output: Analog A3 if (!OPAMP.begin(OPAMP_SPEED_HIGHSPEED)) { Serial.println("Failed to start OPAMP!"); } bool const isRunning = OPAMP.isRunning(0); if (isRunning) { Serial.println("OPAMP running on channel 0!"); } else { Serial.println("OPAMP channel 0 is not running!"); } } void loop() { delay(1000); // do nothing } |
You can find this example under the “Examples for Arduino Nano R4 – OPAMP” path in the Arduino IDE; the example sketch is named “start_opamp”.
As you can see, all it really does is start the op amp! It first sets it into High Speed mode, starts it and checks to see if it is really started. And that’s it.
Here are a couple of configurations you can try using the Op Amp in the Arduino Nano R4:
Voltage Follower

In this configuration, the Op Amp operates as a voltage follower. The output voltage will be equal to the input voltage. This is also referred to as a “buffer”, as it presents a high-impedance load to the source.

Non-Inverting Amplifier

In this configuration, the Op Amp amplifies the incoming signal. The output will be at the same phase as the input. The resistors determine the amount of amplification.
If your input signal overloads the output, it will get clipped.

You can learn more about Operational Amplifiers in this article.
Conclusion
The Arduino Nano R4 is a rather unique board, as it combines both 5 and 3.3 volt logic. Its Nano form factor allows it to be used with existing Nano prototyping tools, such as the Arduino Nano Connector Carrier Board.
This inexpensive and unique microcontroller is sure to find numerous applications. Look for some projects based on it in the near future.
Parts List
Here are some components that you might need to complete the experiments in this article. Please note that some of these links may be affiliate links, and the DroneBot Workshop may receive a commission on your purchases. This does not increase the cost to you and is a method of supporting this ad-free website.
Arduino Nano R4 Arduino Store
Connector Carrier Board Arduino Store
Resources
Article in PDF – A PDF Version of this article, wrapped up in a ZIP file.
Code Samples – The code samples used in this article







very good, thenks