Arduino UNO R4 - Multi-Function Shield

The Multi-Function Shield is a great companion for the Arduino Uno R4 — whether you have the Minima or WiFi variant. In this guide, you will learn to:

The Arduino Uno R4 shares the same Uno form factor as the classic Uno R3, so the Multi-Function Shield plugs in directly without any extra wiring. The Uno R4 features the Renesas RA4M1 (Minima) or RA4M1 + ESP32-S3 (WiFi) microcontroller, offering more memory, faster clock speed, and a 14-bit ADC compared to the original Uno.

Arduino Uno R4 Multi-Function Shield

Overview of Multi-Function Shield

The Multi-Function Shield packs multiple components onto a single board that plugs directly into any Uno-compatible header. Here is what is included:

  • A 4-digit 7-segment display controlled via a 74HC595 shift register — capable of showing integers, decimals, letters A–Z, and symbols such as the degree sign (°).
  • Three push buttons (S1, S2, S3) wired as active LOW with built-in pullup resistors — ready for detecting presses and releases with debounce.
  • Four LEDs (D1–D4), also active LOW — individually controllable for on/off/toggle/blink, plus a convenience function to blink all at once.
  • An active-LOW buzzer — programmable for single beeps or timed sequences.
  • A potentiometer on analog pin A0 — returns raw ADC counts or a 0–100% reading.
  • An LM35 temperature sensor on analog pin A4 — outputs Celsius readings (remove jumper J1 to enable it).

Since the Uno R4 maintains the classic Uno pin layout, every pin mapping is identical to the original Uno:

Function Pin Function Pin
LED D1 13 Button S1 A1
LED D2 12 Button S2 A2
LED D3 11 Button S3 A3
LED D4 10 Potentiometer A0
Buzzer 3 LM35 Temp Sensor A4
Display LATCH 4
Display CLOCK 7
Display DATA 8
Multi-Function Shield Pinout

Wiring Diagram

No jumper wires or breadboard needed — simply align the Multi-Function Shield with the Uno R4 headers and press it into place. The shield seats onto the board exactly like it does on the classic Uno R3.

The wiring diagram between Arduino Uno R4 Multi-Function Shield

This image is created using Fritzing. Click to enlarge image

See The best way to supply power to the Arduino Uno R4 and other components.

How to Install the Library

  1. Plug the Arduino Uno R4 into your computer using a USB Type-C cable.
  2. In the Arduino IDE, verify that the correct board (Arduino Uno R4 Minima or WiFi) and serial port are selected.
  3. Click the Libraries icon in the left sidebar.
  4. Type "DIYables_MultiFuncShield" into the search box and locate the library published by DIYables.
  5. Hit Install to add the library to your IDE.
Arduino Multi-Function Shield library

No additional dependencies are needed — the library is entirely self-contained.

Minimal Sketch Structure

All sketches that use the Multi-Function Shield share this skeleton:

#include <DIYables_MultiFuncShield.h> void setup() { MFS.begin(); // Set up display, buttons, LEDs, buzzer } void loop() { MFS.loop(); // Refresh display, poll buttons, update LEDs & buzzer }

Calling MFS.begin() configures every component on the shield. Calling MFS.loop() on each iteration keeps the display multiplexing, button debounce, LED blink timing, and buzzer scheduling running smoothly.

7-Segment Display Example

This example shows how to put numbers, floats, text strings, and special symbols on the 4-digit display.

/* * This Arduino UNO R4 code was developed by newbiely.com * * This Arduino UNO R4 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-r4/arduino-uno-r4-multi-function-shield */ /* * Multi-Function Shield - Display Example * * Cycles through display features every 3 seconds: * 1. Integer number * 2. Integer with leading zeros * 3. Float number * 4. Text string with letters * 5. Text string with dot * 6. Degree symbol + C (special chars) * 7. Dashes * * Hardware: DIYables Multi-Function Shield * * COMPATIBLE Multi-Function Shield: * - https://diyables.io/products/multi-function-shield-for-arduino-uno-mega * * TESTED HARDWARE: * - Arduino Uno R3 * - Arduino Uno R4 WiFi * - Arduino Uno R4 Minima * - Arduino Mega * - Arduino Due * - Arduino Giga * - DIYables STEM V3: https://diyables.io/stem-v3 * - DIYables STEM V4 IoT: https://diyables.io/stem-v4-iot * - DIYables STEM V4B IoT: https://diyables.io/stem-v4b-iot * - DIYables STEM V4 Edu: https://diyables.io/stem-v4-edu * - DIYables MEGA2560 R3: https://diyables.io/atmega2560-board * - DIYables ESP32 S3, Uno-form factor: https://diyables.io/esp32-s3-uno * - It is expected to work with other boards */ #include <DIYables_MultiFuncShield.h> uint8_t step = 0; unsigned long lastUpdate = 0; void setup() { MFS.begin(); } void loop() { MFS.loop(); if (millis() - lastUpdate >= 3000) { lastUpdate = millis(); switch (step) { case 0: // Integer: " 42" MFS.display.print(42); break; case 1: // Integer with leading zeros: "0042" MFS.display.print(42, true); break; case 2: // Float with 2 decimals: "3.14" MFS.display.print(3.14, 2); break; case 3: // Text string: "HELP" MFS.display.print("HELP"); break; case 4: // Text with dot: "Ab.Cd" MFS.display.print("Ab.Cd"); break; case 5: // Degree + C using special chars: "25°C" MFS.display.clear(); MFS.display.setNumber(1, 2); MFS.display.setNumber(2, 5); MFS.display.setChar(3, SegChars::DEGREE); MFS.display.setChar(4, SegChars::C); MFS.display.show(); break; case 6: // Dashes: "----" MFS.display.print("----"); break; } step = (step + 1) % 7; } }

How to Run

  • Place the Multi-Function Shield on top of the Arduino Uno R4.
  • Connect the board to your PC with a USB Type-C cable.
  • Open Arduino IDE and select the board and port.
  • Paste the code above into the editor.
  • Press Upload.

The display will rotate through seven different presentations — an integer, zero-padded integer, floating-point number, text, text with a decimal dot, a degree symbol, and dashes — switching every 3 seconds.

Display Methods at a Glance

Method What It Does Usage Example
print(int) Shows an integer value MFS.display.print(42)
print(int, true) Shows an integer with leading zeros MFS.display.print(42, true) → 0042
print(float, dp) Shows a floating-point number MFS.display.print(3.14, 2)
print(text) Shows a string (A-Z, 0-9, -, _) MFS.display.print("HELP")
setNumber(pos, val) Places one digit at a position (1–4) MFS.display.setNumber(1, 5)
setChar(pos, ch) Places a character at a position MFS.display.setChar(2, 'A')
setChar(pos, SegChars) Places a special symbol MFS.display.setChar(3, SegCharsDEGREE)
setDot(pos) Lights up the dot at a position MFS.display.setDot(2)
clear() Blanks the entire display MFS.display.clear()
show() Pushes manual changes to the display MFS.display.show()

The print() overloads call show() internally. When building a display manually with setNumber(), setChar(), or setDot(), call clear() first and show() at the end.

Supported special characters through SegChars: DASH, UNDERSCORE, C, E, F, DEGREE.

Button Example

Detect when each button is pressed or released and print the event over Serial.

/* * This Arduino UNO R4 code was developed by newbiely.com * * This Arduino UNO R4 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-r4/arduino-uno-r4-multi-function-shield */ /* * Multi-Function Shield - Buttons Example * * Detects button presses and releases, prints to Serial Monitor. * * Hardware: DIYables Multi-Function Shield * * COMPATIBLE Multi-Function Shield: * - https://diyables.io/products/multi-function-shield-for-arduino-uno-mega * * TESTED HARDWARE: * - Arduino Uno R3 * - Arduino Uno R4 WiFi * - Arduino Uno R4 Minima * - Arduino Mega * - Arduino Due * - Arduino Giga * - DIYables STEM V3: https://diyables.io/stem-v3 * - DIYables STEM V4 IoT: https://diyables.io/stem-v4-iot * - DIYables STEM V4B IoT: https://diyables.io/stem-v4b-iot * - DIYables STEM V4 Edu: https://diyables.io/stem-v4-edu * - DIYables MEGA2560 R3: https://diyables.io/atmega2560-board * - DIYables ESP32 S3, Uno-form factor: https://diyables.io/esp32-s3-uno * - It is expected to work with other boards */ #include <DIYables_MultiFuncShield.h> void setup() { Serial.begin(9600); MFS.begin(); } void loop() { MFS.loop(); if (MFS.button1.isPressed()) Serial.println("Button 1 pressed"); if (MFS.button1.isReleased()) Serial.println("Button 1 released"); if (MFS.button2.isPressed()) Serial.println("Button 2 pressed"); if (MFS.button2.isReleased()) Serial.println("Button 2 released"); if (MFS.button3.isPressed()) Serial.println("Button 3 pressed"); if (MFS.button3.isReleased()) Serial.println("Button 3 released"); }

How to Run

  • Paste the code into Arduino IDE and press Upload.
  • Open the Serial Monitor.
  • Try pressing and releasing S1, S2, and S3 — each event is printed as it happens.

Button Methods at a Glance

Method What It Does
isPressed() Returns true the moment the button goes down
isReleased() Returns true the moment the button comes back up
setDebounceTime(ms) Adjusts the debounce window (50 ms by default)

Each button is debounced automatically and uses active LOW logic with an internal pullup. Reference individual buttons with MFS.button1 / MFS.button2 / MFS.button3, or use the index accessor MFS.button(1) through MFS.button(3).

LED Example

Light the four LEDs in sequence, then blink them all together.

/* * This Arduino UNO R4 code was developed by newbiely.com * * This Arduino UNO R4 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-r4/arduino-uno-r4-multi-function-shield */ /* * Multi-Function Shield - LEDs Example * * Demonstrates turn on, turn off, and blink for each LED. * * Hardware: DIYables Multi-Function Shield * * COMPATIBLE Multi-Function Shield: * - https://diyables.io/products/multi-function-shield-for-arduino-uno-mega * * TESTED HARDWARE: * - Arduino Uno R3 * - Arduino Uno R4 WiFi * - Arduino Uno R4 Minima * - Arduino Mega * - Arduino Due * - Arduino Giga * - DIYables STEM V3: https://diyables.io/stem-v3 * - DIYables STEM V4 IoT: https://diyables.io/stem-v4-iot * - DIYables STEM V4B IoT: https://diyables.io/stem-v4b-iot * - DIYables STEM V4 Edu: https://diyables.io/stem-v4-edu * - DIYables MEGA2560 R3: https://diyables.io/atmega2560-board * - DIYables ESP32 S3, Uno-form factor: https://diyables.io/esp32-s3-uno * - It is expected to work with other boards */ #include <DIYables_MultiFuncShield.h> void setup() { Serial.begin(9600); MFS.begin(); // Turn on all LEDs one by one Serial.println("Turn ON LEDs one by one"); for (uint8_t i = 1; i <= 4; i++) { MFS.led(i).turnON(); delay(500); } delay(1000); // Turn off all LEDs one by one Serial.println("Turn OFF LEDs one by one"); for (uint8_t i = 1; i <= 4; i++) { MFS.led(i).turnOFF(); delay(500); } delay(1000); // Blink individual LED (LED 1 only) Serial.println("Blink LED 1 individually"); MFS.led(1).blink(300); unsigned long start = millis(); while (millis() - start < 3000) MFS.loop(); MFS.led(1).turnOFF(); delay(1000); // Blink all LEDs together Serial.println("Blink all LEDs together"); MFS.allLedsBlink(500); } void loop() { MFS.loop(); }

How to Run

  • Paste the code into Arduino IDE and press Upload.

Watch the LEDs turn on one at a time with a half-second gap, then all four start blinking in unison.

LED Methods at a Glance

Method What It Does
turnON() Switches the LED on
turnOFF() Switches the LED off
toggle() Flips the current state
blink(interval) Blinks with equal on and off duration
blink(onTime, offTime) Blinks with custom on and off durations
isOn() Returns true when the LED is lit

Whole-group shortcuts available on MFS:

Method What It Does
allLedsOn() Lights up all four LEDs
allLedsOff() Turns off all four LEDs
allLedsBlink(interval) Blinks all four LEDs together
allLedsBlink(onTime, offTime) Blinks all with custom timing

LEDs operate in active LOW mode. Use MFS.led1 through MFS.led4 or the indexed form MFS.led(1) to MFS.led(4).

Buzzer Example

Play a short beep at regular intervals.

/* * This Arduino UNO R4 code was developed by newbiely.com * * This Arduino UNO R4 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-r4/arduino-uno-r4-multi-function-shield */ /* * Multi-Function Shield - Buzzer Example * * Beeps the buzzer every 2 seconds. * * Hardware: DIYables Multi-Function Shield * * COMPATIBLE Multi-Function Shield: * - https://diyables.io/products/multi-function-shield-for-arduino-uno-mega * * TESTED HARDWARE: * - Arduino Uno R3 * - Arduino Uno R4 WiFi * - Arduino Uno R4 Minima * - Arduino Mega * - Arduino Due * - Arduino Giga * - DIYables STEM V3: https://diyables.io/stem-v3 * - DIYables STEM V4 IoT: https://diyables.io/stem-v4-iot * - DIYables STEM V4B IoT: https://diyables.io/stem-v4b-iot * - DIYables STEM V4 Edu: https://diyables.io/stem-v4-edu * - DIYables MEGA2560 R3: https://diyables.io/atmega2560-board * - DIYables ESP32 S3, Uno-form factor: https://diyables.io/esp32-s3-uno * - It is expected to work with other boards */ #include <DIYables_MultiFuncShield.h> unsigned long lastBeep = 0; void setup() { MFS.begin(); } void loop() { MFS.loop(); if (millis() - lastBeep >= 2000) { lastBeep = millis(); MFS.buzzer.beep(100); } }

How to Run

  • Paste the code into Arduino IDE and press Upload.

A brief beep sounds every 2 seconds.

Buzzer Methods at a Glance

Method What It Does
beep(ms) Produces a beep lasting the given milliseconds
beep(ms, delayMs) Waits delayMs, then beeps for ms
stop() Silences the buzzer right away
isBeeping() Returns true while the buzzer is active

Potentiometer Example

Read the potentiometer and print the value and percentage to Serial.

/* * This Arduino UNO R4 code was developed by newbiely.com * * This Arduino UNO R4 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-r4/arduino-uno-r4-multi-function-shield */ /* * Multi-Function Shield - Potentiometer Example * * Reads the potentiometer and shows the percentage on the display. * * NOTE: The potentiometer on the shield is a multi-turn trimmer. * You need to rotate it MANY turns to go from 0% to 100%. * If the value stays at 0% or 100%, rotate in the opposite direction. * * Hardware: DIYables Multi-Function Shield * * COMPATIBLE Multi-Function Shield: * - https://diyables.io/products/multi-function-shield-for-arduino-uno-mega * * TESTED HARDWARE: * - Arduino Uno R3 * - Arduino Uno R4 WiFi * - Arduino Uno R4 Minima * - Arduino Mega * - Arduino Due * - Arduino Giga * - DIYables STEM V3: https://diyables.io/stem-v3 * - DIYables STEM V4 IoT: https://diyables.io/stem-v4-iot * - DIYables STEM V4B IoT: https://diyables.io/stem-v4b-iot * - DIYables STEM V4 Edu: https://diyables.io/stem-v4-edu * - DIYables MEGA2560 R3: https://diyables.io/atmega2560-board * - DIYables ESP32 S3, Uno-form factor: https://diyables.io/esp32-s3-uno * - It is expected to work with other boards */ #include <DIYables_MultiFuncShield.h> unsigned long lastUpdate = 0; float lastPct = -1; void setup() { Serial.begin(9600); MFS.begin(); Serial.println("Rotate potentiometer knob (multi-turn trimmer)."); Serial.println("It requires many turns to go from 0% to 100%."); } void loop() { MFS.loop(); if (millis() - lastUpdate >= 500) { lastUpdate = millis(); int raw = MFS.readPot(); float pct = MFS.readPotPercent(); Serial.print("Raw: "); Serial.print(raw); Serial.print(" Percent: "); Serial.print(pct, 1); Serial.print("%"); if (pct <= 0.1) Serial.print(" ← MIN (rotate clockwise to increase)"); else if (pct >= 99.9) Serial.print(" ← MAX (rotate counter-clockwise to decrease)"); Serial.println(); lastPct = pct; } }

How to Run

  • Paste the code into Arduino IDE and press Upload.
  • Open the Serial Monitor.
  • Rotate the potentiometer knob and watch the value update on the monitor.

Potentiometer Methods at a Glance

Method Return Type What It Does
readPot() int Raw ADC reading (0–16383 on Uno R4's 14-bit ADC)
readPotPercent() float Scaled percentage from 0.0 to 100.0

Temperature Sensor (LM35) Example

Read the LM35 sensor and show the temperature in Celsius on the display and Serial Monitor.

Remember: Jumper J1 must be removed from the shield before using the LM35 sensor, because pin A4 is shared with the I2C SDA line.

/* * This Arduino UNO R4 code was developed by newbiely.com * * This Arduino UNO R4 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-r4/arduino-uno-r4-multi-function-shield */ /* * Multi-Function Shield - Temperature Example * * Reads the LM35 temperature sensor and shows Celsius on the display. * Note: Requires jumper J1 removed (pin A4). * * Hardware: DIYables Multi-Function Shield * * COMPATIBLE Multi-Function Shield: * - https://diyables.io/products/multi-function-shield-for-arduino-uno-mega * * TESTED HARDWARE: * - Arduino Uno R3 * - Arduino Uno R4 WiFi * - Arduino Uno R4 Minima * - Arduino Mega * - Arduino Due * - Arduino Giga * - DIYables STEM V3: https://diyables.io/stem-v3 * - DIYables STEM V4 IoT: https://diyables.io/stem-v4-iot * - DIYables STEM V4B IoT: https://diyables.io/stem-v4b-iot * - DIYables STEM V4 Edu: https://diyables.io/stem-v4-edu * - DIYables MEGA2560 R3: https://diyables.io/atmega2560-board * - DIYables ESP32 S3, Uno-form factor: https://diyables.io/esp32-s3-uno * - It is expected to work with other boards */ #include <DIYables_MultiFuncShield.h> unsigned long lastUpdate = 0; void setup() { Serial.begin(9600); MFS.begin(); MFS.display.print(0); } void loop() { MFS.loop(); if (millis() - lastUpdate >= 500) { lastUpdate = millis(); float temp = MFS.readTemperature(); MFS.display.print(temp, 1); Serial.print("Temp: "); Serial.print(temp, 1); Serial.println(" C"); } }

How to Run

  • Pull out jumper J1 on the Multi-Function Shield.
  • Paste the code into Arduino IDE and press Upload.
  • Open the Serial Monitor.
  • The current temperature appears on the display and is printed to Serial.

Temperature values are smoothed using a 4-sample moving average. On the very first reading, the buffer is pre-filled so you get a stable value immediately.

Platform Support

The library supports all Arduino platforms (architectures=*).

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!