User Tools

Site Tools


arduino:what-makes-an-arduino

This is an old revision of the document!


What makes an Arduino?

Introduction

Everybody loves Arduino. It has broken the boundaries of the closed circle of Electronics Engineering and has brought micro-controller based automation closer to education, art, telecommunications and other disciplines. Even for the hard-core electronics engineers who had been working in the automation field since the 1980's, Arduino brought an abundance of sensors, libraries, support software and even more, very inexpensive hardware that can be purchased from several suppliers around the world.

But along with the spread of knowledge, comes a “broadening” of the accuracy that we use certain terms. I have heard people and read articles using the terms “Arduino”, “ATmega328”, “IoT” and even “MCU” to mean the exact same thing. In projects where a micro-controller can be used to provide a solution, I hear “just drop in an Arduino and make it work”. Even more, some people have come to expect that using an Arduino will skip all effort for designing, building and testing, making a new product available the next day.

So, what makes an Arduino?

Parts of the platform

According to the official web site:

Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing.

When the word “platform” appears, ambiguity always comes along. The above definition mentions:

  1. Arduino Boards
  2. Arduino programming language
  3. Arduino Software (IDE)

But is that all? Is this an all-inclusive definition? Are parts interchangeable? Could we use non-Arduino parts with Arduino? So let's have a look on my approach of “what really makes and Arduino”.

Arduino boards

The official Arduino boards are presented here. Arduino is an open-source platform, so anyone can use the published schematics and drawings to construct something similar. There are several clones utilizing the exact same design, or having small variations, e.g. in the power supply, in the USB-to-serial chip etc.

It is really important to identify that the Arduino boards are general-purpose devices. This means that they are not designed to accomplish a specific task, such as “measure the temperature in a room”. Of course, they can be used to build a composite board, comprising of an Arduino board and several other components.

Is the composite board an “Arduino board”? Definitely not. It could just be called an “Arduino-based” board.

Are there cases where the composite board cannot be called an “Arduino-based” board? Well, consider a huge board in a navigation control system of a rocket which contains an OMRON relay. Can the board be called “OMRON-based”? I guess not. The relay can be substituted with a component from another manufacturer. Slight modifications of the board may be required due to different dimensions, electrical characteristics etc., but certainly, it is not the component that gives the identity to the composite board.

The original Arduino UNO was designed around Atmel's ATmega328 MCU. If one uses an ATmega328 in a design, does it make it an Arduino? Well, if the MCU contains the bootloader and is probably programmed with the Arduino IDE, again probably using the Arduino programming language and libraries, it could be identified as “Arduino-based”. But in most cases and unless explicitly defined so, it is just a board with an ATmega328, containing the knowledge of its maker.

Peripherals

Several peripheral boards, such as containing relays, sensors etc claim to be “Arduino compatible”. Is there such a standardized compatibility? The short answer is NO. There are hundreds of variations in the power supply voltages, current requirements, clock and timing specifications, availability of libraries, Arduino MCU boards and peripherals etc. One must be very cautious when buying such a peripheral board. It is strongly advised to get a sample first and make sure that you buy the exact same thing when ordering larger quantities. And definitely, there is lots of Googling required before placing an order.

Most peripherals provide a more-or-less standard interface. If for example a peripheral supports SPI or I2C and provided that there exist an Arduino library, there are good chances that you can use it in your application. A certain amount of effort is required to learn the features and usage of the library. Sometimes, libraries are built to support so many platforms, architectures and features that it may be easier to built a custom one. An additional drawback of libraries found on the internet is that sometimes they are so packed with features, that consume a lot of the limited space of an MCU. I have found myself in several occasions with libraries so big, that it was not possible to write any code at all. In such cases, you may consider (not in precise order):

  1. not using the library and built custom code
  2. branching the library code and delete unnecessary features
  3. writing a custom library
  4. select a peripheral component with a less resource hungry library
  5. use an MCU with more resources

Note that having a peripheral being compliant with a protocol, does not necessarily mean that it is suitable for your application. For example, I was testing an SD memory module which supported SPI very well, but only when it was the one and only, single module using the SPI bus. Adding an additional SPI module, such as an Ethernet module, created electrical short-circuiting of the bus. You can see the whole article on SD Card Modules and their problems

Can those peripheral boards operate with non-Arduino boards? Mostly yes, unless one relies on a particular Arduino feature, or the cost of modifying the peripheral to work with another platform is so high (such as building a library from scratch) that does not justify the effort.

Arduino IDE

This is the environment used to write programs, which in Arduino language are called “sketches”. Actually, the term “sketch” is inherited from Processing, a Java based programming environment which:

promoted software literacy within the visual arts and visual literacy within technology

I have used Processing in the past to construct visually appealing user interfaces and, although it is built on Java, it is much easier to program than Java and also allows to create very fast-updating graphics.

From my point of view, the Arduino IDE is the component which carries the larger amount of weight of the Arduino name. It allows to write programs, compile and link, as well as upload to boards. It may use third party tools (avr-gcc, avrdude etc) to accomplish such functions, but it integrates all in the same environment, without going back and forth to individual applications. This integration has of course some limitations in contrast to those third party tools and the Arduino IDE has received a lot of criticism for that issue, but you cannot have it all!

Can the Arduino IDE be used to write programs for non-Arduino boards? Yes. People have written software to support other platforms such as the ESP8266. The IDE provides the capability to add additional board definitions and even language parts to support those other platforms. Of course, this does not make those other platforms Arduino.

Arduino language

You can use the Arduino programming language to write programs in the Arduino IDE. This is based on Wiring, which is:

Wiring is an open-source programming framework for microcontrollers.
Wiring allows writing cross-platform software to control devices attached to a wide range of microcontroller boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.

Anyone with a knowledge of C can start writing simple programs with the Arduino language very quickly. Good knowledge of C++ is required to understand how libraries work and even more, to start writing more complex programs and libraries. Additional effort in the knowledge building process is required in understanding electronics related issues, such as using the pins for inputs, outputs, motor control etc.

Arduino libraries

Libraries are extending the Arduino environment, adding functionality to accomplish certain tasks. There are pure software libraries, adding an algorithm or other utilities. For example, I had used a library that provides smoothing of measured data by averaging in a time window. Other libraries utilize the architecture of the micro-controller, such as timers, watchdogs etc., hiding the complexity of the micro-controller registers and processes.

Finally, libraries allow communication with the world outside the confines of the MCU, such as libraries to talk with Ethernet boards, SD cards, mobile cards, motors etc. Such libraries utilize communication protocols, either standard (I2C, SPI, serial etc) or proprietary for the purpose of interfacing the MCU to the peripheral device. Please refer to section Peripherals for issues regarding the association between peripherals and their support libraries.

Arduino platform provides standard and board specific libraries that are supported by the Arduino community. Other libraries may also be provided by component manufacturers and can be used also by non-Arduino platforms. Yet, in most cases, libraries found online are developed based on Arduino intricacies (e.g. pin assignment, usage of interrupts). Lots of C++ knowledge is required to go through the library source code, if provided and lots of Googling for other people experience.

Bootloader

The bootloader is the program that allows uploading user programs, such as sketches, onto the MCU. Is the bootloader part of the Arduino platform? Technically, it is not. You can write your program in the Arduino IDE and upload it using a programmer such as USBasp, without requiring a bootloader at all. You can even write your program in any environment and any programming language, compile it and somehow create a hex file with the binary code, and upload e.g. with avrdude.

Yet, the process of writing sketches in the Arduino IDE, compiling and uploading using the serial interface which in turn communicates with the bootloader to store the code in the MCU flash memory, makes the bootloader an indispensable part of the Arduino toolset.

Note also that the Arduino IDE allows burning a bootloader code, which is a file residing in the IDE folder structure, to the board of choice.

User software

The final part of this chain is the software developed by the user. Such software may be written to run on several Arduino as well as non-Arduino platforms. If such software relies on specific Arduino intricacies, such as the usage of timers, delays, interrupts etc. and it impossible to run on another platform, this makes it part of the Arduino environment. You may have noticed when examining code in libraries having lots of pre-processor #define directives, specifying code variations depending on the code compiled for specific architectures.

If the user decides to publish the code under an open-source license, it can also be made available to other users around the world.

Summary

I have tried to explain in a relative detail the parts that comprise the Arduino platform. I have also tried to show that although Arduino made the world of automation broader, simper and cheaper, it is definitely not a plug-and-play, suit-for-all, zero-development and zero-testing environment to build projects. A sufficient amount of knowledge in:

  1. electronics engineering,
  2. software engineering,
  3. mathematics,
  4. systems integration,
  5. industrial manufacturing

and perhaps other disciplines, along with health and safety considerations, is required to build a project.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
arduino/what-makes-an-arduino.1581080859.txt.gz · Last modified: 2020/02/07 15:07 by Ilias Iliopoulos