It is believed that friends who are interested in embedded development must have some understanding or familiarity with Arduino. For beginners, they often hear the saying, “Where is the best place to start embedded development? Arduino!” So what exactly is Arduino? Is it a new control chip? Or a new development software?
First, let’s take a look at the physical image of Arduino. Below is the most common physical image of an Arduino (we will detail the classification of Arduino later):
The image has already used red lines to distinguish various modules by function. Friends who have a little understanding of microcontroller development must have noticed that this is just a control board with the AVR microcontroller as the core.
Indeed, Arduino is a microcontroller control board based on ATMEL’s AVR microcontroller. In addition to the ATmega168 minimum system circuit, it also includes a voltage regulator circuit, USB-to-serial circuit, some indicator LEDs, and some expansion circuit sockets.
Why can a simple microcontroller minimum system become popular globally?
Let’s compare the bare ATmega168, the general microcontroller development boards on the market, and Arduino in a tabular format.
ATmega168 Bare |
Arduino |
ATmega168 Development Board |
|
Computational Performance |
Same |
Same |
Same |
Cost |
Lowest |
Lower |
Higher |
Size |
Smallest |
Medium |
Larger |
Freedom |
Maximum |
All ports except those required for normal operation of the microcontroller are left for user use |
Many development boards integrate keyboards, digital tubes, jumper switches, etc., occupying many ports |
Standardization |
Fully complies with the chip information published by ATmega |
Fully complies with the standards published by the Arduino organization |
Most are independently developed by various suppliers, each different |
Operating Conditions |
Requires building the minimum circuit by oneself |
Can be used by connecting to a PC via USB |
Can be used by connecting to a PC via USB or COM port |
Development Resources |
Any ATmega168 resources can be used, but some details need to match with one’s own circuit |
Rich English resources, but some Chinese resources are slightly lacking. |
Generally, development board suppliers provide various learning materials, but most are chaotic, requiring learners to discern themselves |
The table above lists the most intuitive comparisons of three options (the table does not compare the convenience of purchasing channels, as this is no longer a special concern for enthusiasts with the popularity of online shopping). It seems that Arduino does not have a particular advantage, so why is it so highly sought after?
To answer this question, we must first review the development history of Arduino. In 2005, Massimo Banzi, a teacher at a high-tech design school in Ivrea, Italy, designed the initial Arduino circuit board in collaboration with Spanish chip engineer David Cuartielles, who was visiting that school, to provide students with an affordable and easy-to-use microcontroller platform. Subsequently, Arduino began to gain popularity rapidly in Europe and gradually spread to the United States, Japan, Taiwan, and Hong Kong, and in the past couple of years, it has flourished in mainland China.
Arduino’s unique advantages are reflected in the following aspects:
Openness: The hardware circuit and software development environment of Arduino are completely open source. Anyone can use, modify, and distribute it without engaging in commercial purposes. This not only helps users better understand the circuit principles of Arduino but also allows them to modify it according to their needs. For example, due to space limitations, one may need to design a special-shaped circuit board or integrate their expansion circuit with the main control circuit.
Ease of Use: For anyone with a little interest, regardless of their background, they should be able to successfully run their first simple program within an hour after getting Arduino. Arduino connects to PCs using the most mainstream USB connection, allowing you to connect Arduino directly to your computer like using an MP3 player without needing to install any additional drivers. Moreover, the development environment software of Arduino is very simple, with a clear menu, only providing the essential toolbar, eliminating all elements that may confuse beginners. You can even compile and download code without reading the manual (I didn’t say writing).
Communication: For beginners, communication and demonstration are very effective ways to stimulate learning enthusiasm. However, sometimes, if you build a tracking car with AVR and I build a tracking car with PIC, there might be some communication difficulties for beginners who don’t have a deep understanding of microcontrollers. Arduino has established a relatively unified framework, using a uniform method for some low-level initializations, and has standardized the ports used for digital and analog signals, making it very convenient for beginners to communicate about circuits or programs.
Rich Third-Party Resources: Both the hardware and software of Arduino are completely open source, allowing you to deeply understand all underlying mechanisms and providing a very friendly interface for third-party library development. Upholding the openness and sharing of the open-source community, many enthusiasts share their hardware and software after successfully implementing their designs. For newcomers, you can easily find some basic functional modules you want to use in the Arduino community: servo control, PID speed regulation, A/D conversion, etc. Particularly, some module suppliers are increasingly valuing the Arduino community and provide usage libraries for their products under Arduino, greatly facilitating Arduino developers, allowing them to focus more on their desired functional designs rather than being bogged down by basic functionality coding.
Indeed, purely from a technical perspective of embedded development, Arduino is not the first choice. To accommodate beginners and even those who are new to electronic development, Arduino has customized many low-level designs, which is one reason many experienced embedded designers look down on Arduino. Looking back at the advantages of Arduino listed above, what is Arduino’s positioning?
Arduino was indeed born for learning embedded development, but today, it has far exceeded the field of embedded development. In Taiwan, Arduino is referred to as “technology art,” and many enthusiasts outside the electronic technology field have designed many interesting works with their rich imagination and creativity.
In mainland China, Arduino is still more commonly seen as a learning and development tool for embedded systems, but its charm is far from limited to this. It can completely serve as a new “toy” or even a new artistic medium to attract more people from various fields into the magical world of Arduino.
A three-wheeled car controlled by Arduino
An automatic machine that erases whiteboards
A machine that automatically brews coffee when you tweet
Are you already eager to start your Arduino journey? Quickly search for Arduino on shopping websites, and… are you dazzled by the various Arduino control boards?
Arduino is not static; every once in a while, the official Arduino organization releases the latest design, upgrading Arduino on the original basis to make it easier for enthusiasts to use. At the same time, to meet different levels of development requirements, Arduino has also launched different versions of control board designs. Here, let’s get to know some of the most commonly used designs:
Arduino Uno
The Uno version can be said to be the basic board of Arduino and the first choice for beginners. It provides basic data interfaces and sufficient storage space for beginners, easily handling tasks such as reading sensors, driving motors, or communicating with computers.
Arduino Mega 2560
This version can be considered an upgraded version of Uno, with more interfaces than Uno, and the microcontroller model it carries is also more advanced than that of Uno, with faster computation speed. If you find that Uno’s hardware resources cannot meet your needs, you can try Mega, though it will be more expensive than Uno.
Arduino Nano
This can be considered a simplified version of Uno, prioritizing size optimization to make it as small as possible, suitable for some handheld devices or devices with a small form factor. Of course, its performance is slightly reduced compared to Uno.
Some eager friends might already be asking: Which one can control stepper motors? Which one can achieve wireless communication? Which one can play music…
If I tell you none of them can do that, would you be disappointed?
As a control chip, Arduino functions similarly to our brain; the brain cannot move or speak on its own. The role of the brain is like a commander, and so is Arduino. To perform practical tasks, it cannot do without the support of peripheral circuits.
Many people are troubled by the lack of understanding of electronic circuits. However, this is no longer a major issue. For students majoring in electronics or enthusiasts who want to learn about electronic circuits, they need to rely on themselves by researching materials, purchasing components, making PCB boards, and soldering circuits. This will involve a lot of hard work, but the knowledge gained is undoubtedly worth it.
If you do not want to spend too much energy on electronic circuits, that’s fine. Many manufacturers have developed various Arduino peripheral function circuits, whether it’s motor drives, wireless communication, music playback, or reading various physical signal sensors (pressure, speed, tilt, direction, etc.), everything is available, and they are easy to use, directly connecting to the Arduino control board to work.
Motor Driver Board
Bluetooth Module
Hall Sensor, Light Sensor, Smoke Sensor
Having discussed hardware, let’s move on to the software development that many people find challenging. The code structure of Arduino is slightly different from that of general embedded code structures. General embedded code usually has a main function with a dead loop, continuously executing the program, where the microcontroller reads data from various external ports in each loop and makes corresponding strategy judgments based on this data, sending commands back through external ports to control external devices.
The operation method of Arduino code is similar, but the structure of the code is slightly different. Arduino code does not have a main function but uses two different essential functions:
Void setup()
{
}
Void loop()
{
}
Many friends have probably guessed that the initialization code is placed in the setup function, while the code that needs to be executed repeatedly is placed in the loop function. Although the structure is different from traditional embedded programs, the design concept is consistent.
Screenshot of the development environment software (this development environment can be downloaded for free from the Arduino website)
The syntax of Arduino code is similar to C++, and it includes support for classes and objects. Even those with no coding background can quickly get started. Regarding Arduino code writing, there are plenty of resources available on both the official Arduino website and online, which will not be elaborated here.
Many Arduino projects also involve another type of programming, which is the upper computer program. Generally, this is a PC-side program, and you can use any high-level language you are familiar with to receive data transmitted from the Arduino control board (serial transmission) and display output on the screen or write to a file. VB, VC++, Delphi, Flash script, Processing, etc., can all meet your requirements.
A program controlling the color of external circuit lights via a PC program
Arduino control board + peripheral circuit + program writing = the whole world!
A game controller made with Arduino
(Author: Hu Bo, Source: Robot Sky)
Interesting, deep, and technical, please scan the QR code to follow “Robot Network”
Leave a Comment
Your email address will not be published. Required fields are marked *