0% found this document useful (0 votes)
325 views5 pages

Introduction to Arduino Uno Guide

The Arduino Uno is a microcontroller board based on the ATmega328P microchip. It consists of both a physical programmable circuit board and Arduino IDE software. The board has 14 digital input/output pins that can be programmed to receive or output data. It also has pins for serial communication, external interrupts, PWM, an onboard LED, and power/reset functions. The Arduino is programmed using the Arduino IDE and can communicate with a computer or other devices via serial, I2C, and SPI protocols. Programs for the Arduino consist of setup and loop functions to initialize hardware and provide ongoing operation.

Uploaded by

Siva Virat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
325 views5 pages

Introduction to Arduino Uno Guide

The Arduino Uno is a microcontroller board based on the ATmega328P microchip. It consists of both a physical programmable circuit board and Arduino IDE software. The board has 14 digital input/output pins that can be programmed to receive or output data. It also has pins for serial communication, external interrupts, PWM, an onboard LED, and power/reset functions. The Arduino is programmed using the Arduino IDE and can communicate with a computer or other devices via serial, I2C, and SPI protocols. Programs for the Arduino consist of setup and loop functions to initialize hardware and provide ongoing operation.

Uploaded by

Siva Virat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

ARDUINO UNO

Introduction

Arduino is an open-source microcontroller board that is based on


the microchip ATMEGA328P used for building electronic [Link] consists
of both a physical programmable circuit board (often referred to as a microcontroller)
and a piece of software, or IDE (Integrated Development Environment) that runs on
your computer, used to write and upload computer code to the physical board. The
Arduino platform has become quite popular with people just starting out with
electronics, and for good reason. Unlike most previous programmable circuit boards,
the Arduino does not need a separate piece of hardware (called a programmer) in
order to load new code onto the board – you can simply use a USB cable.
Additionally, the Arduino IDE uses a simplified version of C++, making it easier to
learn to program. Finally, Arduino provides a standard form factor that breaks out the
functions of the micro-controller into a more accessible package.

What’s on Board?
Arduino uno is a microcontroller board based on 8-bit ATmega328P microcontroller.
Along with that ,it consists other components such as crystal oscillator ,serial
communication ,voltage regulator ,etc ,to support the microcontroller.

How to use Arduino Board?

The 14 digital input/output pins can be used as input or output pins by using
pinMode(),digital Read() and digitalWrite() functions in arduino [Link]
pin operate at 5v and can provide or receive a maximum of 40mA current, and has an
internal pull-up resistor of 20-50k ohms which are disconnected by default .Out of
these 14 pins,some have specific functions as listed below:

Serial Pins 0(RX) and 1(TX): Rx and Tx pins are used to receive and
transmit TTL serial [Link] are connected with the corresponding ATmega328P
USB to TTL serial chip.

External Interrupt Pins 2 and 3: These pins can be configured to trigger an


interrupt on a low value, a rising or falling edge ,or a change in value.

PWM Pins 10(SS),11(MOSI),12(MISO) and 13(SCK): These pins are used


for SPI communication.

In-built LED Pin 13: This pin is connected with an built-in LED, when pin
13 is HIGH - LED is on, and when pin 13 is LOW ,its off.

AREF: Used to provide reference voltage for analog inputs with


analogReference() function.
Reset Pin: Making this pin LOW,resets the microcontroller.

Crystal oscillator:Crystal oscillator soldered on arduino development board


provide a clock signal to microcontroller ATmega328 .This provides a square wave
signal,which determine the time required for each T [Link] in general arduino board
has 16Mhz frequency crystal hence takes 1/16 micro sec to run 1T state.

Voltage Regulator:The voltage regulator is not actually something you can (or
should) interact with on the Arduino. But it is potentially useful to know that it is
there and what it’s for. The voltage regulator does exactly what it says – it controls
the amount of voltage that is let into the Arduino board. Think of it as a kind of
gatekeeper; it will turn away an extra voltage that might harm the circuit. Of course, it
has its limits, so don’t hook up your Arduino to anything greater than 20 volts.

Communication

Arduino can be used to communicate with a computer,another Arduino board or


other microcontrollers. The ATmega328P microcontroller provides UART TTL (5V)
serial communication which can be done using digital pin 0 (RX) and digital pin 1
(TX). An ATmega32816U2 on the board channels this serial communication over
USB and appears as a virtual com port to software on the [Link]
ATmega16U2 firm uses the standard USB COM drivers ,and no external driver is
needed. However, on Arduino software includes a serial monitor which allows simple
textual data to be sent to and from the Arduino [Link] are two RX and TX
LEDs on the arduino board which will flash when data is being transmitted via the
USB-to-serial chip and USB connection to the computer. A SoftwareSerial library
allows for serial communication on any of the UNO’s digital [Link] ATmega328P
also supports I2C (TWI) and SPI [Link] Arduino software includes a
Wire library to simplify use of the I2C bus.

Arduino Software

Why Arduino Software?

Arduino IDE (Integrated Development Environment) is required to


program the Arduino Uno [Link] open source Arduino Software (IDE) makes it
easy to write code and upload it to the [Link] runs on Windows, Mac OS X, and
Linux. The environment is written in Java and based on processing and other open-
source software.

Arduino Programming

Programming is the process of writing a series of instructions that


eventually get turned into an executable format for the Arduino [Link]
Arduino is programmed in the processing language,but is more similar to C/C++ .
The language is procedural,which is similar to following a series of mathematical
[Link] function takes some data ,manipulates it, and returns something. An
example could be that a functoin called “Move(x)” would move the robot for the
given time “X” forward.

The language can be split into three major topics:


1. Variables(numbers that change over time in your application),
2. Loops (Repetitions that are needed for calculations or events), and
3. Functions(Blocks of code that can be repeated multiple times with varying inputs
and outputs).

Body of An Arduino Program

When using the Arduino , there are two functions that are absolutely needed, a
“void setup ()”, and a “void loop ()”. Setup is called only once at the beginning of the
program, and is used initialize variables and hardware needed for the main routine,
“loop”. Loop runs continuously until the power is cut, and is where you want to place
your logic.

A very simple program that gives an example of this by setting up the Arduino
and making the LED blink is shown below:

//the setup function runs once when you press reset or power the board
void setup() {
//initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUITIN, OUTPUT);
}

// the loop function runs over and over again forever


void loop() {
digitalWrite(LED_BUITIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUITIN, LOW); //turn the LED off by making the voltage LOW
delay(1000); //wait for a second
}

A sample program of arduino is shown in figure


Instructions Used in Programming

DigitalRead and DigitalWrite:DigitalRead and DigitalWrite are two


functions used in writing and reading values to pins on the Arduino. These two
functions find use in interaction with your hardware.

Looking at the above example program,the programmer uses DigitalWrite to


write a value of “HIGH” to the pin, sending voltage to it, and in turn lighting up the
LED. Then ,after “sleeping”,or pausing, one second, he sends a value of “LOW” to
the pin, sending little or no voltage to it, and turning off the LED.

Common questions

Powered by AI

The Arduino IDE acts as both a code editor and an uploader, allowing users to write code in a simplified version of C++ and directly upload it to the Arduino Uno board via a USB cable, a process facilitated by its built-in support for serial communication . Unlike traditional programming environments that might require separate hardware for loading code, the Arduino IDE streamlines this by integrating the programming and uploading process in a single platform, which is particularly beneficial for beginners and facilitates quick prototyping and testing .

The "setup" function in an Arduino program is responsible for initializing variables and hardware and is called only once at the beginning when the program starts or when the board is reset . Its main purpose is to set up the initial state of variables and configurations. On the other hand, the "loop" function continuously executes the core logic of the program until the power is cut off. It is structured to handle the repetitive and dynamic tasks the board needs to perform .

The Arduino IDE is advantageous for beginners because it simplifies the process of writing and uploading code to the microcontroller, eliminating the need for additional hardware such as a programmer . The IDE uses a simplified version of C++, making it more accessible to those unfamiliar with programming and supports various operating systems including Windows, Mac OS X, and Linux . Furthermore, it includes libraries like Wire and SoftwareSerial that simplify complex tasks such as I2C and additional serial communication .

In an Arduino Uno, the digitalRead() function is used to read the value from a specified digital pin, receiving either HIGH or LOW depending on the input state . Conversely, the digitalWrite() function is used to write a HIGH or LOW value to a digital pin, thus controlling devices like LEDs and other outputs. These functions play critical roles in interacting with peripheral hardware by allowing the microcontroller to read input from sensors and control output devices .

A simple Arduino program is structured with a "setup" function to initialize setups needed for the tasks. In the example of blinking an LED, the "setup" function sets the LED_BUILTIN pin mode to OUTPUT . The "loop" function contains the logic to blink the LED by using digitalWrite() to set the pin HIGH, turning the LED on, then LOW, turning it off, with delay() creating a one-second pause between actions to create the blinking effect . This structure allows for both initial setups and continuous task execution.

Arduino Uno offers significant educational benefits by providing an accessible and low-barrier entry point into understanding microcontroller operations and programming. Its use of a simplified version of C++, combined with a user-friendly IDE, helps beginners grasp programming concepts without the steep learning curve usually associated with microcontroller development . Additionally, the integration of hardware and software tasks in real-time projects, such as interactive electronics, allows learners to see immediate, tangible results of their programming, thus reinforcing theoretical knowledge with practical experience .

The Arduino Uno handles serial communication primarily through its ATmega328P microcontroller, which provides UART TTL (5V) serial communication that can be accessed via digital pins 0 (RX) and 1 (TX). Additionally, it uses the ATmega16U2 to channel this communication over a USB connection, presenting itself as a virtual COM port to computer software. The board supports communication protocols like I2C (TWI) and SPI and includes a SoftwareSerial library for enabling serial communication on any digital pin .

The primary components on an Arduino Uno board that support the ATmega328P microcontroller include a crystal oscillator, for providing the clock signal necessary for operation; a voltage regulator, which controls the amount of voltage entering the board to protect the circuit; serial communication components for transmitting and receiving data; and various pins for digital I/O, PWM, and external interrupts .

The crystal oscillator on the Arduino Uno board provides the essential clock signal for the ATmega328P microcontroller by generating a square wave signal. This clock signal determines the time duration for computational cycles, with a standard Arduino board using a 16 MHz crystal oscillator, which allows it to execute a T state in 1/16 of a microsecond . This timing is critical for precise control and synchronization of operations within the microcontroller .

The voltage regulator on the Arduino Uno board ensures that the microcontroller and other components receive the proper amount of voltage, acting as a gatekeeper to prevent excess voltage that might damage the board . However, its limitation is that it cannot handle voltages greater than 20 volts. Exceeding this threshold would risk damaging the Arduino board despite the regulation .

You might also like