INTRODUCTION
THE ARDUINO
This presentation made by thingerbit’s pdf
What is a
Microcontroller?
Computer on a single integrated chip
● Processor (CPU)
● Memory (RAM / ROM / Flash)
● I/O ports (USB, I2C, SPI, ADC)
Common microcontroller families:
● Intel: 4004, 8008, etc.
● Atmel: AT and AVR
● Microchip: PIC
● ARM: (multiple manufacturers)
Used in:
● Cellphones ● Cars
● Toys ● Cameras
● Household appliances
The ATmega328P
Microcontroller
AVR 8-bit RISC architecture
Available in DIP package Up
to 20 MHz clock
32kB flash memory
1 kB SRAM
23 programmable
I/O channels
Six 10-bit ADC inputs
Three timers/counters
Six PWM outputs
What is Arduino Not?
❏ It is not a chip (IC)
❏ It is not a board (PCB)
❏ It is not a company or a manufacturer
❏ It is not a programming language
❏ It is not a computer architecture
(although it involves all of these things)
So what is Arduino?
It’s a movement, not a microcontroller:
Founded by Massimo Banzi and David Cuartielles in 2005
Based on “Wiring Platform”, which dates to 2003
Open-source hardware platform
Open source development environment
● Easy-to learn language and libraries (based on Wiring
language)
● Integrated development environment (based on Processing
programming environment)
● Available for Windows / Mac / Linux
The Many Flavors
of Arduino
● Arduino Uno
● Arduino Leonardo
● Arduino LilyPad
● Arduino Mega
● Arduino Nano
● Arduino Mini
● Arduino Mini Pro
● Arduino BT
ARDUI NO UNO R3
Specifications
Clock Speed 16 MHz
DC Current for 3.3V Pin 50 mA
DC Current per I/O Pin 20 mA
SRAM 2 KB
Flash Memory 32 KB
I/O Pins Digital - 14 Analog - 6
Input Voltage Recommended 7-12V
Limit 6-20 V
Microcontroller ATmega328P
ARDUI NO MEGA
Specifications
Clock Speed 16 MHz
DC Current for 3.3V Pin 50 mA
DC Current per I/O Pin 20 mA
SRAM 8 KB
Flash Memory 256 KB
I/O Pins Digital - 54 Analog - 16
Input Voltage Recommended 7-12V
Limit 6-20 V
Microcontroller ATmega2560
OTHER ARDUII NO BOARDS
Arduino-like
Systems
● BBC Micro:bit
(ARM)
● NodeMCU (ARM)
● Teensy(ARM)
● BeagleBoard (Linux)
● STM32 Discovery
● Magicblocks
Arduino Add-ons (Shields)
TFT Touch Screen
Data logger
Motor/Servo shield
Ethernet shield Audio
wave shield
Cellular/GSM shield
WiFi shield
Proto-shield
many more…...
Where to Get an Arduino Board
Purchase from online
vendor (available
Sri Lanka)
www.thingerbits.lk
Getting to know the Arduino
◆ Digital I/O ports is used to connect to other components or
modules, to receive an input signal, or to send a control signal.
Usually, we name it by adding a "D" in front of the number,
such as D13.
◆ USB interface is used to provide power, upload code or
communicate with PC.
◆ LED L is connected to digital I/O port 13 (D13).
◆ LED TX, RX is used to indicate the state of the serial
communication.
◆ DC interface is connected DC power to provide power for the
board.
◆ Power ports can provide power for electronic components and
modules.
◆ Analog I/O ports can be used to measure analog signals.
◆ LED ON is used to indicate the power state.
ARDUINO IDE
OFFLINE IDE ONLINE WEB IDE
Select your Board
You have to select the arduino board
type in your IDE. I am using an
Arduino Uno board. To choose the
board, find Tools on menu bar.
Choose the option “Board” – and
select your correct arduino board
Select Serial Port
The port number is assigned while
installing the hardware driver of board.
You may refer the tutorial on Installing
Arduino on Windows to know how to
find the port number of board. You can
find the port number by accessing device
manager on Windows. See the section
Port (COM & LPT) and look for an open
port named “Arduino Uno (COMxx)“. If
you are using a different board, you will
find a name accordingly. What matters is
the xx in COMxx part. In my case, its
COM5. So my port number is
5. To select the right port, go to
Tools–> Serial Port and select the
port number.
Elements of the Arduino IDE
• Text editor
–syntax and keyword
coloring
– automatic indentation
– programming
shortcuts
• Compiler
• Hardware Interface
– Uploading programs
– Communicating with
Arduino via USB
Using the Arduino IDE
1. Verify: Compiles and approves your code. It will catch errors in
syntax (like missing semicolons or parentheses).
2. Upload: Sends your code to the 101 board.
3. New: This buttons opens up a new code window tab.
4. Open: This button will let you open up an existing sketch.
5. Save: This saves the currently active sketch.
6. Serial Monitor: This will open a window that displays any serial
information your 101 board is transmitting. It is very useful for
debugging.
7. Sketch Name: This shows the name of the sketch you are currently
working on.
8. Code Area: This is the area where you compose the code for your
sketch.
9. Message Area: This is where the IDE tells you if there were any
errors in your code.
10. Text Console: The text console shows complete error messages.
When debugging, the text console is very useful.
11. Board and Serial Port: Shows you what board and the serial port
selections.
Activity 1: LED Blink
Load the “Blink” example (File>Examples>Basics>Blink)
Compile, then upload the program
Congratulations! you are now blinkers!
Now connect your own LED
Resistor is needed to limit current
Resistor and LED may be
interchanged
(but polarity of LED is
important)
Pin 13 is special: has built-in
resistor and LED
Change program and upload
Experimenting
Change the blink rate
– how fast can the LED blink (before you can no longer perceive the blinking?)
How would you make the LED dimmer?
– (...without changing the resistor?)
Summary
Introduction to Arduino
❖ About of Arduino
❖ First Use
❖ History of Arduino ❖ Blink Program Code
❖ Arduino Board ❖ Pinout Diagram - Arduino Uno
❖ Arduino Software
➢ How to Use Online Arduino IDE
➢ Install Arduino Offline IDE - Windows
➢ Download Arduino IDE
➢ Arduino Online IDE
What’s Next?
Chapter 1 - LED Blink
● Project 1.1 - Control LED by Manual Button ● Project 1.2 Control LED by Arduino
● Circuit Knowledge ● Circuit knowledge
1. Power supply 1. Analog signal & Digital signal
2. Voltage 2. Low level & high level
3. Current (I) ● Code knowledge
4. Resistor 1. Comments
● Component knowledge 2. Data type
1. Jumper 3. Constant
2. Breadboard 4. Variable
3. Push button 5. Function
4. LED ● Circuit
● Circuit ● Sketch