1 Elec 1b - Introduction To Arduino
1 Elec 1b - Introduction To Arduino
Elective 1
(Embedded System)
This is a property of
PRESIDENT RAMON MAGSAYSAY STATE UNIVERSITY
NOT FOR SALE
Elec 1 – Technical Elective
First Edition, 2021
Copyright. Republic Act 8293 Section 176 provides that “No copyright shall subsist in any work of
the Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such agency or
office may, among other things, impose as a condition the payment of royalties.
Borrowed materials included in this module are owned by their respective copyright holders. Every
effort has been exerted to reach and seek permission to use these materials from their respective
copyright owners. The University and authors do not claim ownership over them.
Assigned
Title Author
Chapter
Chapter 1: Introduction to Arduino
Chapter 2: Arduino Development Environment Dionisio M. Martin Jr.
Chapter 3: Arduino Programming
Chapter 3: Arithmetic Operators
Evaluators:
At the end of the semester, 85% of the students have attained 90% level of understanding for
being aware in the latest technology through the Arduino technology, both in research-based
and project-based.
Course Details:
The University LMS will be used for asynchronous learning and assessment. The link and class
code for LMS will be provided at the start of class through the class’ official Facebook Group.
Edmodo
Google Classroom
University LMS
Major examinations will be given as scheduled. The scope and coverage of the examination
will be based on the lessons/topics as plotted in the course syllabus.
0323
Module Overview
Introduction
This module aims to introduce the concepts of modular approach in designing and developing
projects using Arduino technology.
The students will learn how to program using operators and operators, conditional statements,
iterative statements and instruction necessary in using modules and library.
Table of Contents
Chapter 1
Introduction to
Arduino
Chapter 1
Introduction to Arduino
Introduction
In 2005, building upon the work of Hernando Barragán (creator of Wiring), Massimo Banzi
and David Cuartielles created Arduino, an easy-to-use programmable device for interactive art
design projects, at the Interaction Design Institute Ivrea in Ivrea, Italy. They wanted a device
that was simple, easy to connect to various things (such as relays, motors, and sensors), and
easy to program.
Specific Objectives
Duration
_____________________________________________
ARDUINO UNO
1 – Power USB. It can be powered by using the USB cable from your computer. All you
need to do is connect the USB cable to the USB connection.
2 – Power (Barrel Jack). It can be powered directly from the AC mains power supply by
connecting it to the Barrel Jack.
3 – Voltage Regulator. Its function is to control the voltage given to the Arduino board
and stabilize the DC voltages used by the processor and other elements.
4 – Crystal Oscillator. It helps Arduino in dealing with time issues. How does Arduino
calculate time? The answer is, by using the crystal oscillator. The number printed on
top of the Arduino crystal is 16.000H9H. It tells that the frequency is 16,000,000 Hertz
or 16-MHz.
5 – Arduino Reset. It is used to reset the Arduino board, i.e., start the program from the
beginning. Resetting UNO board comes in two ways: a.) First, by using the reset button
(17) on the board and b.) second, by connecting an external reset button to the Arduino
pin labelled RESET (5).
6, 7, 8, 9 – Pins (3.3, 5, GND, Vin)
• (6) 3.3V: Supply 3.3 output volt
• (7) 5V: Supply 5 output volt. Most of the components used with Arduino board
works fine with 3.3-volt and 5-volt.
• (8) GND (Ground): There are several GND pins on the Arduino, any of which can
be used to ground your circuit.
• (9) Vin: This pin also can be used to power the Arduino board from an external
power source, like AC mains power supply.
10 – Analog pins. The Arduino UNO board has five analog input pins A0 through A5.
These pins can read the signal from an analog sensor like the humidity sensor or
temperature sensor and convert it into a digital value that can be read by the
microprocessor.
11 – Main microcontroller. Each Arduino board has its own microcontroller (11). It is
assumed as the brain of your board. The main IC (integrated circuit) on the Arduino is
slightly different from board to board. The microcontrollers are usually of the ATMEL
Company. You must know what IC your board has before loading up a new program
from the Arduino IDE.
12 – ICSP pin. Mostly, ICSP is an AVR, a tiny programming header for the Arduino
consisting of MOSI, MISO, SCK, RESET, VCC, and GND. It is often referred to as an
SPI (Serial Peripheral Interface), which could be considered as an "expansion" of the
output. Actually, you are slaving the output device to the master of the SPI bus.
13 – Power LED indicator. This LED should light up when you plug your Arduino into a
power source to indicate that your board is powered up correctly. If this light does not
turn on, then there is something wrong with the connection.
14 – TX and RX LEDs. These appear in two places on the Arduino UNO board and
labelled as TX (transmit) and RX (receive). First, at the digital pins 0 and 1, to indicate
the pins responsible for serial communication. Second, the TX and RX led (13). The
TX led flashes with different speed while sending the serial data. The speed of flashing
depends on the baud rate used by the board. RX flashes during the receiving process.
15 – Digital I/O. The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide
PWM (Pulse Width Modulation) output. These pins can be configured to work as input
digital pins to read logic values (0 or 1) or as digital output pins to drive different
modules like LEDs, relays, etc. The pins labeled “~” can be used to generate PWM.
16 – AREF. AREF stands for Analog Reference. It is sometimes, used to set an external
reference voltage (between 0 and 5 Volts) as the upper limit for the analog input pins.
TYPES OF ARDUINO
Since then, the Arduino has grown in several different directions, with some versions getting
smaller than the original, and some getting larger. Each has a specific intended niche to fill. The
common element among all of them is the Arduino runtime AVR-GCC library that is supplied
with the Arduino development environment, and the on-board bootloader firmware that comes
preloaded on the microcontroller of every Arduino board.
The Arduino family of boards use processors developed by the Atmel Corporation of San Jose,
California. Most of the Arduino designs utilize the 8-bit AVR series of microcontrollers.
Although an Arduino board is, as the Arduino team states, just a basic Atmel AVR development
board, it is the Arduino software environment that sets it apart. This is the common experience
for all Arduino users, and the cornerstone of the Arduino concept.
The following are the most common Arduino board:
Arduino Uno
Processor: ATmega328 (8-bit CPU, 16MHz clock speed, 2KB SRAM, 32KB flash storage)
Features: 14 digital I/O pins, 6 analog input pins, removable microcontroller
Form Factor: 2.7” x 2.1” rectangle
The Arduino Uno is the most “standard” Arduino board currently on the market, and is
probably the best choice for beginners just getting started with the platform. The board is
compatible with more shields (add-on boards) than other models.
The Uno’s main limitation is the ATmega328 chip, which doesn’t have a lot of SRAM
or flash memory. That limit’s the kinds of programs you can load on the chip – if your project
involves a display or otherwise needs to store and use any form of images or audio data, 2KB
of memory probably isn’t going to be enough.
Arduino Mega
Processor: ATmega2560 (8-bit CPU, 16MHz clock speed, 8KB SRAM, 256KB flash storage)
Features: 54 digital I/O pins (15 PWM), 16 analog input pins, 4 UARTs, 16 MHz crystal
oscillator
Form Factor: 101.52mm x 53.3mm rectangle
The Mega is a microcontroller board based on the ATmega2560. The Mega is
compatible with most shields designed for the Arduino Duemilanove or Diecimila. It is
intended for comparatively bigger projects requiring a large number of input and output pins.
Arduino Nano
Processor: ATmega328 (8-bit CPU, 16MHz clock speed, 2KB SRAM, 32KB flash storage)
Features: 22 digital I/O pins, 8 analog input pins
Form Factor: 18mm x 45mm rectangle
The Arduino Nano is a small, complete, and breadboard-friendly board based on the
ATmega 328 (Arduino Nano 3.x). It has more or less the same functionality of the Arduino
Duemilanove, but in a different package. It lacks only a DC power jack, and works with a mini-
B USB cable instead of a standard one.
Arduino Mini
Processor: ATmega328 (8-bit CPU, 16MHz clock speed, 2KB SRAM, 32KB flash storage)
Features: 14 digital I/O pins, 8 analog input pins, 16 MHz crystal oscillator
Form Factor: 30mm x 18mm rectangle
The Arduino Mini is a small microcontroller board originally based on the ATmega168,
but now supplied with the 328 (datasheet), intended for use on breadboards and when space is
at a premium.
The new Mini (revision 05) has a new package for the ATmega, which enable all
components to be on the top of the board. It also has an onboard reset button.
Arduino Leonardo
Processor: ATmega32u4 (8-bit CPU, 16MHz clock speed, 2KB SRAM, 32KB flash storage)
Features: 20 digital I/O pins (7 PWM), 12 of which can be used as analog inputs, native USB
support
Form Factor: 68.6mm x 53.3mm rectangle
The Leonardo is, essentially, a slight upgrade to the Uno. It looks a lot like the Uno, but
it features a soldered-on ATmega32u4 microcontroller with a tiny bit more memory. The main
advantage of the ATmega32u4 isn’t the extra SRAM, though, it’s the chip’s built-in USB
compatibility. This allows the Leonardo to interface with a PC, which sees it as a generic mouse
or keyboard. It also features a few extra analog input pins.
Arduino Due
Processor: Atmel SAM3X8E ARM Cortex-M3 (32-bit CPU, 84MHz clock speed, 96KB
SRAM, 512KB flash storage)
Features: 54 digital I/O pins (12 PWM), 12 analog input pins, 2 analog output pins, native USB
port
Form Factor: 101.52mm x 53.3mm rectangle
One of the newest Arduino boards, the Due is the heavy-hitter of the family, packing a
32-bit ARM processor that handily outclasses any of the processors found in other Arduino
boards. The Due is primarily for more complicated projects that can make sure of its muscular
processor, or that need more I/O pins than are found on the smaller Arduino boards. That said,
the Due is substantially bigger and more expensive than the Uno or Leonardo, so consider
whether you really need the extra power before making a purchase.
One drawback to the Due is that it operates at 3.3 volts, which is different than the 5
volts that most other Arduino boards operate at. That limits the add-on hardware that’s
compatible with the Arduino Due – if an add-on board tries to send a 5-volt signal to the Due’s
I/O pins, it could damage the microcontroller.
Arduino Lilypad
Processor: ATmega328 (8-bit CPU, 16MHz clock speed, 2KB SRAM, 32KB flash storage)
Features: 14 digital I/O pins, 6 analog input pins
Form Factor: 2” diameter circle
The Lilypad is an Arduino board specifically designed for wearable devices. Its circular
shape and standoff-less I/O pins are designed to make it easy to sew the Lilypad into fabric-
based projects.
The hardware on a standard LilyPad board is basically the same as on and Arduino Uno.
There are a number of other LilyPad options available as well, including the LilyPad Arduino
USB, which feature’s the Leonardo’s ATmega32u4 chip, the Lilypad Arduino Simple, which
has fewer I/O connections than the basic model, and the LilyPad Arduino SimpleSnap, which
can be snapped into and out of projects, so they can be safely washed.
_____________________________________________
References/Additional Resources/Readings
http://www.arduino.cc
Activity Sheet
ACTIVITY 1
Direction: Match the items in column A to their descriptions in column B. write only the letter
of your choice on the space provided.
A B
_____ 1. Mini a. A small, complete, and breadboard-friendly board based on
the ATmega 328 and works with a mini-B USB cable
instead of a standard one.
_____ 2. Mega b. Circular shape and standoff-less I/O pins are designed to
make it easy to sew to fabric-based projects.
_____ 3. Nano c. A small microcontroller board originally based on the
ATmega168 intended for use on breadboards and when
space is at a premium.
_____ 4. Due d. A microcontroller board based on the ATmega2560 and
intended for comparatively bigger projects requiring a large
number of input and output pins.
_____ 5. Lilypad e. Primarily for more complicated projects that can make sure
of its muscular processor, or that need more I/O pins than
are found on the smaller Arduino boards.
Direction: Place a Check () mark on the corresponding column if the given application is
either A – real-world monitoring, B – small-scale control, C – small-scale automation or D –
performance art.
A B C D
1. Dynamic lighting control
2. Quadrotor UAVs
3. Automated greenhouse
4. Automated aquarium
5. Automatic wildlife detector
Direction: Give the complete terms for the following abbreviated words.
1. USB
2. I/O
3. UAV
4. CNC
5. TTL
6. AVR
7. MCU
8. MHz
9. KB
10. UART
2. What do you think the importance of using Arduino board compared in using
ATmega328 microcontroller directly to the design project?
3. Why Arduino Uno is the most “standard” Arduino board currently on the market?
5. What design could you think you want to develop from Arduino? List five.
Learner’s Feedback Form
In what particular portion of this learning packet, you feel that you are struggling or lost?
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
To further improve this learning packet, what part do you think should be enhanced?
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
NOTE: This is an essential part of course module. This must be submitted to the subject
teacher (within the 1st week of the class).