ARDUINO FOR IACT
ARDUINO FOR IACT
ARDUINO
FOR IACT
INSTRUCTOR:
MARK JAMES B. LAYSON,ECT
ARDUINO
Arduino is an open-source electronics platform
based on easy-to-use hardware and software.
Arduino boards are able to read inputs - light
on a sensor, a finger on a button, or a Twitter
message - and turn it into an output -
activating a motor, turning on an LED,
publishing something online. You can tell your
board what to do by sending a set of
instructions to the microcontroller on the
board. To do so you use the Arduino
programming language (based on Wiring), and
the Arduino Software (IDE), based on
Processing.
1
21/04/2025
TYPES OF ARDUINO
Arduino Mega (R3) Board
Arduino Uno (R3)
Arduino Leonardo Board
Arduino Nano
Arduino Robot
Arduino Micro
Arduino Esplora
Arduino Due
Arduino Pro Mic
LilyPad Arduino Board
Arduino Ethernet
Arduino Bluetooth
Arduino Zero
Arduino Diecimila
Fastest Arduino Board
RedBoard Arduino Board
ARDUINO UNO
Arduino UNO is a microcontroller board based on the ATmega328P. It has 14
digital input/output pins (of which 6 can be used as PWM outputs), 6 analog
inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP
header and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power it with
a AC-to-DC adapter or battery to get started. You can tinker with your UNO without
worrying too much about doing something wrong, worst-case scenario you can
replace the chip for a few dollars and start over again.
2
21/04/2025
ARDUINO UNO
Replaceable chip
The ATmega328P can easily
be replaced, as it is not
soldered to the board.
EEPROM
The ATmega328P also
features 1kb of EEPROM, a
memory which is not
erased when powered off.
Battery Connector
The Arduino UNO features a
barrel plug connector, that
works great with a standard
9V battery.
3
21/04/2025
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. If the board is
supplied with a higher voltage, there is a voltage regulator (it sits between the power port and USB connector) that protects the
board from burning out.
4
21/04/2025
It is the most prominent black rectangular chip with 28 pins. Think of it as the brains of your Arduino. The microcontroller
used on the UNO board is Atmega328P by Atmel ( a major microcontroller manufacturer). Atmega328P has the following
components in it:
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.
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 thesystem 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, theyread 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.
5
21/04/2025
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.
Think of this as a signal translator. It converts signals in the USB level to a level that an Arduino UNO board
understands.
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.
6
21/04/2025
ARDUINO UNO
PIN LAYOUT
7
21/04/2025
•PWM Pins (3, 5, 6, 9, 10, 11): Support Pulse Width Modulation, ideal for applications like
controlling motors and dimming LEDs.
Use functions like pinMode(), digitalWrite(), and digitalRead() to interact with these pins.
•Serial Pins (RX/TX): Facilitate UART communication for serial data exchange.
8
21/04/2025
•SPI Pins: Share functionality with the ICSP header (MISO, MOSI, and SCK).
9
21/04/2025
ARDUINO SOFTWARE
The Arduino IDE (Integrated Development
Environment) is a software application
used to write, compile, and upload code to
Arduino boards. It provides a user-friendly
interface for programming microcontrollers
and controlling hardware connected to the
Arduino.
Download link:
https://www.arduino.cc/en/software/
Tutorial:
https://docs.arduino.cc/learn/starting-
guide/the-arduino-software-ide/
Programming Language
10
21/04/2025
ARDUINO
PROGRAM
STRUCTURE
Programs often begin with introductory comments that explain what the program is doing.
These comments come before the variable declarations. It is a good idea to begin every
program with comments like these so that when you return to your program later you’ll
know what it does.
Variables are usually declared at the beginning of a program immediately following the
introductory comments. All of the variables that you are using in your code should be
listed here, before the setup and loop sections.
11
21/04/2025
These brackets tell the Arduino software when the setup section begins and ends. Without
them, the software is lost and unable to compile your code. Think of these curly brackets as
additional punctuation that your code requires. Your code must be perfectly punctuated to
compile.
After the setup section runs, the loop section runs over and over until the LilyPad is
turned off or reprogrammed—hence the word loop. The statements that carry out the
main action of your program are in this section.
As with the setup section, statements in the loop section are placed between open and
closed curly brackets. These curly brackets tell the computer when the loop section
begins (with the opening curly bracket) and when it ends (with the closing curly bracket).
12
21/04/2025
SAMPLE CODE
REFERENCES
https://www.elprocus.com/different-types-of-arduino-boards/
https://www.hackerearth.com/blog/developers/a-tour-of-the-arduino-uno-board/
https://components101.com/microcontrollers/arduino-uno
https://docs.arduino.cc/learn/starting-guide/the-arduino-software-ide/
http://sewelectric.org/diy-projects/3-programming-your-lilypad/arduino-program-structure/
13