You are here

Non-invasive measurement of distances with Arduino Yun [Part 1]

In this part we will see how to build integrated mobile application with Arduino Yun for the non-invasive measurement of distances. We will use an ultrasonic sensor. This can be useful in many applications. For example I’ve used this app to measure the height of the walls of the house (useful for the development of energy certification).

First, some notes about Arduino Yun Board.

In mid-September 2013, the famous open source hardware company has launched a new board in their store, Arduino Yún, an evolution of the existing board Leonardo, but inside it small and great revolutions (Arduino Yun Intro).

You can find the list of official distributors of Arduino below:

Arduino distributors

Arduino Yún is indeed a very flexible board for the internet of things:

1) Ease of applications development (as in the previous and current Arduino boards) to manage and control sensors and actuators


2) Possibility of embedded wi-fi with which you can interact with the board through web services


3) Installation on board of  Linino (, a linux version based on OpenWRT (OpenWRT Wireless Freedom), one of the major distributions on embedded devices, thanks to which you can execute linux commands, also make your own shell or python scripts.


4)  Set of libraries very easy to use and born from a parallel start-up called Temboo (Temboo library for Arduino Yun) that enhance the interaction with the www (from social networks to email services) and the automation of sketch programming (programs that run on the board)


Arduino Yún is a very versatile board especially for home automation, but the applications are endless and especially to everyone.

The programming on the board is done by programs called sketch that must be implemented, compiled and loaded. Although the syntax is based on the C language, the processes relating to the actions to be implemented, however, are easy to understand and sections ready for the purpose can be found on the web.


In order to use and manage the sketch, remember to use the latest version of the Arduino IDE   (Arduino Software).

Arduino Yún mounts famous microcontroller ATmega32u4 (AtMega32 Technical Notes) for Arduino and Atheros AR9331 microprocessor for Linux. The Scheme Reference of Arduino Yún can be downloaded below:

Arduino Yun Schema


Arduino Microcontroller

– Microcontroller: ATmega32u4

– Flash Memory: 32 kB (4 KB for bootloader)

– SRAM: 2,5 kB (two slots 64kB e 32kB)

– EEPROM: 1 kB

– Clock: 16 MHz

– Power: 5 V

– Digital IN/OUT: 20 (7 may be used as PWM outputs)

– Analog IN 12

– DC current for pin I/O: 40 mA

– DC current for pin 3,3 V: 50 mA

Linux Microprocessor

– Microprocessor: Atheros AR9331

– Architecture: MIPS@400 MHz

– Power: 3,3 V

– Ethernet: IEEE 802.3 10/100Mbit/s

– Wi-Fi: IEEE 802.11b/g/n

– USB (type A): Host/Device

– Reader of SD card: only microSD

– RAM: 64 MB DDR2

– Flash Memory: 32 MB

– Support PoE board compliant 802.3af


The communication between microcontroller and microprocessor works by a library called Bridge (Bridge Library for Arduino Yun that allows the Arduino code (sketch) to interact with linux scripts and all of the information coming from linux.




In linux environment, you can also install or update new programs directly via Package Manager tool ( Yun Package Manager), while with the various free tools available on the market (ex. putty) it’s possible to access at command line via SSH, or you can calibrate the configuration of Linino with a web interface (called LuCi).

External/Client applications (web or mobile) can access to the board via web services (REST endpoints via JSON: Json and rest in slideshare)  that allow in the URL to pass information to sketch and define custom API or to make standards calls for reading and writing values.




If you want to learn and develop projects with Arduino Yun please visit facebook page (Arduino Yun Facebook Pages) that collects guides and web-based material and the official page in Arduino site (Arduino Yun Page from Official Site).

I have over ten years experience in project management and software architect in complex and innovative projects for multinational ICT. I have a electronic engineer extraction with automatic specialization. For years I deal with innovation also as an active contributor to several open hardware community as Rfduino, Arduino Yun, etc ... I think that in every company there is a need to co-create ideas and innovation from every person with tools and working groups motivated and sharing and dissemination of culture at all levels. Technology and research are not enough, if there is no interaction and sharing there can be no innovation.

Leave a Reply