Introduction to Arduino

Slides:



Advertisements
Similar presentations
Lab7: Introduction to Arduino
Advertisements

Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
SPI Serial Peripheral Interface. SPI Serial Peripheral Interface is communication between two devices, one bit at a time sequential one bit at time over.
Introduction.
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Khaled A. Al-Utaibi  What is Arduino?  Arduino Boards  Arduino Shields  Arduino Uno Hardware.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Embedded Programming and Robotics
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Arduino John Marcoux Christopher Lesch Thomas Dodge Unless otherwise noted, all information and pictures came from:
2.0 EMBEDDED CONTROLLER Engr. Hj. Mohamad Fauzi bin Zakaria Department of Mechatronics and Robotics Engineering Faculty of Electrical and Electronic Engineering.
Ballooning Bundle. What is a Microcontroller? Small computer with a processor core, memory and programmable input/output Continuously repeats software.
Arduino Josh Villbrandt February 4, Digital Circuits Analog versus digital – What’s the difference? – How to represent an analog signal in a computer?
LVTech / / IRC #makelv on freenode.net Jared Steckel AN INTRODUCTION.
Daniel Pickem and Rowland O’Flaherty 12/04/2012 Mechatronics (ME 6405) Student Lecture On Arduinos *Some slides courtesy of Eoin Brazil
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Arduino 101 Instructors: Ted Markson / Jim Sweeney.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
Getting Started With the Arduino Uno
智慧電子應用設計導論(1/3) Arduino MEGA 2560
Microcontrollers, Microcomputers, and Microprocessors
Intro to Arduino Basic Arduino John Wolf (WolfDenElectronics.com)
Introducing the Arduino Uno Presented by Dave Mawdsley, DACS Member, Linux SIG Member (wiring, programming and running a cute traffic light simulation)
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
CORDLESS MOUSE FEATURES BY TV REMOTE USING PIC MICROCONTROLLER
Application Case Study Christmas Lights Controller
Having fun with code, using Arduino in a middle school CS classroom
Arduino.
Getting Started: Building & Programming
Welcome to Arduino A Microcontroller.
By Rick Darby Sponsors: Geekspace Gwinnett The WorkSpot
Obstacle avoiding robot { pixel }
Scrolling LCD using Arduino.
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
Val Manes Department of Math & Computer Science
Automatic human detector garbage can.
Arduino and Automotive Embedded Systems
UTA010 : Engineering Design – II
An Arduino Workshop A Microcontroller.
Arduino Development for Beginners
UCD ElecSoc Robotics Club 2017/2018
Arduino Part 1 Topics: Microcontrollers Programming Basics
‘SONAR’ using Arduino & ultrasonic distance sensor
The Arduino Microcontroller: Atmel AVR Atmega 328
Arduino and Design of Embedded Applications
Introduction to Arduinos
Week 5: Microcontrollers
Roller Coaster Design Project
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
Introduction to Microprocessors and Microcontrollers
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Journey: Introduction to Embedded Systems
Welcome to Digital Electronics using the Arduino Board
Introducing the Arduino Uno
CSCI1600: Embedded and Real Time Software
Arduino : Introduction & Programming
CSCI1600: Embedded and Real Time Software
Manual Robotics ..
Aeroponic Engineering and Vertical Farming
Arduino Uno circuit basics
Arduino Board.
Arduino म्हणजे काय?.
Lecture 8: Arduino 20 March 2019.
Introduction to Arduinos
Introduction to arduino
Presented By,  Mamata Yadav (BE Elex & Comm.) Vice R&D Coordinator(HW), PCRT  Payal Shah (BE Elex & Comm.)  Ananta Das (BE Elex & Comm.) R&D Team,PCRT.
Presentation transcript:

Introduction to Arduino

Note: Most Arduino boards use the Atmel 8-bit AVR microcontroller. What is Arduino? At the heart of the Arduino is the microcontroller. A microcontroller is a standalone, singlechip integrated circuit that contains a CPU, read-only memory, random access memory and various I/O busses. The Arduino UNO R3 which we will be using uses the ATmega328 chip. Specs are: However do not be too concerned if you do not understand all those specifications because we will be interacting with the microcontroller using the interface that the Arduino board provides us. It is good to know these specifications as you begin to develop more complex applications because they do put limits on what we can do. Flash Memory 32 KB (ATmega328P) of which 0.5 KB used by bootloader SRAM 2 KB (ATmega328P) EEPROM 1 KB (ATmega328P) Clock Speed 16 MHz EEPROM: Electrically Erasable Programmable Read-Only Memory. Non-volatile memory. Can be erased and reprogrammed using a pulsed voltage

What is Arduino? The Arduino is an open source hardware and software platform that is incredibly powerful yet easy to use. You can look at and download the code from any of the Arduino repositories on GitHub here: https://github.com/arduino This platform has captured the imagination of electronic enthusiasts and the maker community everywhere. It enables people to inexpensively experiment with electronic prototypes and see their projects come to life. Projects can range from simply making an LED blink or recording the temperature to controlling 3D printers or making robots. While there are numerous models of the Arduino, in this course we will primarily be using the very popular Arduino UNO R3 board.

Arduino Uno's R3 board layout DC supply Input: The DC supply input can be used with an AC-to-DC power adapter or a battery. The power source can be connected using a 2.1 mm centerpositive plug. The Arduino Uno operates at 5 volts but can have a maximum input of 20 volts; however, it is recommended to not use more than 12V. Voltage Regulator: The Arduino uses a linear regulator to control the voltage going into the board. USB Port: The USB port can be used to power and program the board. RESET button: This button, when pressed, will reset the board. Alternating current (AC) is an electric current which periodically reverses direction, in contrast to direct current (DC) which flows only in one direction. In direct current (DC), the electric charge (current) only flows in one direction

ICSP for USB: The in-circuit serial programming pins are used to flash the firmware on the USB interface chip. ICSP for ATmega328: The in-circuit serial programming pins are used to flash the firmware on the ATmega microcontroller. ATmega328: The microcontroller for the Arduino Uno board.

Digital and PWM connectors: These pins, labeled 0 to 13, can be used as either a digital input or output pins. The pins labeled with the tilde (~) can also be used for Pulse-Width Modulation (PWM) output. The Digital/PWM/Analog in/Power/Reset connectors are collectively known as the pin headers. The pins in these headers allow the Arduino to communicate with external sensors and other devices. Power and External Reset: These pins in this header, provide ground and power for external devices and sensors from the Arduino. The Arduino can also be powered through these pins. There is also a reset pin that can be used to reset the Arduino. Analog In Connectors: The pins, labeled A0 to A5, can be used for analog input. These pins can be used to read the output from analog sensors.

Arduino shields An Arduino shield is a modular circuit board that plugs directly into the pin headers of the Arduino board. These shields will add extra functionality to the Arduino board. If we are looking to connect to the internet, do speech recognition, control DC motors or add other functionality to the Arduino, there is probably a shield that can help us. While you don’t have to use shields, they do make adding extra functionality to our Arduino boards very easy.

Arduino looks with two shields attached: A shield fits on top of the Arduino by plugging directly into the pin headers. We can also stack one shield on top of another if they do not use the same resources. Here is how an

Arduino pin There is a total of 31 pins in the Arduino Uno pin headers. Most of these pins can be configured to perform different functions.

Digital pins Used the most when connecting external sensors. These pins can be configured for either input or output. These pins default to an input state The digital pins will have one of two values: HIGH (1), which is 5V, or LOW (0), which is 0V.

Analog input pins The Arduino Uno contains a built-in Analog-To-Digital (ADC) converter with six channels, which gives us six analog input pins. The ADC converts an analog signal into a digital value. While the digital pins have two values, either high or low, the analog input pins have values from 0 to 1023 relative to the reference value of the Arduino. The Arduino Uno has a reference value of 5V. Used to read analog sensors such as rangefinders and temperature sensors. The six analog pins can also be configured as digital pins if we run out of digital pins in our project.

PWM pins Where the analog input pins are designed to read analog sensors (input), the PWM pins are designed for output. PWM is a technique for obtaining analog results with digital output. Since a digital output can be either on or off, to obtain the analog output the digital output is switch between HIGH and LOW rapidly. The percentage of the time that the signal is high is called the duty cycle.

Duty cycle We have the ability to set the frequency of how fast the signal can switch between HIGH and LOW. This frequency is measured in Hertz and sets how many times the signal can switch per second. For example, if we set the frequency to 500 Hz, that would mean that the signal could switch 500 times a second. This will be come clearer as we use the pins.

Power pins VIN: This pin is used when we power the Arduino board using an external power supply. GND: These are the ground pins. 5V: This is 5V out and is used to power most sensors. 3.3V: This is 3.3V out and can be used to power sensors that are compatible with 3.3V. Reset: This pin can be used to reset the Arduino board by an external source. ioref: This is the reference voltage for the board. For the Arduino, this will be 5V. A list of some compatible 3.3V sensors can be found here: https://www.dfrobot.com/wiki/index. php/3. 3V_ Compatible_ Device_ List

Serial pins Used for serial communication. The RX (digital pin 0) is used to receive. TX (digital pin 1) is used to transmit. Serial communications work on binary (1’s and 0’s). Provided for legacy reasons primarily.

SPI pins The Serial Peripheral Interface (SPI) pins are used for a synchronous serial data protocol that is used by microcontrollers for communicating with peripheral devices. This protocol always has one master with one or more slave devices. MISO: The Master in Slave out pin is used to send data from the slave to the master device. MOSI: The Master out Slave in the pin is used to send data from the master to the slave device. SCK: The serial clock synchronizes the data transmission and is generated by the master. SS: The slave select pin tells the slave to go active or to go to sleep. This is used to select which slave device should receive the transmission from the master. Master is almost always your microcontroller Used for small peripherals such as shift registers, sensors, and SD cards

Installing the IDE The first step in programming an Arduino board install the Arduino IDE (integrated development environment). Linux/Raspberry PI This program checks code and loads it onto the Arduino. Install the latest version of Arduino IDE using apt: sudo apt-get update && sudo apt-get upgrade sudo apt-get install Arduino Windows Download from: https://www.arduino.cc/en/Main/Software

Programming in for Arduino The setup function is the first to execute when the program is executed, and this function is called only once. Used to initialize the pin modes and start serial communication. This function has to be included even if there are no statements to execute. The Arduino programming language is based on a very simple hardware programming language called processing, which is similar to the C language. You create sketches which contain your code After the sketch is written in the Arduino IDE, it should be uploaded on the Arduino board for execution. Basic code structure void setup( ) { statements; } void loop( ) statement; The execution block runs after setup and hosts statements like reading inputs, triggering outputs, checking conditions etc.. As the name suggests, the loop( ) function executes the set of statements (enclosed in curly braces) repeatedly.

Example program LED fade-in and fade-out int led = 9; // The digital pin to which the LED is connected int brightness = 0; // Brightness of LED is initially set to 0 int fade = 5; // By how many points the LED should fade void setup() { pinMode(led, OUTPUT); //pin 10 is set as output pin } void loop() // The loop function runs again and again analogWrite(led, brightness); // set the brightness of LED brightness = brightness + fade; //Increase the brightness of LED by 5 points if (brightness <= 0 || brightness >= 255) // check the level of brightness fade = -fade; delay(30); // Wait for 30 milliseconds LED fade-in and fade-out