Вы находитесь на странице: 1из 8

Arduino

Arduino Uno is a microcontroller board based on 8-bit ATmega328P microcontroller.


Along with ATmega328P, it consists of other components such as crystal oscillator, serial
communication, voltage regulator, etc. to support the microcontroller. Arduino Uno has 14
digital input/output pins (out of which 6 can be used as PWM outputs), 6 analog input pins, a
USB connection, A Power barrel jack, an ICSP header and a reset button.
The 14 digital input/output pins can be used as input or output pins by using pinMode()
and digitalRead() and digitalWrite() functions in the arduino to the programming. Each pin
operate at 5V and can provide or receive a maximum of 40mA current, and has an internal pull-
up resistor of 20-50 KOhms which are disconnected by default. Out of these 14 pins, some pins
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 data. They 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 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using
analogWrite() function.
 SPI 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, it’s off.
Along with 14 Digital pins, there are 6 analog input pins, each of which provides 10 bits
of resolution, i.e. 1024 different values. They measure from 0 to 5 volts but this limit can be
increased by using AREF pin with analog Reference () function.  
Analog pin 4 (SDA) and pin 5 (SCA) also used for TWI communication using Wire
library.
Fig.3.10: Arduino Board

Table No.3.2: Pin Description of Arduino

Pin Category Pin Name Details


Vin: Input voltage to Arduino when using
an external power source.
5V: Regulated power supply used to power
microcontroller and other components on
Vin,3.3V,
Power the board.
5V, GND
3.3V: 3.3V supply generated by on-board
voltage regulator. Maximum current draw is
50mA.
GND: ground pins.
Reset Reset Resets the microcontroller.
Used to provide analog input in the range of
Analog Pins A0 – A5
0-5V

Input/output Digital Pins


Can be used as input or output pins.
Pins 0 - 13

Used to receive and transmit TTL serial


Serial 0(Rx),1(Tx)
data.
External
2, 3 To trigger an interrupt.
Interrupts

PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.


10(SS),
11(MOSI),
SPI 12 (MISO) Used for SPI communication.
and
13 (SCK)
Inbuilt LED 13 To turn on the inbuilt LED.

A4 (SDA),
TWI Used for TWI communication.
A5 (SCA)

To provide reference voltage for input


AREF AREF
voltage.

Arduino Uno has a couple of other pins as explained below:


 AREF: Used to provide reference voltage for analog inputs with analog Reference ()
function.
 Reset Pin: Making this pin LOW, resets the microcontroller.
Table No.3.3: Arduino Uno Technical Specifications

Microcontroller ATmega328p – 8 bit AVR family microcontroller


Operating Voltage 5V
Recommended Input
7-12V
Voltage
Input Voltage Limits 6-20V
Analog Input Pins 6 (A0 – A5)
Digital I/O Pins 14 (Out of which 6 provide PWM output)
DC Current on I/O Pins 40 mA
DC Current on 3.3V Pin 50 mA
Flash Memory 32 KB (0.5 KB is used for Boot loader)
SRAM 2 KB
EEPROM 1 KB
Frequency (Clock Speed) 16 MHz

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
ATmega16U2 on the board channels this serial communication over USB and appears as a
virtual com port to software on the computer. The ATmega16U2 firmware uses the standard
USB COM drivers, and no external driver is needed. However, on Windows, a .info file is
required. The arduino software includes a serial monitor which allows simple textual data to be
sent to and from the arduino board. There 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 (not for serial communication on pins 0 and 1). A Software Serial library allows for
serial communication on any of the Uno's digital pins. The ATmega328P also supports I2C
(TWI) and SPI communication. The Arduino software includes a Wire library to simplify use of
the I2C bus.
3.3.2 Atmega328
The Atmega328 is a very popular microcontroller chip produced by Atmel. It is an 8-bit
microcontroller that has 32K of flash memory, 1K of EEPROM, and 2K of internal SRAM.
The Atmega328 is one of the microcontroller chips that are used with the popular
Arduino Duemilanove boards. The Arduino Duemilanove board comes with either 1 of 2
microcontroller chips, the Atmega168 or the Atmega328. Of these 2, the Atmega328 is the
upgraded, more advanced chip. Unlike the Atmega168 which has 16K of flash program memory
and 512 bytes of internal SRAM, the Atmega328 has 32K of flash program memory and 2K of
Internal SRAM.
Fig.3.11: Pin Diagram

 Specifications
The Atmega328 has 28 pins. It has 14 digital I/O pins, of which 6 can be used as PWM
outputs and 6 analog input pins. These I/O pins account for 20 of the pins.
Table No.3.4: Key Parameters of Atmega328

Parameter Value

CPU type 8-bit AVR

Performance 20 MIPS at 20 MHz

Flash memory 32 kB

SRAM 2 kB

EEPROM 1 kB

28 or 32 pin: PDIP-28, MLF-28, TQFP-32
Pin count
MLF-32
Maximum operating frequency 20 MHz

Number of touch channels 16

Hardware Touch Acquisition No

Maximum I/O pins 23

External interrupts 2

USB Interface No

USB Speed –

The ATmega328 is a single-chip microcontroller created that is by Atmel in


the megaAVR family (later Microchip Technology acquired Atmel in 2016). It has a modified
Harvard architecture 8-bit RISC processor core.

The Atmel 8-bit AVR RISC-based microcontroller is used to combines


32 kB ISP flash memory with the read-while-write capabilities, and1 kB EEPROM,
2 kB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible
timer/counters with compare modes, internal and external interrupts, serial
programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel and 10-
bit A/D converter (8-channels in  TQFP and QFN/MLF packages), programmable watchdog
timer with internal oscillator, and five software selectable power saving modes. The device
operates between 1.8-5.5 volts. The device achieves throughput approaching 1 MIPS per MHz
As of 2013 the ATmega328 is commonly used in many projects and autonomous systems
where a simple, low-powered, low-cost micro-controller is needed Perhaps the most common
implementation of this chip is on the popular Arduino development platform, namely to
the Arduino Uno and Arduino Nano model.
As stated before, 20 of the pins function as I/O ports. This means they can function as an
input to the circuit or as output. Whether they are input or output is set in the software. 14 of the
pins are digital pins, of which 6 can function to give PWM output. 6 of the pins are for analog
input/output.2 of the pins are for the crystal oscillator. This is to provide a clock pulse for the
Atmega chip. A clock pulse is needed for synchronization so that communication can occur in
synchrony between the Atmega chip and a device.
The chip needs power so 2 of the pins, VCC and GND, provide it power so that it can
operate. The Atmega328 is a low-power chip, so it only needs between 1.8-5.5V of power to
operate.
The Atmega328 chip has an analog-to-digital converter (ADC) inside of it. This must be
or else the Atmega328 wouldn't be capable of interpreting analog signals. Because there is an
ADC, the chip can interpret analog input, which is why the chip has 6 pins for analog input. The
ADC has 3 pins set aside for it to function- AVCC, AREF, and GND. AVCC is the power supply,
positive voltage, that for the ADC. The ADC needs its own power supply in order to work. GND
is the power supply ground. AREF is the reference voltage that the ADC uses to convert an
analog signal to its corresponding digital value. Analog voltages higher than the reference
voltage will be assigned to a digital value of 1, while analog voltages below the reference voltage
will be assigned the digital value of 0.

Table No.3.5: Pin Description of Atmega328

Pin Number Description Function

1 PC6 Reset
2 PD0 Digital Pin (RX)
3 PD1 Digital Pin (TX)
4 PD2 Digital Pin
5 PD3 Digital Pin (PWM)
6 PD4 Digital Pin
7 VCC Positive Voltage (Power)
8 GND Ground
9 XTAL 1 Crystal Oscillator
10 XTAL 2 Crystal Oscillator
11 PD5 Digital Pin (PWM)
12 PD6 Digital Pin (PWM)
13 PD7 Digital Pin
14 PB0 Digital Pin
15 PB1 Digital Pin (PWM)
16 PB2 Digital Pin (PWM)
17 PB3 Digital Pin (PWM)
18 PB4 Digital Pin
19 PB5 Digital Pin
20 AVCC Positive voltage for ADC (power)
21 AREF Reference Voltage
22 GND Ground
23 PC0 Analog Input
24 PC1 Analog Input
25 PC2 Analog Input
26 PC3 Analog Input
27 PC4 Analog Input
28 PC5 Analog Input

Since the ADC for the Atmega328 is a 10-bit ADC, meaning it produces a 10-bit digital value, it converts
an analog signal to its digital value, with the AREF value being a reference for which digital values are
high or low. Thus, a portrait of an analog signal is shown by this digital value; thus, it is its digital
correspondent value. The last pin is the RESET pin. This allows a program to be rerun and start over. And
this sums up the pin out of an Atmega328 chip. 

Вам также может понравиться