Arduino Microcontroller Lecture Notes
Structured lecture note on Arduino Microcontroller
[Link] Computer Science
(Electronic Instrument paper)
Professor Rupam Das (Dept. of Electronics, Rahara Ramkrishna Mission
Vivekananda Centenary College
Lecture Note: Arduino Microcontroller
1. Introduction to Arduino
• Arduino is an open-source electronics platform based on easy-to-use hardware
and software.
• It is widely used for embedded systems, automation, instrumentation,
robotics, and IoT.
• Designed for students, engineers, and hobbyists.
Key Features:
• Simple programming (C/C++ based)
• Low cost
• Cross-platform (Windows, Linux, macOS)
• Large community support
2. Arduino Board Overview
Most commonly used board: Arduino Uno
Main Components:
• Microcontroller (ATmega328P)
• Digital I/O Pins (14 pins)
• Analog Input Pins (6 pins)
• USB Port (for programming & power)
• Power Jack
• Crystal Oscillator (16 MHz)
• Voltage Regulator
• Reset Button
3. Block Diagram of Arduino
4. Arduino Microcontroller (ATmega328P)
Features:
• 8-bit microcontroller
• Clock Speed: 16 MHz
• Flash Memory: 32 KB
• SRAM: 2 KB
• EEPROM: 1 KB
• Operating Voltage: 5V
Detailed Features
• ATMega328P Processor
• Memory
1. AVR CPU at up to 16 MHz
2. 32 kB Flash
3. 2 kB SRAM
4. 1 kB EEPROM
• Security
1. Power On Reset (POR)
2. Brown Out Detection (BOD)
• Peripherals
1. 2x 8-bit Timer/Counter with a dedicated period register and compare channels
2. 1x 16-bit Timer/Counter with a dedicated period register, input capture and
compare channels
3. 1x USART with fractional baud rate generator and start-of-frame detection
4. 1x controller/peripheral Serial Peripheral Interface (SPI)
5. 1x Dual mode controller/peripheral I2C
6. 1x Analog Comparator (AC) with a scalable reference input
7. Watchdog Timer with separate on-chip oscillator
8. Six PWM channels
9. Interrupt and wake-up on pin change
10. ATMega16U2 Processor8-bit A
11. VR® RISC-based microcontroller
• Memory
1. 16 kB ISP Flash
2. 512B EEPROM
3. 512B SRAM
Debug WIRE interface for on-chip debugging and programming
• Power
1. 2.7-5.5 volts
5. Pin Configuration Digital Pins (0–13)
• Used for digital input/output
• Logic levels: HIGH (5V), LOW (0V)
Analog Pins (A0–A5)
• Used for analog input
• ADC Resolution: 10-bit (0–1023)
Special Pins:
• PWM Pins: 3, 5, 6, 9, 10, 11
• TX/RX: Serial communication
• SPI: 10, 11, 12, 13
• I2C: A4 (SDA), A5 (SCL)
6. Working Principle of Arduino
1. Write program in Arduino IDE
2. Compile the code
3. Upload to Arduino via USB
4. Microcontroller executes the program
5. Interacts with input/output devices
Basic Operation Flow:
Input → Processing (MCU) → Output
7. Arduino Programming Structure
Basic Syntax:
void setup() {
// Runs once
void loop() {
// Runs continuously
8. Example Program (LED Blinking)
int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
void loop() {
digitalWrite(ledPin, HIGH); // LED ON
delay(1000);
digitalWrite(ledPin, LOW); // LED OFF
delay(1000);
Explanation:
• pinMode() → defines pin as input/output
• digitalWrite() → sets HIGH/LOW
• delay() → time delay in milliseconds
9. Applications in Electronic Instrumentation
• Data acquisition systems
• Sensor interfacing (temperature, pressure, etc.)
• Digital measurement instruments
• Automation systems
• Medical devices (basic monitoring)
• Control systems
10. Advantages
• Easy to learn and use
• Low cost
• Large ecosystem
• Flexible interfacing
11. Limitations
• Limited memory
• Not suitable for high-speed industrial applications
• Less processing power compared to advanced microcontrollers
12. Viva Questions
1. What is Arduino?
2. What is the function of ATmega328P?
3. Difference between analog and digital pins?
4. What is PWM?
5. Explain setup() and loop() functions.
6. What is ADC resolution in Arduino?
13. Short Notes (Exam Focus)
• Arduino = Open-source microcontroller platform
• ATmega328P = Brain of Arduino Uno
• 10-bit ADC → 0–1023 values
• PWM → Analog-like output using digital pins
• Used in instrumentation & automation
Embedded System, FPGA & ASIC (in context of Arduino)
1. Embedded System
Definition:
An Embedded System is a combination of hardware and software designed to
perform a specific task.
Arduino as Embedded System:
• Arduino is a typical embedded system
• It uses ATmega328P microcontroller
• Executes a fixed program (firmware)
Features:
• Real-time operation
• Task-specific (e.g., temperature sensing, LED control)
• Low power consumption
Example:
• Digital thermometer using Arduino
• Automatic street light system
2. FPGA (Field Programmable Gate Array)
Definition:
An FPGA is a reconfigurable hardware device that can be programmed to implement
digital circuits.
Key Points:
• Hardware-level programming (VHDL/Verilog)
• Highly parallel processing
• Reprogrammable multiple times
Comparison with Arduino:
Feature Arduino (MCU) FPGA
Nature Fixed CPU Configurable hardware
Programming C/C++ VHDL/Verilog
Execution Sequential Parallel
Flexibility Moderate Very High
Example:
• Image processing
• Signal processing systems
3. ASIC (Application Specific Integrated Circuit)
Definition:
An ASIC is a custom-designed chip for a specific application.
Key Points:
• Designed for one specific task
• High performance and efficiency
• Not reprogrammable
Comparison with Arduino:
Feature Arduino ASIC
Flexibility Programmable Fixed
Cost Low (prototype) High (design cost)
Speed Moderate Very High
Use Learning & prototyping Mass production
Example:
• Mobile processor
• Digital watch IC
• Medical monitoring IC
4. Relationship Between Arduino, FPGA & ASIC
Think of them as levels of system design:
ASIC → Fixed hardware (final product)
FPGA → Prototype / flexible hardware
Arduino → Microcontroller-based embedded system
Explanation:
• Arduino → Used for learning, prototyping, small projects
• FPGA → Used when high speed & parallel processing required
• ASIC → Used for final commercial products
5. Simple Concept Flow
Problem → Arduino Prototype → FPGA Optimization → ASIC Production
6. Viva Questions
1. What is an embedded system?
2. Why is Arduino called an embedded system?
3. Difference between FPGA and microcontroller?
4. What is ASIC?
5. Which is faster: FPGA or Arduino?
6. Why ASIC is not reprogrammable?
7. Short Exam Points
• Arduino = Embedded system with microcontroller
• FPGA = Reconfigurable digital hardware
• ASIC = Fixed function IC
• Speed: ASIC > FPGA > Arduino
• Flexibility: FPGA > Arduino > ASIC