KEMBAR78
Introduction to Arduino Webinar | PPTX
Frank Fourlas
Introduction to Arduino
What you are going to learn
• What is an Arduino and why learn to use it
• Hardware Capabilities
• Basics of Digital & Analog I/O
• Write basic C++ code and perform simple tasks
• Work from examples and projects
What is an Arduino
“Arduino is an open-source hardware and software company
originating from Italy. They design microcontrollers based
(mostly) on the ATmega family of microprocessors by Atmel.”
A Microcontroller (MCU)
• “A small computer on a single metal-oxide-semiconductor
(MOS) integrated circuit (IC) chip” –Wikipedia
• One or more CPUs
• Memory (ProgMem, RAM)
• Input/Output Peripherals
• Used in automation, IoT, appliances, remote control, etc
Open-Source
• Hardware: Creative Commons
• Publicly available schematics
• Permission to manufacture custom boards
• Cheap 3rd party compatibles
• Software: GNU General Public License
• Free/distributed
• Huge community (Help/Patching/Expanding)
• Variety of processors (AVR, ARM, ESP)
Based on ATmega Microprocessors
• Pin Breakout
• Voltage Regulator
• USB – Serial
Converter
• Clock
Why Arduino?
• Plug and Play
• Huge, expanding community
• Troubleshooting and help
• (Too) Many modules/sensors/expansions available
• Not too simple, not too advanced
• Cheap
• Easy to learn
• Baseline for more
Some Examples
Rocket v.2 mainboard
Sound reactive lighting
Creality Ender3 mainboard
PS1 modchip using PsNee
• Different Arduino Boards
• A map of the Arduino UNO
• Basics of Digital & Analog I/O
Hardware Capabilities
Arduino Boards
• Arduino UNO (ATmega328P)
• Arduino Nano (ATmega328)
• Arduino Micro (ATmega32U4)
20€ - 5€
15€ - 0.9€
Digital I/O
• Output:
• Turn a pin On or Off
• Supply 5V or connect to Ground
• Turn on a light
• Supply a positive or negative signal
• Input:
• Read a digital bit
• Detect High or Low voltage
• Receive a positive or negative signal
Analog I/O
• Output:
• Supply a variable voltage source (0-5V)
• Control the speed of a motor/brightness of light
• 256 different states
• Input:
• Read an analog signal
• Differentiate between different voltage levels
• 1024 different levels
USB
USB-Serial
ATmega328P
Microprocessor
7-12V
Voltage
Regulator
(5V
Logic)
Analog Input
Digital I/O
Analog Output (~PWM)
• The Arduino IDE
• Bare Minimum Program
• Input / Output
• Finding Resources Online
Writing Software
The Arduino IDE
• Download: https://www.arduino.cc/en/software
The Text Editor
Output Console
Serial Monitor
Compile/Upload/New/Open/Save
Fix your settings
• Make sure to select the correct Board and Port from the Tools
menu
Bare Minimum
• void setup()
• void loop()
Blink
• pinMode(pin, bool mode)
• digitalWrite(pin, bool state)
• delay(int milliseconds)
Button
• bool digitalRead(pin)
Potentiometer
• analogRead(AnalogPin)
• analogWrite(Pin, int level)
Communication
• Serial
• begin(int baudrate)
• print/println(String text)
• write(byte data)
• int available()
• char read()
The Serial Monitor
• Online Sources
• Reading Pinouts
• Reading Datasheets
• Libraries
Finding Resources
Online Sources
• Arduino IDE → File → Examples
• For all built-in libraries
• Every downloaded library adds examples
• arduino.cc → Documentation
• Tutorials (w/ schematics and sample code)
• Reference (Language and built-in library documentation)
• Adafruit
• Modules/Sensors/Boards
• Libraries for EVERYTHING (most 3rd party modules/sensors are remakes)
• Tutorials (w/ wiring instructions, schematics and sample code)
• StackOverflow
• Google
Connecting Communicating Devices
“Pinout of ARDUINO Board and ATMega328PU”
by pighixxx is licensed under Creative
Commons Attribution-Share Alike 4.0 International
Connecting Communicating Devices
GPS Modules
communicate with UART
A microSD card reader
that communicates with
SPI
A 10-DOF Sensor from Adafruit that uses
I2C
Arduino IDE Library Manager
Using Libraries
The PING exercise
• Use the HC-SR04 Ultrasonic Sensor to dim an LED
depending on its distance from a wall. Print the distance
in the Serial Monitor.
• Applying HIGH signal to “Trig” for 10μs produces an
ultrasonic pulse
• Then, “Echo” is turned HIGH for the same duration it took
the pulse to travel back and forth
• Help:
• Sound travels in a speed of 0.0343cm/μs
• pulseIn(pin, HIGH/LOW) blocks until pin turns HIGH/LOW, waits
until it switches to the other state, returns the microseconds it
stayed HIGH/LOW
• delayMicroseconds(int micros) is used for precision delay
• ECHO needs to be normalized to LOW for 2μs before PINGing
The Servo Exercise
• Use a potentiometer to control the rotation of a Servo motor
• Help:
• Connect the potentiometer like we did on the Analog example
• A Servo motor uses 3 wires, 2 for power and a signal
• Use the Servo library, find examples inside the IDE and documentation
on arduino.cc (It is a native library)
One step further
• Connecting to the Internet (IoT)
• WiFi library -> TCP and UDP protocols
• Acting as a webserver / Online communication
• Connecting to Bluetooth
• ArduinoBLE library
• Advanced Lighting
• WS2812B LEDs
• NeoPixel library / FastLED library
• Programming different processors
• ATtiny84/ATtiny85
• ESP8266/ESP32
• Interacting with other languages (Python/Processing)

Introduction to Arduino Webinar

  • 1.
  • 2.
    What you aregoing to learn • What is an Arduino and why learn to use it • Hardware Capabilities • Basics of Digital & Analog I/O • Write basic C++ code and perform simple tasks • Work from examples and projects
  • 3.
    What is anArduino “Arduino is an open-source hardware and software company originating from Italy. They design microcontrollers based (mostly) on the ATmega family of microprocessors by Atmel.”
  • 4.
    A Microcontroller (MCU) •“A small computer on a single metal-oxide-semiconductor (MOS) integrated circuit (IC) chip” –Wikipedia • One or more CPUs • Memory (ProgMem, RAM) • Input/Output Peripherals • Used in automation, IoT, appliances, remote control, etc
  • 5.
    Open-Source • Hardware: CreativeCommons • Publicly available schematics • Permission to manufacture custom boards • Cheap 3rd party compatibles • Software: GNU General Public License • Free/distributed • Huge community (Help/Patching/Expanding) • Variety of processors (AVR, ARM, ESP)
  • 6.
    Based on ATmegaMicroprocessors • Pin Breakout • Voltage Regulator • USB – Serial Converter • Clock
  • 7.
    Why Arduino? • Plugand Play • Huge, expanding community • Troubleshooting and help • (Too) Many modules/sensors/expansions available • Not too simple, not too advanced • Cheap • Easy to learn • Baseline for more
  • 8.
    Some Examples Rocket v.2mainboard Sound reactive lighting Creality Ender3 mainboard PS1 modchip using PsNee
  • 9.
    • Different ArduinoBoards • A map of the Arduino UNO • Basics of Digital & Analog I/O Hardware Capabilities
  • 10.
    Arduino Boards • ArduinoUNO (ATmega328P) • Arduino Nano (ATmega328) • Arduino Micro (ATmega32U4) 20€ - 5€ 15€ - 0.9€
  • 11.
    Digital I/O • Output: •Turn a pin On or Off • Supply 5V or connect to Ground • Turn on a light • Supply a positive or negative signal • Input: • Read a digital bit • Detect High or Low voltage • Receive a positive or negative signal
  • 12.
    Analog I/O • Output: •Supply a variable voltage source (0-5V) • Control the speed of a motor/brightness of light • 256 different states • Input: • Read an analog signal • Differentiate between different voltage levels • 1024 different levels
  • 13.
  • 14.
    • The ArduinoIDE • Bare Minimum Program • Input / Output • Finding Resources Online Writing Software
  • 15.
    The Arduino IDE •Download: https://www.arduino.cc/en/software The Text Editor Output Console Serial Monitor Compile/Upload/New/Open/Save
  • 16.
    Fix your settings •Make sure to select the correct Board and Port from the Tools menu
  • 17.
    Bare Minimum • voidsetup() • void loop()
  • 18.
    Blink • pinMode(pin, boolmode) • digitalWrite(pin, bool state) • delay(int milliseconds)
  • 19.
  • 20.
  • 21.
    Communication • Serial • begin(intbaudrate) • print/println(String text) • write(byte data) • int available() • char read()
  • 22.
  • 23.
    • Online Sources •Reading Pinouts • Reading Datasheets • Libraries Finding Resources
  • 24.
    Online Sources • ArduinoIDE → File → Examples • For all built-in libraries • Every downloaded library adds examples • arduino.cc → Documentation • Tutorials (w/ schematics and sample code) • Reference (Language and built-in library documentation) • Adafruit • Modules/Sensors/Boards • Libraries for EVERYTHING (most 3rd party modules/sensors are remakes) • Tutorials (w/ wiring instructions, schematics and sample code) • StackOverflow • Google
  • 25.
    Connecting Communicating Devices “Pinoutof ARDUINO Board and ATMega328PU” by pighixxx is licensed under Creative Commons Attribution-Share Alike 4.0 International
  • 26.
    Connecting Communicating Devices GPSModules communicate with UART A microSD card reader that communicates with SPI A 10-DOF Sensor from Adafruit that uses I2C
  • 27.
  • 28.
  • 29.
    The PING exercise •Use the HC-SR04 Ultrasonic Sensor to dim an LED depending on its distance from a wall. Print the distance in the Serial Monitor. • Applying HIGH signal to “Trig” for 10μs produces an ultrasonic pulse • Then, “Echo” is turned HIGH for the same duration it took the pulse to travel back and forth • Help: • Sound travels in a speed of 0.0343cm/μs • pulseIn(pin, HIGH/LOW) blocks until pin turns HIGH/LOW, waits until it switches to the other state, returns the microseconds it stayed HIGH/LOW • delayMicroseconds(int micros) is used for precision delay • ECHO needs to be normalized to LOW for 2μs before PINGing
  • 30.
    The Servo Exercise •Use a potentiometer to control the rotation of a Servo motor • Help: • Connect the potentiometer like we did on the Analog example • A Servo motor uses 3 wires, 2 for power and a signal • Use the Servo library, find examples inside the IDE and documentation on arduino.cc (It is a native library)
  • 31.
    One step further •Connecting to the Internet (IoT) • WiFi library -> TCP and UDP protocols • Acting as a webserver / Online communication • Connecting to Bluetooth • ArduinoBLE library • Advanced Lighting • WS2812B LEDs • NeoPixel library / FastLED library • Programming different processors • ATtiny84/ATtiny85 • ESP8266/ESP32 • Interacting with other languages (Python/Processing)

Editor's Notes

  • #19 Blink an LED with 1s delay https://www.tinkercad.com/things/2vCd9HYoelK
  • #20 Turn on an LED. When button pressed, turn off for 2s. Strobe LED while button pressed. When button pressed, strobe for 2s. https://www.tinkercad.com/things/2vCd9HYoelK
  • #21 Control a motors speed using a potentiometer.
  • #22 Get the distance from an object using a PING sensor and Serial communication. Control an LED from your computer.