MakerLab
ArduinoArduino Yún

Arduino Yún: Bridging Microcontrollers and Linux for Connected Projects

The Arduino Yún integrates a powerful microcontroller with a Linux-based system on a single board, ideal for internet-connected projects.

Arduino Yún

The Arduino Yún, released in 2013, was a groundbreaking board in the Arduino family, designed to bridge the gap between traditional microcontrollers and full-fledged computing systems. It features a dual-processor architecture: an ATmega32U4 microcontroller for real-time control and I/O operations, and a dedicated Atheros AR9331 System-on-Chip (SoC) running a Linux distribution. This unique combination allows for complex tasks like network communication, running custom applications, and managing data, while the ATmega32U4 handles low-level hardware interactions.

At its heart, the Yún is powered by two main components. The first is the Atmel ATmega32U4, a familiar AVR microcontroller found in many other Arduino boards like the Leonardo and Micro. This chip provides 32KB of Flash memory, 2.5KB of SRAM, and a suite of peripherals including UART, SPI, I2C, and analog-to-digital converters. The second, more powerful component is the Atheros AR9331, a MIPS-based SoC that includes a 400MHz CPU, Wi-Fi (802.11 b/g/n), Ethernet connectivity, and runs Linino OS, a lightweight Linux distribution based on OpenWrt.

The Yún's design makes it particularly well-suited for makers and developers who need to build internet-connected devices, IoT prototypes, or projects requiring more processing power and flexibility than a standard Arduino can offer. Its ability to run Linux means you can install additional software packages, develop complex applications in Python or other languages, and leverage its built-in Wi-Fi and Ethernet for seamless integration with the internet or local networks. This board appeals to those looking to move beyond simple sensor readings and actuator control into more sophisticated embedded systems development.

Historically, the Yún represented a significant step for Arduino, moving beyond the single-microcontroller paradigm. It was developed in collaboration with Intel and later adopted the Atheros AR9331 for its Wi-Fi and Ethernet capabilities. This board paved the way for future Arduino boards that integrated more advanced processing and connectivity features, demonstrating the potential of hybrid architectures in embedded development.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCAtmel ATmega32U4 and Atheros AR9331 (MIPS 24K)
ArchitectureAVR (ATmega32U4) and MIPS (Atheros AR9331)
Clock speed16 MHz (ATmega32U4) and 400 MHz (Atheros AR9331)
Flash / Storage32 KB (ATmega32U4) + 64 MB NAND Flash (Atheros AR9331)
RAM / SRAM2.5 KB SRAM (ATmega32U4) + 64 MB DDR2 RAM (Atheros AR9331)
Operating voltage5V (ATmega32U4) / 3.3V logic
Digital I/O pins20 (ATmega32U4)
Analog / ADC7 (ATmega32U4, 10-bit)
PWM7 (ATmega32U4)
ConnectivityWi-Fi 802.11 b/g/n, Ethernet 10/100 Mbps
USB1x Micro-USB (programming/power), 1x USB-A (host)
Power input7-12V DC via barrel jack, 5V via Micro-USB
Dimensions73 mm x 53 mm

Pinout & pin functions

PinFunction
5VPower output (regulated)
3.3VPower output (regulated)
GNDGround
GNDGround
IOREFVoltage reference for I/O pins
RESETSystem reset pin
D0 (RX)Digital I/O, UART receive
D1 (TX)Digital I/O, UART transmit
D2Digital I/O
D3Digital I/O, PWM
D4Digital I/O
D5Digital I/O, PWM
D6Digital I/O, PWM
D7Digital I/O
D8Digital I/O
D9Digital I/O, PWM
D10 (SS)Digital I/O, SPI slave select
D11 (MOSI)Digital I/O, SPI Master Out Slave In
D12 (MISO)Digital I/O, SPI Master In Slave Out
D13 (SCK)Digital I/O, SPI clock
A0Analog Input (ADC)
A1Analog Input (ADC)
A2Analog Input (ADC)
A3Analog Input (ADC)
A4 (SDA)Digital I/O, I2C data
A5 (SCL)Digital I/O, I2C clock
D14 (TX1)Digital I/O, Second UART transmit
D15 (RX1)Digital I/O, Second UART receive
VINPower input (7-12V recommended)
3.3VPower input (if using external 3.3V source)
5VPower input (if using external 5V source)
GNDGround
ON/OFFPower switch

Wiring & circuit basics

Powering the Arduino Yún can be done via its barrel jack (7-12V DC recommended) or the Micro-USB port (5V DC). The barrel jack is connected to an onboard voltage regulator that supplies 5V and 3.3V to the board's components. Ensure your power supply can provide at least 500mA, and ideally 1A or more, especially if using Wi-Fi or Ethernet extensively. Connecting a power source to both the barrel jack and Micro-USB simultaneously is not recommended. Always double-check polarity before connecting power to avoid damage.

The Arduino Yún operates at 3.3V logic levels for its ATmega32U4 microcontroller. This means that when interfacing with sensors or modules, you must ensure they are compatible with 3.3V or use a logic level converter. Connecting a 5V device directly to a 3.3V input pin can damage the microcontroller. Conversely, connecting a 3.3V output to a 5V input might not be reliably detected. For example, to connect an LED, use a digital pin (e.g., D7) and a current-limiting resistor (typically 220-330 ohms) to prevent excessive current draw. Connect the other end of the resistor to the LED's anode, and the LED's cathode to a GND pin.

For an I2C sensor like a BME280, connect its VCC pin to the Yún's 3.3V pin, its GND to a GND pin, its SDA pin to the Yún's SDA (A4) pin, and its SCL pin to the Yún's SCL (A5) pin. The Yún's I2C pins (A4/A5) are connected to the ATmega32U4, which handles the I2C communication protocol. The Linux side can also access I2C devices if properly configured, but direct microcontroller control is often simpler for real-time sensor readings.

Programming & getting started

The Arduino Yún can be programmed using the standard Arduino IDE. When selecting the board, choose 'Arduino Yún'. Uploading sketches to the ATmega32U4 is done via the Micro-USB port, similar to other Arduino boards. For more advanced Linux-based applications, you can SSH into the Yún's operating system (Linino OS) and develop directly on the board, or use tools like Python with libraries such as `python-linino` or `pyupm` to interact with the microcontroller and system resources. PlatformIO is also a popular choice for managing complex projects on the Yún.

To upload your first sketch (e.g., a Blink example), connect the Yún to your computer via the Micro-USB port. Open the Arduino IDE, select 'Arduino Yún' from the Tools > Board menu, and choose the correct COM port under Tools > Port. Then, load the Blink example sketch (File > Examples > 01.Basics > Blink), click the Upload button. The ATmega32U4 will reset and the sketch will be compiled and flashed onto its internal Flash memory.

Project ideas

IoT Weather StationMonitor temperature, humidity, and pressure using sensors connected to the ATmega32U4. Transmit data wirelessly via the Yún's Wi-Fi and display it on a web server running on the Linux side, or send it to a cloud service.
Networked Robot ControlBuild a simple robot and control its motors and sensors using the ATmega32U4. Command the robot remotely via a web interface hosted on the Yún's Linux system, allowing control over Wi-Fi or Ethernet.
Smart Home HubUse the Yún as a central hub to connect and manage various smart home devices. The Linux side can run home automation software, while the ATmega32U4 interfaces with low-level hardware like relays or sensors.
Data Logger with Web InterfaceLog sensor data to the onboard Flash memory or an SD card. The Linux system can host a web server to display historical data, allowing users to access and analyze logs remotely.
Security Camera StreamerConnect a USB webcam to the Yún's USB-A port. Use the Linux system to capture video frames and stream them over the network via Wi-Fi or Ethernet, creating a basic IP camera.
Wireless Sensor Network GatewayAggregate data from multiple remote Arduino or ESP devices via wireless protocols (e.g., ESP-NOW, LoRa) and forward it to the internet using the Yún's Wi-Fi or Ethernet connection. The ATmega32U4 can manage the communication protocols.

Buying tips & gotchas

When purchasing an Arduino Yún, be aware that it is an older board and may be harder to find new. Look for reputable sellers or consider used options. Be cautious of 'Yún-like' boards that may not have the same dual-processor architecture or feature set. Ensure you have a compatible 5V Micro-USB cable for programming and power, and a suitable 7-12V DC power adapter for the barrel jack. Accessories like an SD card for expanded storage on the Linux side, or a breadboard and jumper wires for prototyping, will be very useful.