Getting Started with Arduino UNO Development Board

The Arduino UNO R3 is a development board that is very suitable for beginners in microcontrollers. It uses the AVR microcontroller ATmega328P as the main controller, and the integrated development environment is Arduino IDE, which can help beginners quickly master microcontroller technology.

Getting Started with Arduino UNO Development Board

Arduino UNO R3 Development Board

Specifications:

  • Operating Voltage: 5V

  • Input Voltage: No external power supply is needed when connected via USB or external 7V~12V DC input

  • Microprocessor: ATmega328P, write/erase lifetime of 10,000 times, priced around 7 yuan

  • Clock Frequency: 16 MHz

  • 14 digital IO ports, maximum current of 40mA, do not exceed this current during experiments

  • 6 analog inputs A0 to A5: 10-bit resolution, default input signal from 0 to 5V

  • AREF: Reference voltage for analog input signals

  • Flash Memory: 32 KB (0.5 KB is used for the bootloader in ATmega328P)

  • LED: Reserved interface for testing LED (pin 13), lights up when output is high

  • Official Website: http://www.arduino.cc

Getting Acquainted with Arduino UNO R3

The layout of the onboard resources of the Arduino UNO R3 is as follows; we will start with the main components.

Getting Started with Arduino UNO Development Board

Arduino UNO R3 Onboard Resource Layout

Power Supply

This Arduino board supports three power supply methods:

  • USB Power Supply

  • DC Jack Power Supply (7-12V)

  • Power Supply through DC Input (7-12V)

It is recommended that beginners use USB power supply, which can be connected to the computer’s USB port or a power bank using a USB cable.

If using an external DC jack power supply, be sure to check the positive and negative terminals of the power supply (inner positive and outer negative), with the input voltage range between 7V to 12V; ideally, the closer to 7V, the better.

Analog Ports (A0-A5)

Many quantities in nature are analog, and the signals from various sensors are mostly output in the form of analog voltage. For example, the temperature sensor LM35D outputs an analog voltage proportional to the environmental temperature, but digital systems can only process digital quantities. Therefore, real-world analog quantities must be converted into digital quantities through an analog-to-digital converter before they can be processed by digital systems.

You can read analog quantities, such as analog voltage values, through the analog ports on the Arduino UNO board. The microcontroller will automatically convert the analog voltage value into the corresponding 10-bit digital quantity, for example:

void setup() { // Initialization function, executed only once

Serial.begin(9600); // Set serial port baud rate

}

void loop() { // Main loop

int n = analogRead(A0); // Read the analog value from A0 and store it in the integer variable n

Serial.println(n); // Display in the serial monitor

delay(100); // Delay 100ms

}

Digital Ports (0-13)

Digital ports must be explicitly defined as input or output ports in the setup() function before use. Ports 0 and 1 should be avoided during the initial learning phase due to their serial debugging function, for example:

void setup() {

pinMode(13, OUTPUT); // Set pin 13 as output

}

void loop() {

digitalWrite(13, HIGH); // Set pin 13 to high

delay(1000); // Delay 1 second

digitalWrite(13, LOW); // Set pin 13 to low

delay(1000);

}

Among the digital ports, ports 3, 5, 6, and 9-11 support pulse-width modulation (PWM) output. PWM waves (equivalent to digitalized analog values) can be output to the pins, which can be used to adjust the brightness of LEDs or the speed of motors. After calling analogWrite(pin, value), the pin (pin is the pin number) will generate a rectangular wave output with a frequency of 490Hz and a specified duty cycle (value ranges from 0-255).

int brightness = 0; // Represents the brightness of the LED

int fadeAmount = 5; // LED brightness change increment

void setup() {

pinMode(3, OUTPUT); // Set pin 3 as output

}

void loop() {

analogWrite(3, brightness); // Write brightness value to the port

brightness += fadeAmount; // Change brightness in the next loop

if (brightness <= 0 || brightness >= 255)

fadeAmount = -fadeAmount ; // Reverse at the highest or lowest brightness

delay(30); // Delay 30 milliseconds

}

Installing the Integrated Development Environment

Download

Download the integrated development environment ARDUINO 1.8.5 from the official website

https://www.arduino.cc/en/Main/Software

Getting Started with Arduino UNO Development Board

Please choose the corresponding installation program based on your computer’s operating system from the right.

Regarding donations, if you are temporarily not wealthy or do not have a US dollar account, you can directly click the gray JUST DOWNLOAD to enter the download page.

Getting Started with Arduino UNO Development Board

https://downloads.arduino.cc/arduino-1.8.5-windows.exe

Installation

Double-click arduino-1.8.5-windows.exe, the installation guide will appear, and confirm in sequence, default installation is fine. After installation, the Arduino software logo will appear on the desktop, double-click to use it next time.

Configuring the Development Environment

Insert the Arduino UNO R3 development board, and the system will automatically install the USB driver.

Select the corresponding board

Getting Started with Arduino UNO Development Board

Select the port

You can check the corresponding port situation of the device through the device manager; this machine corresponds to COM5.

Getting Started with Arduino UNO Development Board

Verification

Open the file, example, find the Blink program

Getting Started with Arduino UNO Development Board

Click the checkmark to start compilation; if everything is normal; click the right arrow to upload the compiled program to the Arduino UNO R3’s AVR microcontroller; you can also directly click that arrow, and the IDE will first compile before uploading directly.

Getting Started with Arduino UNO Development Board

If you see the LED light on the development board flashing, everything is normal.

Next, you can purchase a breadboard, jumper wires, and various components for various interesting experiments as needed.

Getting Started with Arduino UNO Development Board

About the Serial Monitor

The serial monitor in “Tools->Serial Monitor” is a great tool that you must learn to use! Unless you can guarantee that the program is absolutely correct.

Note: The baud rate setting of the serial monitor must match that in the program.

Please be sure to practice using the serial monitor. Set the baud rate of the serial port in the setup() function, for example:

Serial.begin(9600); // Set serial port baud rate

Then in the loop() cycle, for any variable you want to monitor, you can use the following statement to output the current value of that variable in the computer’s serial monitor:

Serial.println(n); // Display the value of variable n in the serial monitor

The serial monitor is a powerful tool to assist you in debugging programs, and you must master it.

Getting Started with Arduino UNO Development Board

Thought Questions:

1. Familiarize yourself with the Arduino UNO board, install the development environment, and run the first example Blink

2. Familiarize yourself with the use of the analog port (A port); familiarize yourself with the serial monitor

3. Familiarize yourself with the use of the digital port (D port); it must be clearly defined as input or output port before use

4. Familiarize yourself with pulse-width modulation (PWM) technology to achieve a breathing light

5. Implement automatic control of street lights, dimmable table lamps

6. Implement a digital thermometer

7. Implement an intelligent temperature control fan

8. Implement ultrasonic distance measuring

9. Implement human infrared detection

10. Implement a touch electronic piano

11. Understand the bus and implement environmental temperature and humidity detection DHT11

12. Understand the IIC bus and implement OLED screen control

13. Understand the serial port and implement soft serial, PM2.5 detection

14. Implement a PM2.5 detector

Leave a Comment

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