Tag Archives: Linino

Building a Yún-powered weather station

The Arduino Yún – designed in collaboration with Dog Hunter – is based on Atmel’s popular ATMega32u4 microcontroller (MCU) and also features the Atheros AR9331, an SoC running Linino, a customized version of OpenWRT. The Yún is somewhat unique in the Arduino lineup, as it boasts a lightweight Linux distribution to complement the traditional microcontroller (MCU) interface.

The Atmel-powered Yún – which hit the streets late last year – has been used in a wide variety of Maker projects that we’ve recently covered on Bits & Pieces, including an electricity monitor, mesh extender platform, Foursquare soap bubble machine, a Gmail (alert) lamp, water heater regulator and Evil Alarm System.

Today, we’re going to be taking a look at how Marc-Olivier Schwartz built a cloud-connected weather station with the Yún. Aside from the Atmel-based board, key hardware specs include:

  • DHT11 (or DHT22) sensor and 4.7K resistor (for humidity)
  • 
BMP085 sensor on a simple breakout board/Adafruit BMP180 sensor board (for pressure and temperature)
  • Photocell with a 10K Ohm resistor (light level)
  • Breadboard + assorted male-male jumper wires

On the software side, Schwartz used the Arduino IDE, Temboo, DHT library, the BMP085/BMP180 library, unified sensor library and a Google Docs account for the collected data to be analyzed and stored.

“The hardware connections for this project are actually quite simple: we have to connect the DHT11 sensor and then the part responsible for the light level measurement with the photocell. First, connect the Arduino Yun +5V pin to the red rail on the breadboard and the ground pin to the blue rail,” Schwartz explained in a detailed Adafruit tutorial.

“Then, connect pin number 1 of the DHT11 sensor to the red rail on the breadboard and pin number 4 the blue rail. Also connect pin number 2 to pin number 8 of the Arduino Yún. To finish up with the DHT11 sensor, connect the 4.7k Ohm between pin number 1 and 2 of the sensor.”

Next up is the photocell.

“First place the cell in series with the 10k Ohm resistor on the breadboard. Then, connect the other end of the photocell to the red rail on the breadboard and the other end of the resistor to the ground. Finally, connect the common pin to the Arduino Yún’s analog pin A0,” Schwartz continued.

“For the BMP085 or BMP180 sensor, connect the VIN pin to the +5V, GND to Ground, SCL to Arduino Yún pin number 3 and SDA pin to Arduino Yún pin number 2.”

According to Schwartz, multiple Yún boards can be used in various parts of a single residence.

“You can also customize the email alert part: you can build more complex alerts based on the measured data, or set the project to email you the sensor data at a regular time interval,” he added.

Interested in learning more? You can check out Schwartz’s full Adafruit tutorial here.

Orders kick off for Arduino’s Yún

The Atmel-powered Arduino Yún can now be snapped up for $69, or €52. The  Yún – designed in collaboration with Dog Hunter – is based on Atmel’s ATMega32u4 microcontroller (MCU) and also features the Atheros AR9331, an SoC running Linino, a customized version of OpenWRT. As previously discussed on Bits & Pieces, the Yún is somewhat unique in the Arduino lineup, as it boasts a lightweight Linux distribution to complement the traditional microcontroller (MCU) interface.

The Yún also features WiFi and Ethernet connections, enabling the board to communicate with networks out of the box. In addition, the Yún’s Linux and Arduino processors link through the Bridge library, allowing Arduino sketches to send commands to the command line interface of Linux.

“The Arduino Yún has the same footprint as an Arduino Uno but combines an ATmega32U4 microcontroller (the same as the Leonardo) and a Linux system based on the Atheros AR9331 chipset,” Arduino’s Federico Vanzati explained. “Additionally, there are built-in Ethernet and WiFi capabilities. The combination of the classic Arduino programming experience and advanced internet capabilities afforded by a Linux system make the Yún a powerful tool for communicating with the internet of things (IoT).”

According to Vanzati, the Yún’s layout keeps the I/O pins the same as the Leonardo and is therefore compatible with the most shields designed for Arduino.

“With the Yún’s auto-discovery system, your computer can recognize boards connected to the same network. This enables you to upload sketches wirelessly to the Yún,” he continued. “You can still upload sketches to the Yún through the micro-USB connector just as you would with the Leonardo.”

On the connectivity side, the Yún is equipped with two separate network interfaces, a 10/100 Mbit/s Fast Ethernet port and a IEEE 802.11 b/g/n standard compliant 2.4GHz WiFi interface, supporting WEP, WPA and WPA2 encryption. As expected, the WiFi interface can also operate as an access point (AP). In AP mode any WiFi enabled device can connect directly to the network created on the Yún. While a Yún in this mode can’t connect to the internet, it could act as a hub for a group of WiFi enabled sensors.

Alongside the new board, Arduino has rolled out IDE 1.5.4  with a number of general bug fixes and new features, including:

  • Board recognition – The IDE recognizes the type of board Makers and engineers are working with every time an Arduino is connected.
  • Memory – When a sketch is uploaded, the IDE displays just how much memory is being used.
  • Copy Error button: Users can more easily copy and paste errors to share in various forums.

The Arduino Yún can be ordered here. Additional information about the Yún’s hardware and key specs are available here, while a detailed explanation of the Yun’s bridge can be read here.

A closer look at the Atmel-powered Arduino Yún

The Arduino Yún – designed in collaboration with Dog Hunter – is based on Atmel’s ATMega32u4 microcontroller (MCU) and also features the Atheros AR9331, an SoC running Linino, a customized version of OpenWRT.

The new Atmel-powered board will be available on September 10, so today we’ll be taking a closer look at the Yún’s hardware. As previously discussed on Bits & Pieces, the Yún is somewhat unique in the Arduino lineup, as it boasts a lightweight Linux distribution to complement the traditional microcontroller (MCU) interface.

The Yún also features WiFi and Ethernet connections, enabling the board to communicate with networks out of the box. In addition, the Yún’s Linux and Arduino processors link through the Bridge library, allowing Arduino sketches to send commands to the command line interface of Linux.

“The Arduino Yún has the same footprint as an Arduino Uno but combines an ATmega32U4 microcontroller (the same as the Leonardo) and a Linux system based on the Atheros AR9331 chipset,” Arduino’s Federico Vanzati explained. “Additionally, there are built-in Ethernet and WiFi capabilities. The combination of the classic Arduino programming experience and advanced internet capabilities afforded by a Linux system make the Yún a powerful tool for communicating with the internet of things (IoT).”

According to Vanzati, the Yún’s layout keeps the I/O pins the same as the Leonardo and is therefore compatible with the most shields designed for Arduino.

“With the Yún’s auto-discovery system, your computer can recognize boards connected to the same network. This enables you to upload sketches wirelessly to the Yún,” he continued. “You can still upload sketches to the Yún through the micro-USB connector just as you would with the Leonardo.”

On the connectivity side, the Yún is equipped with two separate network interfaces, a 10/100 Mbit/s Fast Ethernet port and a IEEE 802.11 b/g/n standard compliant 2.4GHz WiFi interface, supporting WEP, WPA and WPA2 encryption. As expected, the WiFi interface can also operate as an access point (AP). In AP mode any WiFi enabled device can connect directly to the network created on the Yún. While a Yún in this mode can’t connect to the internet, it could act as a hub for a group of WiFi enabled sensors.

As Vanzati notes, interfacing Arduino with web services has historically been rather challenging due to memory restrictions.

“[However], the Yun’s Linux environment simplifies the means to access internet services by using many of the same tools you would use on your computer,” he said. “You can run several applications as complex as you need, without stressing the ATmega microcontroller.”

To help engineers and Makers develop applications that can connect to popular web services, Arduini has partnered with Temboo, a service that simplifies accessing hundreds of the web’s most popular APIs. In fact, a Temboo library is packaged with the Yún, making it easy to connect to a large variety of online tools.

Facilitating a seamless connection between the two processors is achieved via the Yún’s Bridge library, which connects the hardware serial port of the AR9331 to Serial1 on the 32U4 (digital pins 0 & 1).

“The serial port of the AR9331 exposes the Linux console (aka, the command line interface, or CLI) for communication with the 32U4,” Vanzati confirmed. “The console is a means for the Linux kernel and other processes to output messages to the user and receive input from the user. File and system management tools are installed by default. It’s also possible to install and run your own applications using Bridge.”

Of course, the ATmega32U4 can also be programmed from the AR9331 by uploading a sketch through the Yún’s WiFi interface. When connected to the same WiFi network as your computer, the board will appear under the “Port” menu of the Arduino IDE. The sketch will be transferred to the AR9331 and the Linux distribution will program the ATmega32U4 through the SPI bus, emulating an AVR ISP programmer.

Last, but certainly not least, the Yún can be powered through the micro-USB connector, the Vin pin, or the optional Power Over Ethernet (POE) module. When powering the board though the Vin pin, users must supply a regulated 5VDC, as there is no on-board regulator for higher voltages.

Additional information about the Atmel-powered Arduino Yún can be found on the board’s official page here.