Differences Between Arduino and Microcontrollers: A Beginner’s Guide to Arduino

Follow+Star Public Account Number, don’t miss wonderful content

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

Editing | strongerHuang

WeChat Public Account | Embedded Column

Readers who work with microcontrollers should have heard of Arduino or used it, but many still do not understand what Arduino is. Today, I will briefly describe the content related to Arduino for beginners.

Embedded Column

1

Getting to Know Arduino
To understand Arduino, you first need to understand what a microcontroller is. The foundation of the Arduino platform is actually the AVR instruction set microcontroller.

1. What is a microcontroller?

A working computer consists of the following 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 (I/O such as serial ports, parallel output ports, etc.). In a personal computer (PC), 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/Digital conversion (A/D) and Digital/Analog conversion (D/A).

2. What is the use of a microcontroller?

As the saying goes, why use a sledgehammer to crack a nut? Not every situation requires high performance. Imagine a voice-controlled light using an Intel i7 processor; its cost-effectiveness would be astronomical. The key to application is whether it is sufficient and whether it has a good performance-to-price ratio, so microcontrollers fill this gap well.

So, what is Arduino?

Arduino is a convenient, flexible, and easy-to-use 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 features include simple shapes, the ability to interact with people, and even ten-year-olds can use it to create what they want. Arduino can sense the environment through various sensors and can control lights, motors, and other devices to respond to and affect the environment. The microcontroller on the board can be programmed using the Arduino programming language, compiled into binary files, and uploaded to the microcontroller. Projects based on Arduino can include only Arduino or can include Arduino and other software running on a PC, which communicate with each other (e.g., Flash, Processing, MaxMSP) to achieve functionality.

Embedded Column

2

Types of Arduino
There are too many Arduino boards available on the market. Excluding the original factory’s dozen or so models, there are thousands of various Arduino boards on online shopping platforms, which can be overwhelming for beginners.Choosing a suitable Arduino for a project is half the success; let’s take a look at the most common Arduino boards and how to differentiate them.
Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino
Arduino Mega

To distinguish between so many boards and choose the right Arduino, mainly look at the following three aspects: performance, features, and size.

First, look at performance. This includes processor memory, clock frequency, and bit width. The hardware processing capability usually depends entirely on the chip of the board, which also limits the software that can run.

Next, look at features. This includes everything on the board besides the microprocessor, such as input/output pins, integrated components (buttons, LEDs, motor drivers, etc.), and the types and numbers of available interfaces (USB, Ethernet, etc.).

Finally, look at size. Due to different project requirements, the volume and weight allocated for electronic components can vary greatly. For example, to make a tracker for a dog, if you use a Mega board and a battery box with an expansion board, it would need to be at least 10*5*5cm in size and weigh 200g. Is this a tracker or a sandbag? This is why Arduino has so many siblings.

Having said so much, let’s take a look at some mainstream Arduino boards.

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

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

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

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

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

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

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

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

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

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

Of course, there are many more; I won’t list them all here. If you’re interested, you can learn more yourself.

Embedded Column

3

Installing Arduino Compilation Environment
Download link:
https://www.arduino.cc/en/Main/Software

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

All three major operating systems Windows, Mac, and Linux are supported, so you can choose to download according to your situation.
The installation process won’t be detailed here; generally, you can just keep clicking “Next.” If you can’t install it, I think you’re not a qualified developer.

Embedded Column

4

Understanding Arduino IDE
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, wait for another second, and repeat.

Now, let’s assume we are using the Arduino UNO control board (it is recommended for beginners due to its stability) and that we have already set up the Arduino development environment and installed the USB driver as per the above steps.

1. Connect the Arduino control board to the computer

Plug one end of the USB cable into the Arduino control board and the other end into the USB port of the computer. (Note: When working independently, the Arduino control board can be powered either from USB or from a power bank or power adapter.)

Connecting the Arduino control board to the computer

Open the Arduino IDE, and the editing interface of the Arduino IDE will appear.

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

2. Understanding Arduino IDE

Let’s briefly get to know this Arduino compiler, as we will often interact with it in the future.

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

Arduino IDE is the software editing environment for Arduino products. Simply put, it is where you write and download code.

Any Arduino product needs to download code to operate.

The hardware circuit we build is auxiliary to the code, and both are indispensable. It’s like a person controlling their limbs through their brain. If the code is the brain, the peripheral hardware is the limbs; the activity of the limbs depends on the brain, so hardware implementation depends on the code.

The basic functional areas of the Arduino IDE have been marked in the image above (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 need to 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

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

Download the simplest code, which can help us familiarize ourselves with how to download programs and also test whether the board is functioning properly.

The LED marked L on the UNO board is the one we will test. This test code will make this LED blink.

4. Open Blink

Plug in the USB cable, open the Arduino IDE, and find the “Blink” code.

File > Examples > 01.Basics > Blink

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

5. Verify the program

Usually, after writing a piece of code, we need to verify it to check if there are any errors. Click “Verify.”

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

After verification (compilation) is complete, you can see the corresponding prompt.

Since this is sample code, there will be no errors during verification, but 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 the Arduino IDE which board we are using and which corresponding serial port.

6. Set the 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 according to the firmware type of the hardware you choose. (In this example, the controller with the Uno bootloader is selected.) Tools > Board > Arduino Uno

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

7. Set the serial port

Tools > Serial Port > xx, where xx must match what you see in your computer’s device manager.

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

8. Download the program

As shown, finally, click “Upload.” (Here, upload and download are actually the same thing.)

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

Upload complete!

If everything goes well, we will be able to visually see the program running on the board:

The LED on pin 13 of the Arduino Uno board is blinking.

Well, that’s the most basic operation of the IDE.

Disclaimer:This article’s material comes from the internet, and the copyright belongs to the original author. If there are any copyright issues, please contact me for deletion.

———— END ————

Reply with 『Microcontroller』『MCU』 to read more related articles.

Follow WeChat public account『Embedded Column』, check the bottom menu for more content, reply “Join Group” to join the technical exchange group according to the rules.

Differences Between Arduino and Microcontrollers: A Beginner's Guide to Arduino

Click “Read the Original” to see more shares, welcome to share, collect, like, and check it out.

Leave a Comment