Arduino Uno
Arduino Uno
What is Arduino ?
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).
• 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
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
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
Flash Memory 16 KB
SRAM 2 KB
EEPROM 1 KB
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: