0% found this document useful (0 votes)
16 views50 pages

Arduino Uno

Arduino is an open-source electronic prototyping platform based on microcontroller technology, allowing users to create interactive projects easily. It features a user-friendly IDE for programming, a variety of hardware components, and extensive community support for learning and troubleshooting. Applications range from home automation and robotics to education and IoT, making Arduino a versatile tool for both beginners and experienced developers.

Uploaded by

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

Arduino Uno

Arduino is an open-source electronic prototyping platform based on microcontroller technology, allowing users to create interactive projects easily. It features a user-friendly IDE for programming, a variety of hardware components, and extensive community support for learning and troubleshooting. Applications range from home automation and robotics to education and IoT, making Arduino a versatile tool for both beginners and experienced developers.

Uploaded by

unknown.56fake
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Arduino

What is Arduino ?

• Arduino is a microcontroller-based open-source electronic prototyping board


that can be programmed with an easy-to-use Arduino IDE.
• A microcontroller is a compact integrated circuit (IC) designed to control
specific tasks in electronic devices.
• It is like a small computer, but it is designed for a specific purpose rather than
general-purpose tasks like a PC.
• Arduino boards use microcontrollers as the core component to execute programs
and control hardware.
Key Components of a Microcontroller
1. Processor (CPU):
1. The "brain" of the microcontroller.
2. Executes instructions, performs calculations, and controls other components.
3. Example: ATmega328P on the Arduino Uno.
2. Memory:
1. Flash Memory: Stores the program (your Arduino code).
2. SRAM (Static RAM): Temporary memory for variables used during program execution.
3. EEPROM: Permanent memory for storing small amounts of data even when power is off.
3. Input/Output (I/O) Pins:
1. Used to interact with external devices like LEDs, sensors, motors, or buttons.
2. Pins can be configured as inputs (to read data) or outputs (to send signals).
4. Timers and Counters:
1. Hardware modules for precise timing operations (e.g., delays, PWM).
5. Peripherals:
1. ADC (Analog-to-Digital Converter): Converts analog signals to digital values.
2. Communication Interfaces: For communication with other devices (UART, I2C, SPI, etc.).
What is Open-Source?
• Open-source means that the design (both hardware and software) is freely
available for anyone to use, modify, or distribute.
• Schematics, PCB designs, and hardware details are openly shared.
• You can even build your own Arduino-compatible board using the available
designs.
• The Arduino IDE and its libraries are open-source.
• Developers worldwide contribute to libraries and tools to extend Arduino's
capabilities.
• Benefits of Open-Source in Arduino:
1. Low cost and wide availability.
2. You can modify designs for specific needs.
3. Huge global community provides libraries, tutorials, and troubleshooting help.
Electronic Prototyping Board
What is a Prototyping Board?
• A prototyping board allows you to quickly and easily test electronic circuits
and ideas without building a permanent system.
• Programming involves writing code (instructions) that the microcontroller
executes to perform specific tasks.
• How Arduino is Programmed:
1. Write your code using a simplified C++based language.
2. The Arduino IDE converts your code into a format that the microcontroller understands
(hexadecimal machine code).
3. Code is transferred to the microcontroller’s flash memory.
What is Arduino IDE?
• The Arduino Integrated Development Environment (IDE) is software for writing, editing,
and uploading programs to an Arduino board.

Key Features:
• Code Editor:
• Write and edit code in a simple interface.
• Syntax highlighting makes reading and debugging easier.
• Pre-Configured Libraries:
• Ready-to-use libraries for sensors, displays, motors, etc.
• Example: Servo.h library to control servo motors.
• Compiler:
• Converts high-level Arduino code into machine code for the microcontroller.
• Uploader:
• Sends the compiled code to the Arduino board via USB.
Key Features of Arduino
1. Hardware
• Plug-and-Play:
• No need to wire microcontroller components manually.
• Versatile Pins:
• Digital pins for on/off signals.
• Analog pins for reading varying voltages.
• PWM pins for generating analog-like signals.
• Power Options:
• Power via USB or external battery.
2. Software
• Arduino Language:
• Simplified C++ for easy programming.
• Large Library Collection:
• Prebuilt libraries for sensors, motors, displays, and more.
• Platform Independence:
• Works on Windows, macOS, and Linux.
3. Shields and Add-Ons
• Shields:
• Plug-in boards to expand functionality (ready-made hardware expansions).
• Examples: Ethernet shield, motor driver shield.
• Sensors and Actuators:
• Easily connect sensors (temperature, light, motion) and actuators (motors, buzzers, relays).
4. Community Support
• Global Community:
• Tutorials, forums, and resources are widely available.
• Learning Resources:
• Books, online courses, and videos cater to all skill levels.
Applications of Arduino
Arduino can be used in countless projects and industries:
1. Home Automation:
Control lights, fans, and appliances using sensors or voice commands.
2. Robotics:
Build robotic arms, drones, or automated vehicles.
3. Education:
Teach coding, electronics, and embedded systems in schools and universities.
4. IoT (Internet of Things):
Connect devices to the internet for remote control and monitoring.
5. Prototyping:
Test ideas before creating final commercial products.
Arduino Uno boards
• DIP refers to the Dual In-line Package of the
microcontroller chip used on the board.
What is DIP?
• DIP (Dual In-line Package):
• A rectangular chip package with two parallel rows of pins.
• The pins extend downwards for insertion into sockets or
through-hole soldering on printed circuit boards (PCBs).

• Example in Arduino Uno:


• The ATmega328P-PU microcontroller used on many
Arduino Uno boards is often in a DIP-28 package.
• DIP-28: A DIP package with 28 pins (14 pins on each
side).
• The chip can be easily replaced if it gets damaged.
Why DIP is Important in Arduino Uno?
Advantages of DIP:
1. Ease of Replacement:
• If the ATmega328P microcontroller is damaged, it can be removed and replaced without
replacing the entire board.
2. Through-Hole Mounting:
• DIP chips are soldered using through-hole technology, which is easier for manual soldering
and prototyping.
3. Beginner-Friendly:
• DIP packages are larger, making them easier to handle for beginners.
Disadvantages of DIP:
1. Size:
• DIP packages are larger compared to surface-mount packages, which may not be suitable for
compact designs.
2. Slower Assembly for Mass Production:
• Through-hole soldering is slower than surface-mount technology (SMT).
Alternatives to DIP in Arduino Uno Boards
• SMD (Surface-Mount Device):
• The microcontroller is soldered directly onto the PCB using Surface-
Mount Technology.
• Example: ATmega328P-AU in a TQFP (Thin Quad Flat Package).
• TQFP-32: A square package with 32 pins extending outwards.
Advantages:
Smaller Size:
• Allows for more compact designs, such as smaller Arduino boards or
shields.
Mass Production:
• Easier and faster for automated assembly.
• Disadvantages:
1.Not Removable:
• The chip cannot be replaced if it’s damaged.
Types of Arduino

LilyPad Arduino : 8MHz


Arduino Uno : 16MHz Arduino Nano : 16MHz

Arduino Pro Mini : 8


Arduino Mega2560 : 16MHz (3.3 V)/16 (5 V) MHz
Arduino Ethernet : 16MHz
Arduino MKR1000 : 48MHz Arduino 101 : 32MHz Arduino Zero : 48MHz

Arduino Due : 84MHz

Arduino Yún : 16MHz and 400MHz Arduino Leonardo : 16MHz


Types of Arduino

Arduino Fio : 8MHz


Arduino Pro : 16MHz

Arduino Mega ADK : 16MHz

Arduino Esplora : 16MHz Arduino Micro : 16MHz


Other
components of it
are:

• USB connector
• Power port
• Microcontroller
• Analog input pins
• Digital pins
• Reset switch
• Crystal oscillator
• USB interface chip
• TX RX LEDs
USB Interface
• The USB interface acts as the bridge between the microcontroller and the
computer. This connection enables:
• Programming the Microcontroller
• Power Supply
• Data Communication: Exchanging data between the microcontroller and the computer,
such as sending sensor readings or receiving commands.
• The ATmega328P does not have built-in USB support.
• The Arduino Uno has a separate chip (ATmega16U2) that acts as a USB-to-Serial converter.
• This chip translates USB data from the computer into serial data (TX/RX) for the
ATmega328P.
• Without this extra chip, the ATmega328P cannot be programmed via USB.
• Serial Communication Protocol:
• The Arduino uses a protocol called UART (Universal Asynchronous Receiver-
Transmitter) for serial communication.
Components Involved in the USB Interface
a) USB Connector:
• A physical port (usually USB Type-B or micro-USB) where you
plug in the USB cable.
b) USB-to-Serial Converter Chip:
• Translates USB signals into UART signals.
c) Serial Pins on the Microcontroller:
• The microcontroller uses dedicated pins for UART communication:
• TX (Transmit): Sends data.
• RX (Receive): Receives data.
d) Voltage Regulator:
• Ensures stable power supply to the board and peripherals.
Resettable Polyfuse
• A polyfuse, also known as a resettable fuse, is a
component designed to protect circuits from
excessive current (overcurrent) or power surges.
• Unlike traditional fuses that need to be replaced
after tripping, a polyfuse can reset itself
automatically once the fault condition (overcurrent
or short circuit) is resolved.
• It prevents damage to sensitive electronic
components by cutting off excessive current flow
during faults like short circuits or power surges.
• Protects the USB interface and microcontroller
from being damaged by overcurrent.
Step-by-Step Working:

1. Normal Conditions:
1. When the current is within a safe range, the polyfuse allows current to pass through it with minimal
resistance.
2. Overcurrent or Fault Condition:
1. When the current exceeds the rated limit of the polyfuse, it heats up due to the increase in power
dissipation.
2. The material in the polyfuse undergoes a sudden increase in resistance (due to its positive temperature
coefficient).
3. This high resistance essentially "trips" the fuse and significantly reduces the current flow.
3. Automatic Reset:
1. Once the fault condition is cleared (e.g., the short circuit is removed), the polyfuse cools down and returns
to its original low-resistance state.
2. The circuit resumes normal operation without the need to replace the fuse.
On an Arduino Uno, a polyfuse (usually rated around 500mA or 1A) is placed between the USB power source and
the rest of the circuit.
Comparison: Polyfuse vs. Regular Fuse

Feature Polyfuse (Resettable Fuse) Regular Fuse

Needs to be replaced after


Reusability Resets automatically after a fault
tripping

Reaction Time Slower response Faster response

Size Compact and lightweight Varies (can be bulky)

Cost Slightly more expensive Cheaper

Maintenance Minimal (self-resetting) Requires manual intervention


Power Supply DC Input (e.g., DC Barrel Jack)

• The DC power input is a connector that allows the board to


receive power from an external source, such as:
• A DC adapter (commonly 9V or 12V).
• A battery (e.g., 9V battery or custom battery packs).
• This is an alternative to powering the board via USB and is
especially useful when:
• The board is being used in standalone applications.
• The USB is not connected or unavailable.
• Remote locations.
• The DC input accepts power from an external source and regulates it for use by the Arduino
and connected devices.
• Here’s how it works:
1. Voltage Requirements:
1. The input voltage range is typically 7V to 12V for standard Arduino Uno boards.
2. Internally, a voltage regulator steps down this voltage to 5V and 3.3V for the microcontroller and other
components.
2. Connector Type:
1. The DC barrel jack is the most common connector for the power supply.
2. The inner pin is positive (+), and the outer sleeve is negative (−) (center-positive configuration).
3. Voltage Regulation:
1. The board includes a linear voltage regulator (e.g., 7805 or AMS1117) to step down the input voltage to
the required 5V.
2. An onboard capacitor smooths out the regulated voltage.
4. Power Selection:
1. Arduino automatically switches between USB power and DC power, depending on which is available.
2. A diode prevents backflow of current to protect the USB and DC sources.
Operational Amplifier (Op-Amp) LMV358IDGKR
• An operational amplifier, or op-amp, is an electronic device designed to
amplify electrical signals.
• Key Characteristics of an Op-Amp:
1. Amplification:
• It takes a weak input signal and amplifies it to a stronger output signal.
2. High Gain:
• It has very high voltage gain (can amplify small voltages by a large factor).
3. Differential Input:
• It has two inputs:
1. Non-inverting input (+): Where the signal is applied directly.
2. Inverting input (−): Where the inverted version of the signal is applied.
• The output depends on the difference between the two inputs.
4. Single or Dual Power Supply:
1. Operates with either a single positive voltage (e.g., +5V) or a dual supply (e.g.,
±5V).
• Sensors like temperature sensors, pressure sensors, or
photodiodes often produce very weak signals (e.g.,
millivolts).
• These signals are too small for a microcontroller to
process directly.
• The op-amp amplifies the signal to a range that the
microcontroller's ADC (Analog-to-Digital Converter)
can read accurately.
Capacitor
• A capacitor is a passive electronic component that
stores and releases electrical energy in a circuit.
• It temporarily holds an electrical charge, which can be
used to stabilize voltage, smooth out power, or
perform various other tasks.
• Capacitors store energy in an electric field between
two conductive plates separated by an insulating
material (dielectric).
• The stored energy can be released when needed, such
as when there's a drop or fluctuation in the circuit's
power supply.
• It can help smooth out electrical signals or remove
noise in sensitive circuits.
• Two capacitors (typically 22pF ceramic capacitors) are
connected to the crystal to stabilize its oscillation.
Quartz 16 MHz
• The quartz crystal oscillator generates a highly stable and precise
clock signal, which is essential for the microcontroller
(ATmega328P) and the USB controller (ATmega16U2).

Why is it needed?
• Microcontrollers rely on clock signals to execute instructions in a
synchronized manner.
• The 16 MHz frequency ensures that the ATmega328P processes
instructions at a consistent rate.
• Similarly, the ATmega16U2, which handles USB communication,
requires its own precise timing.
Placement

• Crystal Oscillator for ATmega328P:


• Located near the microcontroller
(ATmega328P).
• Typically marked as "16.000" or
"16 MHz" on the board.
• Crystal Oscillator for ATmega16U2:
• Positioned near the USB chip.
• Ensures accurate USB-to-serial
communication.
USB Chip (ATMEGA16U2-MU)

• The ATmega16U2 is a secondary microcontroller on the Arduino Uno, and its


primary role is to enable USB communication between the Arduino and a
computer. It acts as a USB-to-serial converter, allowing:
• Code uploading to the main microcontroller (ATmega328P).
• Serial communication for debugging or exchanging data between the Arduino
and the computer.
USB-to-Serial Conversion

1.Computer to Arduino:
1. When you upload code using the Arduino IDE, the ATmega16U2 converts USB data into
serial (UART) signals.
2. These signals are sent to the main microcontroller (ATmega328P) via its TX/RX pins.
2.Arduino to Computer:
1. Serial data generated by the Arduino Uno (e.g., sensor readings) is sent to the
ATmega16U2.
2. The ATmega16U2 translates the data into USB signals, making it readable on the
computer.
Why It’s Important
Enables Programming via USB:
• Without the ATmega16U2, the Arduino Uno
would require an external programmer to
upload code (via the ICSP header).
• The chip makes programming simpler and
faster.
Facilitates Debugging:
• During development, you can send and
receive data using the Arduino IDE’s Serial
Monitor.
Technical Specifications of the ATmega16U2
Feature Details

Microcontroller Type 8-bit AVR RISC-based microcontroller

Clock Speed 16 MHz

Flash Memory 16 KB

SRAM 512 bytes

EEPROM 512 bytes

Communication Protocols USB, UART, SPI, I2C


LED Green ON
• Purpose: This green LED shows when the board is powered on.
• The LED lights up when the circuit receives power, indicating that the
board is running.
• It provides a visual cue that the board is operational and receiving power.
28 DIP Atmel Chip (ATMEGA328P-PU)
• The ATmega328P-PU microcontroller in a 28-pin DIP (Dual In-line Package)
is the main microcontroller chip used in the Arduino Uno.

• Purpose of the ATmega328P-PU


• The ATmega328P is the brain of the Arduino Uno, responsible for running all
operations:
• Reads Inputs: Accepts data from sensors, buttons, or other devices connected to
the pins.
• Processes Data: Executes the instructions written in your program.
• Controls Outputs: Sends commands to LEDs, motors, or other actuators.
How It Works
A. Program Execution
1. Code Upload:
1. Programs are written in the Arduino IDE, compiled into machine code, and uploaded to the ATmega328P
via USB.
2. The program is stored in the chip's Flash memory.
2. Instruction Execution:
1. The ATmega328P executes instructions sequentially, based on the timing provided by its 16 MHz quartz
crystal oscillator.
B. Handling Inputs and Outputs
1. Digital Pins (14 pins, D0–D13):
1. Can be configured as inputs (to read HIGH/LOW states) or outputs (to control LEDs, relays, etc.).
2. Some pins support PWM (Pulse Width Modulation) for simulating analog output.
2. Analog Pins (6 pins, A0–A5):
1. Converts analog signals (e.g., sensor voltages) into digital values using its 10-bit ADC (Analog-to-
Digital Converter).
C. Timers and Interrupts
1. Timers and interrupts allow the ATmega328P to handle tasks like generating PWM signals, creating
precise delays, or reacting to external events (like a button press) without missing a beat.
Why It’s Important
A. Central Processing Unit (CPU):
• The ATmega328P serves as the decision-maker for the Arduino board, coordinating input,
computation, and output in real time.
B. Hardware Resources:
• It integrates multiple functionalities, including:
• Memory:
• Flash Memory: Stores the program (32 KB).
• SRAM: Holds variables and temporary data during runtime (2 KB).
• EEPROM: Non-volatile memory for permanent data storage (1 KB).
• Peripherals:
• UART, SPI, I2C communication interfaces.
• GPIO (General-Purpose Input/Output) pins.
• PWM and ADC modules.
C. Flexibility:
• The DIP (Dual In-line Package) design allows the ATmega328P to be:
• Easily replaced if damaged.
• Reprogrammed using an external programmer (via ICSP headers).
Technical Specifications of ATmega328P-PU
Feature Details

Package Type 28-pin DIP (Dual In-line Package)

Clock Speed 16 MHz

Flash Memory 32 KB (0.5 KB used by bootloader)

SRAM 2 KB

EEPROM 1 KB

Operating Voltage 1.8V to 5.5V (5V used in Arduino Uno)

I/O Pins 23 (14 Digital + 6 Analog + Power Pins)

Timers Timer0 (8-bit), Timer1 (16-bit), Timer2 (8-bit)

ADC Resolution 10-bit

Communication Protocols UART, SPI, I2C


Pinout of the ATmega328P (DIP)
• Digital Pins (D0–D13):
• Used for general-purpose input/output (GPIO).
• Pins D3, D5, D6, D9, D10, D11 support PWM.
• Analog Pins (A0–A5):
• These pins are connected to the 10-bit ADC for reading analog signals.
• Special Pins:
• RESET (Pin 1): Resets the microcontroller.
• XTAL1 and XTAL2 (Pins 9, 10): Connect the quartz crystal oscillator.
• VCC and GND (Multiple Pins): Power supply and ground connections.
Resistor Networks (RN1, RN2, RN3, RN4)
• What are Resistor Networks?
• A resistor network is a group of resistors integrated into a single package.
These are often used in circuits where multiple resistors of the same value are
required.
• Purpose:
• Reduce the flow of current to protect components.
• Set or maintain specific voltage levels.
• Minimize the space required on the PCB by combining multiple resistors into
one compact package.
Resistor Networks in Arduino Uno
• Common Applications:
• Pull-Up Resistors for I2C:
• Resistors in RN1 and RN2 are used as pull-up resistors for the SDA (A4) and SCL (A5) lines in
the I2C communication interface.
• LED Current Limiting:
• Resistor networks limit current to onboard LEDs, such as the D13 built-in LED, to prevent them
from being overdriven.
• Pin Protection:
• Ensures unused pins or inputs are not left floating, which could cause unpredictable behavior or
noise in the circuit.
• Example on Arduino Uno:
• RN1: Pull-up resistors for I2C communication (SDA/SCL lines).
• RN2, RN3, RN4: May be used for other digital logic pull-up or pull-down configurations.
• I2C requires pull-up resistors to ensure the lines (SDA and SCL) remain HIGH when no
device is driving them.
USB connector
• This is a printer USB port used to load a program from the Arduino
IDE onto the Arduino board. The board can also be powered through
this port.
Power port:
• The Arduino board can be powered through an AC-to-DC adapter or a
battery. The power source can be connected by plugging in a 2.1mm
center-positive plug into the power jack of the board.
• The Arduino UNO board operates at a voltage of 5 volts, but it can
withstand a maximum voltage of 20 volts.
Microcontroller:
• The most prominent black rectangular chip with 28 pins.
• The microcontroller used on the UNO board is Atmega328P by Atmel.
• Flash memory of 32KB: The program loaded from Arduino IDE
is stored here.
• RAM of 2KB: This is a runtime memory.
• CPU: It controls everything that goes on within the device.
It fetches the program instructions from flash memory, and runs them
with the help of RAM.
• Electrically Erasable Programmable Read Only Memory
(EEPROM) of 1KB. This is a type of nonvolatile memory, and it keeps the
data even after device restart and reset.

Atmega328P is pre-programmed with bootloader. This allows you to directly upload a new Arduino
program into the device, without using any external hardware programmer, making the Arduino
UNO board easy to use.
Analog input pins:
• The Arduino UNO board has 6 analog input pins, labeled “Analog 0 to 5.”
• These pins can read the signal from an analog sensor like a temperature sensor and convert it into a
digital value so that the system understands.
• These pins just measure voltage and not the current because they have very high internal resistance.
Hence, only a small amount of current flows through these pins.
• Although these pins are labeled analog and are analog input by default, these pins can also be used for
digital input or output.
Digital pins:
• You can find these pins labeled “Digital 0 to 13.”
These pins can be used as either input or output
pins. When used as output, these pins act as a
power supply source for the components
connected to them. When used as input pins,
they read the signals from the component
connected to them.
• When digital pins are used as output pins, they
supply 40 milliamps of current at 5 volts, which
is more than enough to light an LED.
• Some of the digital pins are labeled with tilde
(~) symbol next to the pin numbers (pin numbers
3, 5, 6, 9, 10, and 11). These pins act as normal
digital pins but can also be used for Pulse-Width
Modulation (PWM), which simulates analog
output like fading an LED in and out.
Reset switch:

• When this switch is clicked, it sends a


logical pulse to the reset pin of the
Microcontroller, and now runs the
program again from the start.
• This can be very useful if your code
doesn’t repeat, but you want to test it
multiple times.
Crystal oscillator:
• This is a quartz crystal oscillator which ticks
16 million times a second.
• On each tick, the microcontroller performs
one operation, for example, addition,
subtraction, etc.
TX – RX LEDs:

• TX stands for transmit, and RX for


receive.
• These are indicator LEDs which
blink whenever the UNO board is
transmitting or receiving data.

You might also like