Arduino : Introduction & Programming

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 8 Pulse Width Modulation (PWM)
Advertisements

ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Lab7: Introduction to Arduino
Servo Background Servos provide control of rotary position Servos are used extensively in the remote control hobby world for: Aircraft (flaps, ailerons,
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)
How to use Arduino By: Andrew Hoffmaster.
Embedded Sumo 1T4 – 1T5 UTRA.
Panasonic EVE-KC2F2024B 24 pulses per revolution 6mm diameter flattened output shaft output type: quadrature (incremental) minimum life: 15,000 rotations.
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Introduction.
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.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
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
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi. Objectives 1. Control the rotation of standard servo motor  A standard servo motor is limited in its rotation.
BM-305 Mikrodenetleyiciler Güz 2015 (3. Sunu) (Yrd. Doç. Dr. Deniz Dal)
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.
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Arduino Training New Mexico Mathematics, Engineering, and Science Achievement (NM MESA) Getting Started.
PWM: Pulse Width Modulation © 2014 Project Lead The Way, Inc.Digital Electronics.
Istituto Tecnico Industriale A.Monaco EURLAB Control a Servo Motor If you want to swing an robot arm or … steer a robot you need a special motor (Servo).
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
Electronic instrumentation Digitization of Analog Signal in TD
Pulse-Width Modulation: Simulating variable DC output
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
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)
Getting Started: Building & Programming
Application of Programming: Scratch & Arduino
Microcontroller basics
If you want to swing an robot arm or …
Val Manes Department of Math & Computer Science
Microcontroller basics
Microprocessors Tutorial 1: Arduino Basics
UTA010 : Engineering Design – II
Get Your Project Started with Arduino
European Robotic LABoratory
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
Arduino.
Arduino - Introduction
Control the color and brightness of an RGB LED with a Potentiometer
Arduino Uno and sensors
Control a motors angular position with a flex sensor
BM-305 Mikrodenetleyiciler Güz 2017 (3. Sunu)
Analog Input through POT
Introduction to Arduinos
Topics: Analog/Digital Read Relay control 7 segment control Buzzer
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.
What is an Arduino ? Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi.
Arduino 101 Credit(s):
Welcome to Digital Electronics using the Arduino Board
Secret Door Knock Detector
Sensors and actuators Sensors Resistive sensors
Welcome to Arduino workshop
Arduino UMBC IEEE Sekar Kulandaivel
Introduction to Arduino
Arduino Uno circuit basics
Arduino म्हणजे काय?.
Introduction to Arduinos
Arduino程式範例.
Arduino UMBC IEEE Sekar Kulandaivel Week 3: Motor Control w/ H-Bridges
Interrupts.
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

Arduino : Introduction & Programming

What is an Arduino ? Open Source electronic prototyping platform based on flexible easy to use hardware and software.

Uses of Arduino

Uses of Arduino Servo motors are available at different shapes and sizes. A servo motor will have mainly there wires, one is for positive voltage another is for ground and last one is for position setting. The RED wire is connected to power, Black wire is connected to ground and YELLOW wire is connected to signal. Simply speaking the control electronics adjust shaft position by controlling DC motor. This data regarding position of shaft is sent through the SIGNAL pin. The position data to the control should be sent in the form of PWM signal through the Signal pin of servo motor. The frequency of PWM (Pulse Width Modulated) signal can vary based on type of servo motor. The important thing here is the DUTY RATIO of the PWM signal. Based on this DUTY RATION the control electronics adjust the shaft.

Uses of Arduino

Uses of Arduino

Getting started with Programming

Bare minimum code void setup() {   // put your setup code here, to run once: } void loop() {   // put your main code here, to run repeatedly:

Bare minimum code setup : It is called only when the Arduino is powered on or reset. It is used to initialize variables and pin modes loop : The loop functions runs continuously till the device is powered off. The main logic of the code goes here. Similar to while (1) for micro-controller programming.

PinMode A pin on arduino can be set as input or output by using pinMode function. pinMode(13, OUTPUT); // sets pin 13 as output pin pinMode(13, INPUT); // sets pin 13 as input pin

Reading/writing digital values digitalWrite(13, LOW); // Makes the output voltage on pin 13 , 0V digitalWrite(13, HIGH); // Makes the output voltage on pin 13 , 5V int buttonState = digitalRead(2); // reads the value of pin 2 in buttonState

Analog to Digital Coversion What is analog ? It is continuous range of voltage values (not just 0 or 5V) Why convert to digital ? Because our microcontroller only understands digital.

ADC in Arduino Uno

Converting Analog Value to Digital

Quantanization the signal

ADC in Arduino The Arduino Uno board contains 6 pins for ADC 10-bit analog to digital converter This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023

Reading/Writing Analog Values analogRead(A0); // used to read the analog value from the pin A0 analogWrite(2,128);

ADC Example // These constants won't change.  They're used to give names to the pins used: const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to const int analogOutPin = 9; // Analog output pin that the LED is attached to int sensorValue = 0;        // value read from the pot int outputValue = 0;        // value output to the PWM (analog out) void setup() {   // initialize serial communications at 9600 bps:   Serial.begin(9600);  } void loop() {   // read the analog in value:   sensorValue = analogRead(analogInPin);               // map it to the range of the analog out:   outputValue = map(sensorValue, 0, 1023, 0,  255);     // change the analog out value:   analogWrite(analogOutPin, outputValue);              // print the results to the serial monitor:   Serial.print("sensor = " );                          Serial.print(sensorValue);         Serial.print("\t output = ");         Serial.println(outputValue);      // wait 2 milliseconds before the next loop   // for the analog-to-digital converter to settle   // after the last reading:   delay(2);                      }

Servo Example #include <Servo.h> Servo servo1; Servo servo2; int i = 0; void setup() { servo1.attach(3); servo2.attach(5); servo3.attach(6); servo4.attach(9); } void loop() { for (i = 0; i < 180; i++) { servo1.write(i); servo2.write(i); servo3.write(i); servo4.write(i); delay(10); for (i = 180; i > 0; i--) {