Introduction to Arduinos

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 6 Digital Inputs
Advertisements

EMS1EP Lecture 8 Pulse Width Modulation (PWM)
EMS1EP Lecture 9 Analog to Digital Conversion (ADC) Dr. Robert Ross.
Lab7: Introduction to Arduino
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)
Embedded Sumo 1T4 – 1T5 UTRA.
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
Introduction.
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Arduino Part 1 Topics: Microcontrollers Programming Basics: structure and variables Digital Output Analog to Digital Conversion.
Objectives: Lead Switching Circuitry/Control Analog to Digital Converter Write to Computer.
Microprocessors Tutorial 1: Arduino Basics
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Introduction to the Arduino
Khaled A. Al-Utaibi  The Push Button  Interfacing Push Buttons to Arduino  Programming Digital Inputs  Working with “Bouncy”
Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 2 ATMEGA328P ARCHITECTURE ANALOG INPUTS.
BM-305 Mikrodenetleyiciler Güz 2015 (3. Sunu) (Yrd. Doç. Dr. Deniz Dal)
Microprocessors Tutorial 1: Arduino Basics
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
Servo Demonstration In MPIDE, select File > Examples > Servo > Sweep.
SAMI MAKERSPACE MAKE: AN ELECTRONICS WORKSHOP. ARDUINO BASICS Credit to: Sparkfun and Linz Craig, Nick Poole, Prashanta Aryal, Theo Simpson, Tai Johnson,
Arduino Training New Mexico Mathematics, Engineering, and Science Achievement (NM MESA) Getting Started.
C# SERIAL COMMUNICATION TEMPERATURE CONTROL WITH ARDUINO KAAN EREN
Microcontroller basics Embedded systems for mortals.
ME 120: Arduino Programming Arduino Programming Part II ME 120 Mechanical and Materials Engineering Portland State University
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
BM-305 Mikrodenetleyiciler Güz 2016 (3. Sunu)
Arduino.
Arduino Part 1 Topics: Microcontrollers
Embedded Systems Intro to the Arduino
Getting Started: Building & Programming
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Microcontroller basics
Dr. Kyung Eun Park Summer 2017
Val Manes Department of Math & Computer Science
Microcontroller basics
Microprocessors Tutorial 1: Arduino Basics
Arduino Programming Part II
Microcontroller basics
UTA010 : Engineering Design – II
UCD ElecSoc Robotics Club 2017/2018
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Lecture 2-2: Arduino Programming
Въведение в Arduino.
Arduino - Introduction
Control the color and brightness of an RGB LED with a Potentiometer
BM-305 Mikrodenetleyiciler Güz 2017 (3. Sunu)
How to avoid catching things on fire.
Roller Coaster Design Project
What is an Arduino ? Open Source electronic prototyping platform based on flexible easy to use hardware and software.
IoT Programming the Particle Photon.
Arduino programs Arduino toolchain Cross-compilation Arduino sketches
Arduino : Introduction & Programming
Sensors and actuators Sensors Resistive sensors
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Introduction to Arduino
Lab #1: Getting Started.
Arduino Uno circuit basics
Introduction to Arduinos
Introduction to arduino
Arduino程式範例.
Introduction to Arduino IDE and Software
Presentation transcript:

Introduction to Arduinos Diogo Schwerz de Lucena April, 2018

Why are Arduinos so popular? What is an Arduino? Arduino is an electronics platform based on easy-to-use hardware and software. Both hardware and software are open-source. Why are Arduinos so popular? Does not need extra hardware to program and use the microcontroller Added extra C/C++ functions to interface with all the “Arduino family”

How/when will we use Arduinos in the lab? ALL the labs in MAE106 use Arduino Some of the code will be provided to you, but in most cases you will have to understand and change it accordingly to finish your lab and collect data for the write-ups

How the Arduino is used in our final project? Build-in timer Compass Reed Switches Switches (for optional whiskers) Servo Motor Solenoid Valve Steering Mechanism Pneumatic Cylinder Arduino

Arduino IDE and board

Reset Button 5V Output Digital Pins Ground Battery Input DigitalRead() DigitalWrite() AnalogWrite() ~ only 5V Output Ground Battery Input Analog Input Pins AnalogRead() DigitalRead() DigitalWrite()

Inputs vs Outputs Referenced from the perspective of the Arduino Inputs is a signal / information going into the board. Output is any signal exiting the board. Examples: Buttons Switches, Light Sensors, Flex Sensors, Humidity Sensors, Temperature Sensors, … Examples: LEDs, DC motor, servo motor, a piezo buzzer, relay, an RGB LED, …

pinMode() pinMode(pin, mode) configures the specified pin to behave either as an input or an output Modes: INPUT, OUTPUT, or INPUT_PULLUP Why INPUT_PULLUP? INPUT_PULLUP

Digital vs Analog

Digital Input: value = digitalRead(pin) value is 0, if input <= 1.5 V value is 1, if input >= 3.0 V Value is not determined, if input 1.5 < input < 3.0

Analog Input: value = analogRead(pin) value = analogRead(A0); Converts analog input to digital signal with a 10 bits converter: ? - > 0.00488 Input voltage Analog to digital conversion value (read in analogRead function) 0V 0000000000b 5V 1111111111b 1023 ? 0000000001b 1

Digital Output: digitalWrite(pin, value) digitalWrite(3, LOW); Output pin will be set to 0V digitalWrite(3, HIGH); Output pin will be set to 5V

Analog Output: analogWrite(pin, value) pin limited to pins with the ~ symbol value can be any number from 0 to 255 0 -> 0V | 255 -> 5V | 128 -> ? Fixed cycle length; constant number of cycles/sec

Arduino Language Is actually C language with extra functions ready to be used with any Arduino board Reference Open source

setup() and loop() functions setup(): This function is called once when a sketch starts after power- up or reset. It is used to initialize variables, input and output pin modes, and other libraries needed in the sketch loop(): After setup() has been called, function loop() is executed repeatedly in the main program. It controls the board until the board is powered off or is reset.

Arduino IDE See: http://arduino.cc/en/Guide/Environment for more information

ALWAYS: Select Serial Port and Board

Serial communication Used for communication between the Arduino board and a computer or other devices Arduino’s library is ready to use, and you should use it for debugging purposes as well Serial functions: begin() print() println() available()

Demo Potentiometer: Servomotor: Arduino: #include <Servo.h> Servo myservo; void setup() { myservo.attach(9); }