STARTING WITH
ARDUINO
Lesson 1: Introduction to
Arduino
Objectives:
• At the end of this lesson, you should be able to:
1. describe an Arduino;
2. understand the function of an Arduino;
3. understand the difference between a microprocessor and a microcontroller;
and
4. identify the different types of microcontrollers.
What is Arduino?
• Arduino is an open-source
electronics platform that is
easy-to-use hardware and
software. This board can read
inputs with sensors like light,
sound, range, touch, pressing a
button, or typing a command
that turns into an output like
activating an LED, motor, or
displaying characters on a
screen.
What is a Microprocessor?
• A microprocessor is a
small electronic device
that contains the function
of the control and logic
operations of a digital
computer or known as
the Central Processing
Unit.
What is a Microcontroller?
• A microcontroller is a
compact integrated
circuit that includes a
processor, memory, and
input and output
peripherals.
Characteristics
Microprocessor Microcontroller
• Microprocessors work at very high • Slow speed of operation.
speed. • It uses a micro-CPU using a lower
• They are small. frequency.
• Microprocessors are programmable. • Peripherals (timers, counters, etc.) are
• They are expensive due to integrated embedded in the chip.
circuit technology. • Suitable for bit-wise operations.
• Power usage is very low due to metal • Less expensive.
oxide semiconductor technology • Boolean operations are supported.
usage. • Use in real-time applications.
• Reliable, failure rate is very low.
• Lower heat generation as
semiconductor devices emits very less
heat.
Diagram
Diagram
Several Types of
Microcontrollers in
an Embedded
System
• PIC Microcontroller, PIC (Peripheral Interface
Controller), is a kind of microcontroller that
can be used in electronics, robotics, and
other similar devices. PIC unit has a built-in
data memory, data bus, and dedicated
microprocessor for preparing all I/O devices.
PIC Microcontroller
(Peripheral Interface Controller)
• ARM Microcontroller, ARM (Advanced RISC Machine), is
the most popular Microcontrollers Programming in the
digitally-embedded system world. Most industries prefer
to use only ARM microcontrollers since it has a significant
feature to implement products with an excellent
appearance. It has a cost-sensitive and high-performance
device used in various applications such as Industrial
Instrument control systems, wireless networking,
sensors, automotive body systems, etc.
ARM
Microcontroller
(Advanced RISC Machine)
• 8051 Microcontroller, 8051 microcontrollers were
created by Intel in 1981. It is an 8-bit
microcontroller. It is made of 40 pins DIP (Dual inline
package), 4kb of ROM storage, 128 bytes of RAM
storage, and two 16-bit timers. It consists of four
parallel 8-bit ports, which are programmable and
addressable as per the specification.
8051
Microcontroller
Feature 8051 PIC
Typically up to 33 Typically up to 32
CPU Speed
MHz MHz
Power
Higher Lower
Consumption
More complex and
Instruction Set Limited
diverse
More and larger
On-chip memory Limited
on-chip memory
• AVR Microcontroller, AVR (Alf and
Vegard's RISC Processor), was
modified by Harvard architecture
machine where programs and data
were stored in a separate physical
memory system that appears in
different address spaces but can
browse information from program
memory victimization in particular
directions. AVR micro-controllers are
AVR
Microcontroller
(Alf and Vegard's RISC
Processor)
• MSP Microcontroller, MSP (Mixed Signal
Processor), is from the family of Texas Instruments.
Built around a 16 -bit CPU, the MSP is designed for
low-cost and low-power dissipation embedded
statements. The controller's appearance is directly
related to the 16-bit data bus, seven addressing
modes, and the decreased instructions set, which
allows a shorter, denser programming code for fast
performance.
MSP
Microcontroller
(Mixed Signal Processor)
Several Types of
Prototyping
Microcontrollers
• Raspberry Pi is a bank-card-
sized single-board computer
that can be used in many
applications. It has the
capability of a regular
desktop. It can be
connected to a monitor,
keyboard, and mouse.
• Arduino Uno is a
microcontroller board based
on a microchip. It has 20
digital I/O pins. It is designed
to make electronics accessible
to everyone interested in
electronics and programming.
• Arduino Nano is a compact
micro board powerful
enough to hold 16 MHz of
frequency, which is the
same as Arduino UNO;
however, it does not have a
DC power jack.
• Makeblock mCore is a
microcontroller that
powers the mBot, with
built-in I/O components
like RGB LED, buzzer, light
sensors, motors, and other
communicating devices.
Lesson 2: The Arduino Board
Objectives:
• At the end of this lesson, you should be able to:
1.identify the parts of an Arduino Board; and
2.describe the functions of an Arduino Board.
The Arduino Board• Arduino UNO is a
microcontroller board based
on the ATmega328P. It has 14
digital input/output pins (six
pins can be used as PWM
outputs), six analog inputs, a
16 MHz ceramic resonator, a
USB connection, a power jack,
an ICSP header, and a reset
button
The Arduino Board • DFRduino Uno V3.0 is a small
computing board used for
academics or development
projects. It is a simple
microcontroller board that is
fully compatible with the
Arduino Uno R3 and Arduino
IDE open-source development
environment.
The Arduino Board
• DFRduino microcontroller
headers have different
colors to feature I/O ports
of different types:
• Red for Power Section.
• Blue for Analog I/O.
• Green for Digital I/O.
Specifications
• Microcontroller: ATmega328 mA
(DIP Package) • Flash Memory: 32 KB, of
• Operating Voltage: 5V which the bootloader uses
• Input Voltage 2KB
(recommended): 7 ~ 12V • SRAM: 2 KB (ATmega328)
• Input Voltage (limits): 6 ~ 20V • EEPROM: 1 KB (ATmega328)
• Digital I/O Pins: 14 (of which • Clock Speed: 16 MHz
6 provide PWM output) • USB Connector: USB-B
• Analog Input Pins: 6 • Size: 75 x54 x15 mm
• DC Current per I/O Pin: 40 (2.95 x2.13 x0.59")
mA
• DC Current for 3.3V Pin: 50
Parts of the Arduino Microcontroller
1. USB Port - When attached to a computer via USB
cable, it can upload programs and be an alternative
power source for the microcontroller.
2. DC Power Jack – It runs the microcontroller with 7
~ 12 volts of supply.
3. Power Indicator – It lights on/off, indicating power
in the microcontroller.
4. Reset – It resets the running program when
pressed.
5. Digital Pins – These can be used to connect all
digital I/O components to the microcontroller.
Digital Pins: 0 -13
PWM Pins: 3,5,6,9,10,11
Ground Pins
AREF: Reference voltage for the analog inputs.
Parts of the Arduino Microcontroller
6. Analog Pins – These can be used to connect
all analog I/O components to the
microcontroller.
Analog Pins: A0-A5
7. Power Pins – These can be used to power a
component attached to the microcontroller.
Output Power: 3.3V ~ 5V
Ground Pins
Vin Pins: voltage input to the
microcontroller board when using an
external power source.
8. Signal Indicator TX- It blinks when
transmitting data.
9. Signal Indicator RX- It blinks when receiving
data.
10. Signal Indicator L – It blinks when pin 13 is
alternately turned HIGH and LOW or On and Off
which means everything is working correctly.
Lesson 3: XOD Arduino
Programming
Objectives:
• At the end of this lesson, you should be able to:
1.describe XOD;
2.explain the functions of XOD; and
3.enumerate the advantages of using XOD.
XOD Arduino Programming
• XOD is a visual programming software
language for microcontrollers. It is a
software compatible with Arduino and
Raspberry Pi boards. It is an open-source
platform that started in 2016 which can
be used by hobbyists and professionals
in building and creating electronic
projects.
Installing XOD
Step 1: Select anyone
who uses this computer
and click install.
Installing XOD
Step 2: Wait until
it finishes installing
on your computer.
Installing XOD
Step 3: Tick the
checkbox and click Finish
to run the XOD program.
XOD IDE
Now once you start
the XOD IDE, you are
ready to program.
Running XOD
When running the XOD for the first time,
you will see a large grey color
background with boxes in your program,
which is called a patch. A patch is a
working area for an XOD program. It is
almost similar to a sketch in the Arduino
IDE; but uses text-based code. It is built
with nodes, and is an essential element
in the XOD program.
Running XOD
The pins on a node can have different
data types represented by colors.
Green pins represent numbers.
Blue pins represent pulses.
Violet pins represent Boolean values.
Orange pins represent strings.
Running XOD
Input pins are at the top side of
each node, and the Output pins are
located at the bottom. The pins on
each node are like variables and
contain parameter values. The
values can be replaced or use their
default values or selected and set
using the inspector.
Running XOD
Each node has one or more inputs that
accept values to be processed and outputs
that return a result. Creating a link to the
node builds input and output data, allowing
one node to read values from another. Link
are lines that are used to connect nodes.
Linking nodes are like a wiring element in an
electronic circuit.
Running Simulations (XOD IDE)
The XOD IDE program
consists of nodes connected
to one or more patches. It is
an ecosystem where all
patches and nodes work in
one specific action.
Running Simulations (XOD IDE)
Running Simulations (XOD IDE)
XOD Keyboard Shortcuts
Shortcut Action
CTRL + N New Patch
CTRL + SHIFT + N New Project
CTRL + S Save Project
CTRL + O Open Project
CTRL + C Copy
CTRL + V Paste
CTRL + X Cut
CTRL + Z Undo
CTRL + A Select All
Delete or Backspace Delete the selected node
Escape Key Deselect
I Insert a Node
H Toggle Help bar
CRTL + - Zoom Out
CTRL + Shift + Zoom In
CTRL + 0 Default Zoom
Setup XOD
Setup XOD
Setup XOD
Saving, Debugging, and Compiling
Saving, Debugging, and Compiling
Saving, Debugging, and Compiling