SlideShare a Scribd company logo
Arduino 101
Giorgio Aresu
Bologna, December 2, 2015
Who am I
void setup() {
Serial.begin(9600);
}
void intro() {
Serial.println("First name:_______________________________________Giorgio");
Serial.println("Last name:__________________________________________Aresu");
Serial.println("I am:__________________________________Computer Scientist");
Serial.println("Working in:_______________________________SCAI Consulting");
Serial.println(" ( '_')0*´¯`·_¸_·´¯`°Q('_' ) ");
Serial.println("Twitter:___________________________________@giorgio_aresu");
Serial.println("LinkedIn:___________________________________Giorgio Aresu");
Serial.println("Personal email:____________________giorgioaresu@gmail.com");
Serial.println("Work email:___giorgio.aresu@scai-consulting.grupposcai.it");
Serial.println("Interests:_________motorcycles,technology,electronics,IoT");
}
void loop() {
intro();
delay(1000);
}
What is it?
Open-source prototyping platform
Based on Atmel 8-, 16- or 32-bit AVR microcontrollers
Standard connectors to connect and stack shields
Pre-programmed with a bootloader that simplifies uploading of programs to the
on-chip flash memory
More straightforward by allowing the use of an ordinary computer as the
programmer.
What for
- Domotics
- Alarm systems, motion
detection
- Weather stations
- Wearables
- Sensor networks
- Robots and drones
- Retro-gaming, LED controllers,
etc.
Some use cases
RGB infinity mirror
http://www.instructables.com/id/Arduino-controlled-RGB-LED-Infinity-Mirror/
LEDmePlay
http://mithotronic.de/ledmeplay_games_overview.html
The Inebriator - Cocktail machine
http://www.theinebriator.com/
Flamethrowing jack-o’-lantern
http://arstechnica.com/information-technology/2013/05/11-arduino-projects-that-require-major-hacking-skills-or-a-bit-of-insanity/3/
Microcontroller or Microprocessor?
Microcontroller (MCU)
Contains a processor core, memory,
and programmable input/output
peripherals.
Designed for application-specific,
embedded applications (remote
controls, appliances, toys).
Cheaper, smaller, lower power
consumption (as low as nanowatts),
optimized for latency.
Microprocessor
Only contains a CPU, has no memory
and uses all pins as a bus.
Multipurpose programmable
processing unit.
Faster, more versatile, suitable for
complex tasks, optimized for
throughput.
Why Arduino?
1. Inexpensive
2. Cross-platform
3. Simple programming
environment
4. Open source and extensible
software
5. Open source and extensible
hardware
Uno Mega
Nano
Gemma
Pro Mini
Lots of models
and many more...
Connections and pins
Main connections
USB
5v regulated input
Vin
5-9v or 5-12v (depending on board)
unregulated input
IOREF
Board I/O voltage, Uno supplies 5v, Due
3.3v
GND
IOREF
RESET
3.3V
5V
GND
GND
Vin
USB
Vin
Pay attention to power limits on all pins,
you may damage your board!
RESET
I/O Pins
Digital I/O
Standard 1/0 levels
5 volts
Analog Input
10-bit ADC
0-5 volts adjusted via AREF
Can be used as Digital I/O
Digital
Analog
AREF
I/O Pins
Serial
Used as a console and to communicate
to other TTL devices
TX
RX
USB
Example:
- ESP8266 (WiFi module)
I/O Pins
External interrupts
Can be configured to trigger an interrupt
on a signal state change
Example:
- PIR (IR movement sensor)
PIN 2
PIN 3
I/O Pins
Pulse Width Modulation
8-bit PWM output, can simulate analog
output
Example:
- Light Dimmer
- Motor speed control
PIN 5
PIN 3
PIN 6
PIN 9
PIN 11
PIN 10
I/O Pins
SPI
Serial bus used to connect multiple
devices and to flash the MCU itself,
bypassing the bootloader
Single master, one or more slaves (one
SS line per slave)
Example:
- Barometric Pressure Sensor
- AD5206 (Digital Potentiometer)
- LCD/OLED Displays
- ICSP
SCK
MISO
MOSI
SS
ICSP
ICSP
I/O Pins
I2
C
Bus used to attach multiple peripherals
Slower than SPI but only requires 2 lines
and scales better with multiple devices
Example:
- EEPROM Modules
- TMP102 (Temperature sensor)
- LCD/OLED Displays
SDA
SCL
IDE
IDE - Official
➔ Simple and lightweight
➔ Cross-platform
IDE - Visual Micro
➔ Visual Studio plugin
➔ Intellisense and autocomplete
➔ Windows only
IDE - Scratch
➔ Alternative language
➔ Event driven programming
➔ Cross-platform
Base sketch structure
// Libraries
#include <SPI.h>
#include <SD.h>
// Global variables
File myFile;
// One time initialization function
void setup()
{
Serial.begin(9600);
Serial.print("Initializing SD card...");
// [...]
}
// Endless loop function
void loop()
{
// [...]
}
void setup()
initialize system
void loop()
contains all logic
Demo time!
Blink sketch - Software
void setup()
{
// initialize digital pin 13 as an output
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Blink sketch - Hardware
BT controlled appliance
#define RELAY 8
void setup()
{
// Open serial communications and wait for port to open
Serial.begin(9600);
// initialize digital pin as an output.
pinMode(RELAY, OUTPUT);
digitalWrite(RELAY, HIGH);
Serial.println("Up and running");
}
void loop()
{
while (!Serial.available()) {} // Wait for connection
int i = Serial.parseInt();
if (i == 2)
digitalWrite(RELAY, LOW);
else if (i == 1)
digitalWrite(RELAY, HIGH);
else if (i == 4)
digitalWrite(RELAY, !digitalRead(RELAY)); // Invert state
}
BT controlled appliance
https://github.com/GiorgioAresu/NeopixelTinyClock
LED Clock
Questions?
You can find software, documentation, forum, and
support the project at https://www.arduino.cc/
Giorgio Aresu
Bologna, December 2, 2015
Arduino 101

More Related Content

PPTX
Iot based smart irrigation system
PPTX
Introduction to arduino ppt main
PDF
Arduino Workshop Day 1 - Basic Arduino
PPTX
Green House Monitoring and Control System Using IoT
PPTX
Interrupt
PPTX
VLSI Design Methodologies
PDF
Smart Attendance System using Raspberry Pi
PPTX
Wi-Fi Esp8266 nodemcu
Iot based smart irrigation system
Introduction to arduino ppt main
Arduino Workshop Day 1 - Basic Arduino
Green House Monitoring and Control System Using IoT
Interrupt
VLSI Design Methodologies
Smart Attendance System using Raspberry Pi
Wi-Fi Esp8266 nodemcu

What's hot (20)

PPTX
Input Output - Computer Architecture
PPTX
Introduction to Arduino Hardware and Programming
PPTX
Introduction to Arduino and Hands on to Iot
PPTX
Iot based garbage monitoring system
PPTX
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
PPT
PPTX
Arduino
PDF
Embedded systems notes
PPT
Arduino presentation by_warishusain
PPTX
Sr Latch or Flip Flop
PPTX
Direct Memory Access
PPT
Arduino traffic lights
PPTX
All About VLSI In PPT
DOCX
ARM7-ARCHITECTURE
PDF
Questions & Answers related to home automation
PPTX
Smart Blind stick by using arduino uno and sensor
PPTX
Types of flip flops ppt
PDF
DPCO UNIT 2.pdf
Input Output - Computer Architecture
Introduction to Arduino Hardware and Programming
Introduction to Arduino and Hands on to Iot
Iot based garbage monitoring system
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino
Embedded systems notes
Arduino presentation by_warishusain
Sr Latch or Flip Flop
Direct Memory Access
Arduino traffic lights
All About VLSI In PPT
ARM7-ARCHITECTURE
Questions & Answers related to home automation
Smart Blind stick by using arduino uno and sensor
Types of flip flops ppt
DPCO UNIT 2.pdf
Ad

Viewers also liked (17)

PDF
Sensor de proximidad con el modulo
PDF
Intel Curie Presentation
PDF
Presentación taller arduino
ODP
Introduction to Arduino
DOCX
Manual basico de practicas con Arduino uno
PDF
Curso Arduino práctico 2014
PPT
Arduino
PDF
20 Magnificos proyectos para ARDUINO
PPT
Intro to Arduino
PDF
Presentación arduino conferencia
PDF
Workshop iniciacion arduino d2
PDF
ITT 18 Practicas Basicas de Arduino
PDF
Ejercicios de Arduino resueltos Grupo Sabika
PDF
Arduino Lecture 1 - Introducing the Arduino
DOCX
Arduino Full Tutorial
PDF
Libro de proyectos del kit oficial de Arduino en castellano completo - Arduin...
PDF
Introduction to Arduino Programming
Sensor de proximidad con el modulo
Intel Curie Presentation
Presentación taller arduino
Introduction to Arduino
Manual basico de practicas con Arduino uno
Curso Arduino práctico 2014
Arduino
20 Magnificos proyectos para ARDUINO
Intro to Arduino
Presentación arduino conferencia
Workshop iniciacion arduino d2
ITT 18 Practicas Basicas de Arduino
Ejercicios de Arduino resueltos Grupo Sabika
Arduino Lecture 1 - Introducing the Arduino
Arduino Full Tutorial
Libro de proyectos del kit oficial de Arduino en castellano completo - Arduin...
Introduction to Arduino Programming
Ad

Similar to Arduino 101 (20)

PDF
Introduction of Arduino Uno
PPT
Arduino Platform with C programming.
PDF
Arduino - Learning.pdf
PDF
Mechatronics material . Mechanical engineering
PDF
Introduction to Arduino
PPTX
What is Arduino
PDF
Oop 2014 embedded systems with open source hardware v2
PDF
IOTC08 The Arduino Platform
PDF
Arduino learning
PDF
What is arduino
PPTX
Introduction To Arduino-converted for s.pptx
PDF
introductiontoarduino-111120102058-phpapp02.pdf
PPTX
Basics of open source embedded development board (
PPTX
Basics of open source embedded development board (
PPTX
Introduction to the Arduino
PDF
Making things sense - Day 1 (May 2011)
PPTX
Arduino Programming - Brief Introduction
PPSX
Arduino by yogesh t s'
PDF
Arduino A Technical Reference A Handbook For Technicians Engineers And Makers...
Introduction of Arduino Uno
Arduino Platform with C programming.
Arduino - Learning.pdf
Mechatronics material . Mechanical engineering
Introduction to Arduino
What is Arduino
Oop 2014 embedded systems with open source hardware v2
IOTC08 The Arduino Platform
Arduino learning
What is arduino
Introduction To Arduino-converted for s.pptx
introductiontoarduino-111120102058-phpapp02.pdf
Basics of open source embedded development board (
Basics of open source embedded development board (
Introduction to the Arduino
Making things sense - Day 1 (May 2011)
Arduino Programming - Brief Introduction
Arduino by yogesh t s'
Arduino A Technical Reference A Handbook For Technicians Engineers And Makers...

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Machine learning based COVID-19 study performance prediction
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
cuic standard and advanced reporting.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
KodekX | Application Modernization Development
Digital-Transformation-Roadmap-for-Companies.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Encapsulation_ Review paper, used for researhc scholars
Building Integrated photovoltaic BIPV_UPV.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Machine learning based COVID-19 study performance prediction
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
cuic standard and advanced reporting.pdf
The AUB Centre for AI in Media Proposal.docx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
NewMind AI Monthly Chronicles - July 2025
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...

Arduino 101

  • 2. Who am I void setup() { Serial.begin(9600); } void intro() { Serial.println("First name:_______________________________________Giorgio"); Serial.println("Last name:__________________________________________Aresu"); Serial.println("I am:__________________________________Computer Scientist"); Serial.println("Working in:_______________________________SCAI Consulting"); Serial.println(" ( '_')0*´¯`·_¸_·´¯`°Q('_' ) "); Serial.println("Twitter:___________________________________@giorgio_aresu"); Serial.println("LinkedIn:___________________________________Giorgio Aresu"); Serial.println("Personal email:____________________giorgioaresu@gmail.com"); Serial.println("Work email:___giorgio.aresu@scai-consulting.grupposcai.it"); Serial.println("Interests:_________motorcycles,technology,electronics,IoT"); } void loop() { intro(); delay(1000); }
  • 3. What is it? Open-source prototyping platform Based on Atmel 8-, 16- or 32-bit AVR microcontrollers Standard connectors to connect and stack shields Pre-programmed with a bootloader that simplifies uploading of programs to the on-chip flash memory More straightforward by allowing the use of an ordinary computer as the programmer.
  • 4. What for - Domotics - Alarm systems, motion detection - Weather stations - Wearables - Sensor networks - Robots and drones - Retro-gaming, LED controllers, etc. Some use cases
  • 7. The Inebriator - Cocktail machine http://www.theinebriator.com/
  • 9. Microcontroller or Microprocessor? Microcontroller (MCU) Contains a processor core, memory, and programmable input/output peripherals. Designed for application-specific, embedded applications (remote controls, appliances, toys). Cheaper, smaller, lower power consumption (as low as nanowatts), optimized for latency. Microprocessor Only contains a CPU, has no memory and uses all pins as a bus. Multipurpose programmable processing unit. Faster, more versatile, suitable for complex tasks, optimized for throughput.
  • 10. Why Arduino? 1. Inexpensive 2. Cross-platform 3. Simple programming environment 4. Open source and extensible software 5. Open source and extensible hardware
  • 11. Uno Mega Nano Gemma Pro Mini Lots of models and many more...
  • 13. Main connections USB 5v regulated input Vin 5-9v or 5-12v (depending on board) unregulated input IOREF Board I/O voltage, Uno supplies 5v, Due 3.3v GND IOREF RESET 3.3V 5V GND GND Vin USB Vin Pay attention to power limits on all pins, you may damage your board! RESET
  • 14. I/O Pins Digital I/O Standard 1/0 levels 5 volts Analog Input 10-bit ADC 0-5 volts adjusted via AREF Can be used as Digital I/O Digital Analog AREF
  • 15. I/O Pins Serial Used as a console and to communicate to other TTL devices TX RX USB Example: - ESP8266 (WiFi module)
  • 16. I/O Pins External interrupts Can be configured to trigger an interrupt on a signal state change Example: - PIR (IR movement sensor) PIN 2 PIN 3
  • 17. I/O Pins Pulse Width Modulation 8-bit PWM output, can simulate analog output Example: - Light Dimmer - Motor speed control PIN 5 PIN 3 PIN 6 PIN 9 PIN 11 PIN 10
  • 18. I/O Pins SPI Serial bus used to connect multiple devices and to flash the MCU itself, bypassing the bootloader Single master, one or more slaves (one SS line per slave) Example: - Barometric Pressure Sensor - AD5206 (Digital Potentiometer) - LCD/OLED Displays - ICSP SCK MISO MOSI SS ICSP ICSP
  • 19. I/O Pins I2 C Bus used to attach multiple peripherals Slower than SPI but only requires 2 lines and scales better with multiple devices Example: - EEPROM Modules - TMP102 (Temperature sensor) - LCD/OLED Displays SDA SCL
  • 20. IDE
  • 21. IDE - Official ➔ Simple and lightweight ➔ Cross-platform
  • 22. IDE - Visual Micro ➔ Visual Studio plugin ➔ Intellisense and autocomplete ➔ Windows only
  • 23. IDE - Scratch ➔ Alternative language ➔ Event driven programming ➔ Cross-platform
  • 24. Base sketch structure // Libraries #include <SPI.h> #include <SD.h> // Global variables File myFile; // One time initialization function void setup() { Serial.begin(9600); Serial.print("Initializing SD card..."); // [...] } // Endless loop function void loop() { // [...] } void setup() initialize system void loop() contains all logic
  • 26. Blink sketch - Software void setup() { // initialize digital pin 13 as an output pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
  • 27. Blink sketch - Hardware
  • 28. BT controlled appliance #define RELAY 8 void setup() { // Open serial communications and wait for port to open Serial.begin(9600); // initialize digital pin as an output. pinMode(RELAY, OUTPUT); digitalWrite(RELAY, HIGH); Serial.println("Up and running"); } void loop() { while (!Serial.available()) {} // Wait for connection int i = Serial.parseInt(); if (i == 2) digitalWrite(RELAY, LOW); else if (i == 1) digitalWrite(RELAY, HIGH); else if (i == 4) digitalWrite(RELAY, !digitalRead(RELAY)); // Invert state }
  • 31. Questions? You can find software, documentation, forum, and support the project at https://www.arduino.cc/ Giorgio Aresu Bologna, December 2, 2015