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 ().
You can find the list of official distributors of Arduino below:
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 (), 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 () 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.
– 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
– 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 (http://arduino.cc/en/Reference/YunBridgeLibrary#.Uxy0sc6hZPV) 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 ( ), 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: ) that allow in the URL to pass information to sketch and define custom API or to make standards calls for reading and writing values.