MakerLab
ArduinoArduino Yún Rev2

Arduino Yún Rev2: Bridging Microcontrollers and Linux

A powerful Arduino board featuring a microcontroller and a Linux-based system on a single board for connected projects.

Arduino Yún Rev2

The Arduino Yún Rev2 is a unique and powerful board that merges the simplicity of the Arduino microcontroller ecosystem with the flexibility of a Linux computer. Released as an evolution of the original Yún, it's designed for makers who need more processing power, network connectivity, and software capabilities than a standard Arduino can offer. This board is ideal for projects requiring web interaction, data logging, or running more complex applications.

At its heart, the Yún Rev2 is powered by two distinct processors. The first is an ATmega32U4 microcontroller, familiar to Arduino users, handling real-time control, sensor readings, and low-level I/O. The second is a more powerful Atheros AR9331 System-on-Chip (SoC) running a custom Linux distribution (Linino OS, based on OpenWrt). This Linux environment provides Wi-Fi, Ethernet, and significant processing capabilities, allowing for tasks like running web servers, managing files, and communicating with cloud services.

The Yún Rev2 sits in a special category within the Arduino family, often referred to as a "connected board" or "IoT board." It builds upon the legacy of the original Yún and the Arduino Leonardo (which also uses the ATmega32U4) by integrating a full Linux environment. This makes it suitable for advanced hobbyists, students learning about embedded Linux and IoT, and professional engineers prototyping connected devices. Its dual-processor architecture allows for a division of labor: the microcontroller handles time-critical tasks, while the Linux system manages networking and complex computations.

This board is particularly well-suited for projects that require a robust internet connection, data processing, or the ability to run custom software packages. Examples include home automation hubs, data loggers that upload to cloud platforms, networked sensor arrays, or even simple web servers hosted directly on the device. The Yún Rev2 offers a compelling platform for those looking to bridge the gap between simple microcontroller projects and more sophisticated embedded Linux applications.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCATmega32U4 and Atheros AR9331
ArchitectureAVR (ATmega32U4) and MIPS (AR9331)
Clock speed16 MHz (ATmega32U4), 400 MHz (AR9331)
Flash / Storage32 KB (ATmega32U4) + 16 MB Flash (AR9331)
RAM / SRAM2.5 KB SRAM (ATmega32U4) + 64 MB DDR2 RAM (AR9331)
Operating voltage5V
Digital I/O pins14 (of which 7 can be used as PWM outputs)
Analog / ADC6 (10-bit resolution)
PWM7 pins (on ATmega32U4)
ConnectivityWi-Fi 802.11 b/g/n, Ethernet 10/100 Mbps
USB1x Micro-USB (for programming/power), 1x USB-A (host)
Power input7-12V via DC barrel jack, or 5V via Micro-USB
Dimensions73 mm x 53 mm

Pinout & pin functions

PinFunction
GNDGround
3.3V3.3V Power Output
5V5V Power Output (regulated)
IOREFI/O Reference Voltage
RESETSystem Reset
D0 (RX)Serial communication receive
D1 (TX)Serial communication transmit
D2Digital I/O
D3 (PWM)Digital I/O, PWM output
D4Digital I/O
D5 (PWM)Digital I/O, PWM output
D6 (PWM)Digital I/O, PWM output
D7Digital I/O
D8Digital I/O
D9 (PWM)Digital I/O, PWM output
D10 (PWM, SS)Digital I/O, PWM output, SPI Slave Select
D11 (PWM, MOSI)Digital I/O, PWM output, SPI Master Out Slave In
D12 (MISO)Digital I/O, SPI Master In Slave Out
D13 (SCK)Digital I/O, SPI Serial Clock
A0Analog Input, Digital I/O
A1Analog Input, Digital I/O
A2Analog Input, Digital I/O
A3Analog Input, Digital I/O
A4 (SDA)Analog Input, Digital I/O, I2C Serial Data
A5 (SCL)Analog Input, Digital I/O, I2C Serial Clock
A6Analog Input, Digital I/O
A7Analog Input, Digital I/O
LED_BUILTINOnboard LED (connected to D13)

Wiring & circuit basics

Powering the Arduino Yún Rev2 can be done via its 5V Micro-USB port or a 7-12V DC barrel jack. When using the barrel jack, an onboard voltage regulator supplies the necessary 5V to the board. Ensure your power supply can provide at least 1A, especially if using Wi-Fi or Ethernet, to prevent brownouts or instability. Avoid powering the board through the 5V pin unless you have a stable, regulated 5V source capable of supplying sufficient current, as this bypasses the onboard regulator.

The Yún Rev2 operates at a logic level of 5V, meaning its digital pins HIGH state is 5V and LOW is 0V. When interfacing with sensors or modules that operate at 3.3V, it is crucial to use a level shifter to prevent damage to the 3.3V device. Connecting a 5V output directly to a 3.3V input can cause permanent damage. Conversely, 3.3V outputs from a sensor can generally be read by the Yún Rev2's 5V inputs without issue, though it's always good practice to check the specific sensor's specifications.

For a simple LED project, connect the anode (longer leg) of an LED to a digital pin (e.g., D13, which also controls the onboard LED) through a current-limiting resistor (typically 220-330 ohms). Connect the cathode (shorter leg) of the LED to a GND pin. This setup ensures the LED receives the correct voltage and current, preventing it from burning out. For an I2C sensor, connect its VCC to the 3.3V or 5V pin (depending on the sensor's requirements), its GND to a GND pin, its SDA pin to the Yún Rev2's SDA pin (A4), and its SCL pin to the Yún Rev2's SCL pin (A5).

Programming & getting started

The Arduino Yún Rev2 can be programmed using the standard Arduino IDE (version 1.5.4 or later recommended). The ATmega32U4 microcontroller is programmed like any other Arduino board. For the Linux side, you can access it via SSH over Wi-Fi or Ethernet, or use specific libraries within the Arduino sketch to interact with the Linux system (e.g., running shell commands, managing files). The IDE handles uploading sketches to the ATmega32U4, and you can then use the Arduino IDE's built-in Bridge library or SSH to communicate with the Linux environment.

To upload your first sketch, connect the Yún Rev2 to your computer via the Micro-USB port. Select the correct board (Arduino Yún Rev2) and COM port in the Arduino IDE. Write a simple sketch, such as the Blink example, and click the Upload button. Once uploaded, you should see the onboard LED blink. To interact with the Linux side, you can enable SSH and log in to the board to explore its file system and run commands.

Project ideas

Networked Weather StationMonitor temperature, humidity, and pressure using sensors connected to the ATmega32U4. The Linux system can then host a web server to display real-time data or send it to a cloud service via Wi-Fi or Ethernet, learning about IoT data transmission and web hosting.
Smart Home HubUse the Yún Rev2 as a central controller for smart home devices. The ATmega32U4 can manage low-level communication (e.g., with RF modules), while the Linux environment handles network protocols (MQTT, HTTP) and user interfaces, learning about embedded system integration and network communication.
Data Logger with Cloud SyncCollect sensor data over long periods and store it on the Yún Rev2's SD card (if available) or internal flash. The Linux system can then periodically upload this data to a cloud platform like ThingSpeak or AWS IoT, mastering data management and asynchronous cloud communication.
Personal Web ServerHost a simple website directly on the Yún Rev2. The Linux system can run Apache or Nginx, serving HTML pages and handling requests from your local network or the internet, exploring embedded web server technologies.
Remote Robot ControlBuild a robot with motors and sensors connected to the ATmega32U4. Control it remotely via a web interface hosted on the Yún Rev2, allowing you to send commands over Wi-Fi or Ethernet, combining robotics with network control.
Automated Plant Watering SystemUse analog pins to read soil moisture and digital pins to control a water pump. The Linux system can manage scheduling, log watering events, and even send notifications via email or SMS, learning about automation and event-driven systems.

Buying tips & gotchas

When purchasing an Arduino Yún Rev2, be aware of potential counterfeit versions which may have performance issues or lack full functionality. Always buy from reputable distributors. Ensure you have a reliable power supply (7-12V, at least 1A) and consider a heatsink for the Atheros chip if running demanding applications. Accessories like an Ethernet cable, Wi-Fi antenna, and potentially an SD card for expanded storage will greatly enhance your projects. Familiarize yourself with basic Linux command-line operations, as this is key to unlocking the full potential of the Yún Rev2's dual-processor architecture.