Readers interested in microcontrollers should have heard of Arduino or even used it, but many still do not understand what Arduino is. Today, I will briefly describe Arduino-related content for beginners.
1. Introduction to Arduino
To understand Arduino, one must first understand what a microcontroller is. The foundation of the Arduino platform is actually the AVR instruction set of microcontrollers.
1. What is a Microcontroller?
A working computer consists of several parts: Central Processing Unit (CPU for computation and control), Random Access Memory (RAM for data storage), Read-Only Memory (ROM for program storage), and Input/Output devices (such as serial and parallel ports). In personal computers (PCs), these parts are divided into several chips installed on a printed circuit board called the motherboard. In a microcontroller, all these parts are integrated into a single integrated circuit chip, hence the name “microcontroller” (single-chip machine). Some microcontrollers also integrate other components such as Analog-to-Digital (A/D) and Digital-to-Analog (D/A) converters.
2. What is the Use of Microcontrollers?
As the saying goes, using a sledgehammer to crack a nut is not necessary in every situation. Not every scenario requires high performance. Imagine a voice-controlled lamp using an Intel i7 processor; its cost-effectiveness would be astonishingly low. The key to application is whether it is sufficient and whether it has a good performance-to-price ratio, which is where microcontrollers fill the gap.
Returning to the topic, what is Arduino?
Arduino is a convenient, flexible, and user-friendly open-source electronic prototyping platform that includes hardware (various models of Arduino boards) and software (Arduino IDE). It is suitable for artists, designers, enthusiasts, and anyone who wants to tinker. Its characteristics include a simple shape that allows interaction with people, and even a ten-year-old child can use it to create something they want. Arduino can sense the environment through various sensors and can control lights, motors, and other devices to respond to and influence the environment. The microcontroller on the board can be programmed through Arduino’s programming language, compiled into binary files, and uploaded to the microcontroller. Projects based on Arduino can consist solely of Arduino or include other software running on a PC that communicates with Arduino (such as Flash, Processing, MaxMSP) to achieve functionality.
2. Types of Arduino
There are too many Arduino boards available on the market. Setting aside the dozen or so official ones, there are thousands of various Arduino boards on platforms like Taobao, making it quite daunting for beginners. Choosing the right Arduino for a project is half the success, so let’s take a look at the most common Arduino boards and how to differentiate them.

To differentiate between so many boards and select the appropriate Arduino, focus on the following three aspects: performance, features, and size.
First, look at performance, which includes processor memory, clock frequency, and bit width. The hardware processing capability usually depends entirely on the chip on the board, which also limits the software that can run.
Second, consider features, which include everything on the board besides the microprocessor, such as input/output pins, integrated components (buttons, LEDs, motor drivers, etc.), and the types and quantities of available interfaces (USB, Ethernet, etc.).
Finally, consider size. Due to the nature of projects, the volume and weight allocated for electronic components can vary significantly. For example, to make a tracker for a dog, using a Mega board along with a battery pack and expansion board would require at least a size of 10*5*5cm and weigh 200g. Is this a tracker or a sandbag? This is why Arduino has so many siblings.
Having said that, let’s see what the mainstream Arduino boards are.
1. Arduino Uno
Processor: ATmega328 (8-bit CPU, 16MHz clock frequency, 2KB SRAM, 32KB flash memory)
Features: 14 digital I/O ports, 6 analog input ports, replaceable processor design
Size: 75 x 55mm
Price: $30
2. Arduino Leonardo
Processor: ATmega32u4 (8-bit CPU, 16MHz clock frequency, 2.5KB SRAM, 32KB flash memory)
Features: 20 digital I/O ports, 12 of which can be used as analog ports, native USB support
Size: 75 x 55mm
Price: $25
3. Arduino Due
Processor: Atmel SAM3X8E ARM Cortex-M3 (32-bit CPU, 84MHz clock frequency, 96KB SRAM, 512KB flash memory)
Features: 54 digital I/O ports, 12 analog input ports, 2 analog output ports, native USB support
Size: 100 x 55mm
Price: $50
4. Arduino Micro
Processor: ATmega32u4 (8-bit CPU, 16MHz clock frequency, 2.5KB SRAM, 32KB flash memory)
Features: 20 digital I/O ports, 12 of which can be used as analog ports, native USB support
Size: 50 x 18 mm
Price: $27
5. LilyPad Arduino
Processor: ATmega328 (8-bit CPU, 16MHz clock frequency, 2KB SRAM, 32KB flash memory)
Features: 14 digital I/O ports, 6 analog input ports
Size: 50mm diameter round
Price: $22
The purpose of this small experiment is to light up the LED on pin 13 of the Arduino UNO board for one second, then turn it off for one second, and repeat this process.
Now, let’s assume we are using the Arduino UNO model control board (it is recommended for beginners to use UNO as it is stable) and that we have already set up the Arduino development environment and installed the USB driver according to the steps above.
1. Connect Arduino Control Board to Computer
Connect one end of the USB cable to the Arduino control board and the other end to the USB port on the computer. (Note: When operating independently, the Arduino control board can be powered either via USB or using a power bank or power adapter.)
Connecting Arduino Control Board to Computer
Open Arduino IDE, and the editing interface of Arduino IDE will appear.
2. Understanding Arduino IDE
Let’s first get to know this compiler for Arduino, as we will frequently interact with it in the future.
Arduino IDE is the software editing environment for Arduino products. In simple terms, it is where you write and download code.
Any Arduino product needs to download code before it can operate.
The hardware circuit we set up assists the code in completing tasks; both are indispensable. Just as a person controls bodily movements through the brain, if the code is the brain, the hardware is the body; bodily movements depend on the brain, so hardware implementation depends on the code.
The basic functional areas of Arduino IDE have been marked in the above image (I used an old image for convenience, but the layout is the same as the new version). Most of the white area in the image is the code editing area, where you input code. Note that when entering code, you must switch to English input mode. The black area below is the message prompt area, which will display whether the compilation or download was successful.
3. Download a Blink Program
Download the simplest code, which can help us familiarize ourselves with how to download programs while testing the board’s functionality.
The LED marked “L” on the UNO board will blink with this test code.
4. Open Blink
Plug in the USB cable, open Arduino IDE, and find the “Blink” code.
File > Examples > 01.Basics > Blink
5. Verify the Program
Usually, after writing a piece of code, we need to verify it to see if there are any errors. Click “Verify”.
After verification (compilation), you will see the corresponding prompt.
Since this is sample code, there should be no errors during verification. However, in the future, after entering code, you will need to verify it before downloading it to the Arduino.
Before downloading the program, we also need to tell Arduino IDE what board we are using and which serial port corresponds to it.
6. Set Board Type
Arduino includes various versions of controllers, among which the most common are the Uno, Leonardo, and Mega series controllers (the most comprehensive selection guide).
In the board section, you need to select the board type based on the firmware type of the control hardware you have chosen. (The example uses a controller with Uno as the bootloader) Tools > Board > Arduino Uno
7. Set Serial Port
Tools > Serial Port > xx, where xx should match what you see in your computer’s device manager.
8. Download the Program
As shown, finally, click “Upload”. (Uploading and downloading are actually the same in this context.)
Upload complete!
If everything goes well, we will visually see the program running on the board:
The LED on pin 13 of the Arduino Uno board is blinking.
Alright, these are the most basic operations of the IDE.
Disclaimer:Some materials in this article are sourced from the internet, and copyright belongs to the original authors. If there are any copyright issues, please contact me for removal.
The Unique Use of “##” in C Language
USB 2.0 Networking, Transmission, Communication, and Protocols
Sharing 5 Basic Linux Command Line Tool Alternatives
Long pressto go to the public account included in the imageto follow