Understanding Arduino and Its Basic Development Process

When facing an unknown thing, we should first clarify what it “is”, then understand what it can be used for, and finally learn why it exists.

What is Arduino?

To know is to know, to not know is to “Baidu” it.

Arduino is a convenient, flexible, and easy-to-use open-source electronic prototyping platform, which includes hardware (various models of Arduino boards) and software (Arduino IDE), developed by a European team in the winter of 2005. (Quoted from Baidu Encyclopedia)

Arduino is a set of electronic production standard kits based on microcontrollers, which encapsulates various complex hardware circuits and hardware-based programming, allowing electronics enthusiasts to engage in electronic production and development with just basic circuit knowledge and programming languages.

The term Arduino does not seem to be English (it should be an Italian word), and there are currently 3 to 4 pronunciations online, with more in the public. According to its inventor’s pronunciation, it should be pronounced as “a du i no”. Of course, how to pronounce it is not important; what matters is being able to use it.
If your English is good, you can learn Arduino by reading relevant tutorials on the English homepage (arduino.cc); if your English is not good, don’t worry, the Chinese community (arduino.cn) also has many tutorials and examples for you to learn.
Common Arduino hardware (various Arduino boards)
The main Arduino hardware development boards commonly used by beginners are Arduino NANO, Arduino UNO, and Arduino MEGA.
Understanding Arduino and Its Basic Development Process
↑ Arduino NANO
Understanding Arduino and Its Basic Development Process
↑ Arduino UNO
Understanding Arduino and Its Basic Development Process
↑ Arduino MEGA
If it’s your first time encountering Arduino, the Arduino UNO should be a good choiceUnderstanding Arduino and Its Basic Development Process. The specifications and resources for the Arduino UNO board are as follows.
Operating voltage:5V, can be powered throughUSB
Input voltage: external7V~12VDC input
Microprocessor:ATmega328P, rewrite life10,000 times
Clock frequency:16MHz
14 digital IO ports, maximum current is40mA
6 analog inputs:10-bit resolution, default input signal is0 to5V
LED: used for testing, LED reserved interface (13 pin), lights up when output is high
Understanding Arduino and Its Basic Development Process
Arduino Software
The integrated development environment for Arduino is Arduino IDE, which can be downloaded and installed from the Arduino Chinese community. The development language for Arduino is C/C++, providing a large number of resource libraries, many functions have already been encapsulated, and you just need to read the instructions to use them directly.
Understanding Arduino and Its Basic Development Process
↑ Arduino IDE
After the installation is complete, if you are using the official version of the Arduino UNO board, the IDE will automatically install the driver. At this point, connect the UNO board to the PC via USB cable, and the system will automatically recognize a serial port (view this in the “Device Manager“, where the serial port number is COM4).
Understanding Arduino and Its Basic Development Process
Understanding Arduino and Its Basic Development Process
If you are using a non-official version of the Arduino UNO board, you need to install the driver yourself. Search for the USB to serial chip model used on the board on Baidu to get the corresponding driver. The chip we are using is CH340, so search for “CH340 driver” on Baidu to download the driver.
Understanding Arduino and Its Basic Development Process
Click “Install” to install the driver. If the installation fails, you can first click “Uninstall”, then click “Install” again. After installing the driver, connect the UNO board to the PC via USB cable, and the system will also be able to recognize a serial port (view this in the “Device Manager”, where the serial port number is COM5).
Understanding Arduino and Its Basic Development Process
After the driver is installed, we can use Arduino IDE to edit the program.

Basic Arduino C Programming

  • The two most important functions in Arduino C language

loop() function, is the main function of Arduino, which will repeatedly execute this function after powering on, has no return value, and is a dead loop function.

setup() function, is the initialization function of Arduino, which executes this function once after powering on, and then executes the loop() function.
  • Functions for operating digital ports in Arduino
If you learn to operate the digital ports of Arduino, you can achieve many interesting functions (drive devices, simulate timing, etc.).
pinMode() function, is used to specify whether a digital port is an input function or an output function. Each digital port used only needs to be specified once, and can be called in the setup() function.
pinMode(13, OUTPUT);      // Set digital port 13 as outputpinMode(4, INPUT);        // Set digital port 4 as input
digitalWrite() function, is used to specify whether a digital port outputs a high or low level. Before using, you need to set the digital port to output.
digitalWrite(13, HIGH);    // Digital port 13 outputs high leveldigitalWrite(13, LOW);     // Digital port 13 outputs low level
digtalRead() function, is used to read whether a digital port is at a high or low level. Before using, you need to set the port to input.
if(digitalRead(4)==HIGH)   // If digital port 4 is high level{……}
  • Functions for operating time in Arduino

delay(n) function, is used to delay n milliseconds.

delay(1000); // Delay 1 second
delayMicroseconds(n) function, is used to delay n microseconds. The value of n should not be too small, as it may cause significant errors.
delayMicroseconds(100); // Delay 100 microseconds
With the above functions, we can try to write a program that makes the LED connected to digital 13 port blink. The program logic is very simple: first set the digital port as output (execute only once, written in setup() function), then output high level (light up the LED), delay for a while (keep the LED lit for some time, otherwise the time is too short to see), then output low level (turn off the LED), delay for a while (keep the LED off for some time), and then output high level, delay… loop back and forth (written in loop() function).
void setup(){pinMode(13, OUTPUT);        // Set digital port 13 as output}void loop(){  digitalWrite(13, HIGH);    // Set digital port 13 to high level  delay(500);                // Delay 0.5 seconds  digitalWrite(13, LOW);     // Set digital port 13 to low level  delay(500);                // Delay 0.5 seconds}
After editing the program in Arduino IDE, you can upload the program and verify its functionality. I recorded a demonstration video of the specific operation, and I apologize for my poor performanceUnderstanding Arduino and Its Basic Development Process.

Limitations of Arduino

After saying so much, you may have a preliminary understanding of Arduino. As time goes by and the subsequent tutorials deepen, more and more techniques and libraries will be used, and the characteristics of Arduino being easy to get started will be fully demonstrated. However, this does not mean that Arduino has no drawbacks. For beginners with no experience, Arduino is a magical tool because Arduino is a platform, not a specific microcontroller, and the learning cost and difficulty are very low. However, from a practical application perspective, Arduino is more suitable for DIY, idea validation, rapid prototyping of products, etc., and is clearly not suitable for actual product production because of its low operational efficiency, lack of debugging support, and inexplicable conflicts and errors that may occur when using certain hardware resources (timers, interrupts, etc.). Therefore, Arduino ignites your passion, but having interest alone is not enough; more importantly, you need to put in effort and study the underlying principles of circuits and algorithms.

That’s all.

Leave a Comment

Your email address will not be published. Required fields are marked *