BM-305 Mikrodenetleyiciler Güz 2016 (3. Sunu)

Slides:



Advertisements
Similar presentations
Khaled A. Al-Utaibi Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to.
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)
Basic DC Motor Circuits
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Intro to the Arduino Topics: The Arduino Digital IO Analog IO Serial Communication.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2012 David Hall.
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
Potentiometer Electric circuit Cell or Battery Resistor Switch Bulb Earth/Ground LED.
Intro to Arduino with LilyPad Make a MakerSpace, Artisan’s Asylum Linz Craig, Chris Taylor, Mike Hord & Joel Bartlett.
SENIOR DESIGN 10/16.
Servo Control Using Analog Signal Obtain “analog” input using analogRead().
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team.
Introduction.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
T IMERS - 2. O UTPUT U NIT Each capture/compare block contains an output unit. The output unit is used to generate output signals such as PWM signals.
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.
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.
PWM Circuit Based on the 555 Timer. Introduction In applications LED Brightness Control we may want to vary voltage given to it. Most often we use a variable.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
Pulse Width Modulation (PWM). 100% Pulse Width Modulation (PWM) 0% On the chipKIT there are 490 periods per second. Use analogWrite(pin, value) to control.
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 2: Arduino Robotics. Agenda 1. Robot Anatomy 2. Sensor Review 3. PWM 4. MAKE: Fade 5. Motors 6. H Bridge 7. Robot Control library.
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.
Analog on the Arduino int k; // integer = 16 bits k = analogRead(1); Analog volts value (0V → 5V) returns from 0 to 1023 into “k” (10 “bits” = 1024 values)
Rebecca Bruce and Susan Reiser, May 2015 Analog Input and Output.
PWM: Pulse Width Modulation © 2014 Project Lead The Way, Inc.Digital Electronics.
Analog Output Materials: animatronic head Processing Quiz HW: code links.
Throttle Arduino RC Receiver Stock Golf Cart Motor Controller Motor 1 PWM signal: Voltage: 0 – 5V Period = 22ms Positive Pulse Width: 1ms – 2ms Digital.
Istituto Tecnico Industriale A.Monaco EURLAB Moving a robot simple example program to control a DC-Motor Next - Press the button (left)
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.
Application Case Study Christmas Lights Controller
GPIO Liaison série Entrées analogiques PWM
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Outline Introduction to digital-to-analog converter (DAC)
Microcontroller basics
Week 6: Style and Peripherals
Intro to the Arduino Created by
Microcontroller basics
Dimming Function – Pulse-width Modulation (PWM)
(6. Sunu) (AVR Assembly Örnekleri)
INC 161 , CPE 100 Computer Programming
Arduino - Introduction
BM-305 Mikrodenetleyiciler Güz 2017 (3. Sunu)
Analog Input through POT
Introduction to Arduinos
Arduino Analog I/O Analog input pins: 0 – 5
analog and digital measurements
Arduino programs Arduino toolchain Cross-compilation Arduino sketches
Arduino : Introduction & Programming
Sensors and actuators Sensors Resistive sensors
I/O Programming with Arduino
UNIT 11: RC-SERVOMOTOR CONTROL
UNIT 5 Analog signals.
Introduction to Arduinos
GPIO Liaison série Entrées analogiques PWM
Arduino程式範例.
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

BM-305 Mikrodenetleyiciler Güz 2016 (3. Sunu) (Yrd. Doç. Dr. Deniz Dal)

Analog Çıkış ve Darbe Genişlik Modülasyonu (Pulse Width Modulation – PWM) Arduinos and other microcontrollers provide analog to digital (ADC) conversion to convert an input voltage to a digital value. You might think that they also provide the converse which is digital to analog (DAC) conversion. This is not the case. Instead they provide pulse-width modulated (PWM) outputs. The Arduino library provides this functionality with a function called analogWrite(). The name seems to imply DAC functionality, but it just controls the PWM output. For many applications, such as the case of motor control, PWM is sufficient.

Analog Çıkış ve Darbe Genişlik Modülasyonu (Pulse Width Modulation – PWM) Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. The duration of "on time" is called the pulse width. To get varying analog values, you change, or modulate, that pulse width. If you repeat this on-off pattern fast enough with an LED for example, the result is as if the signal is a steady voltage between 0 and 5v controlling the brightness of the LED.

Analog Çıkış ve Darbe Genişlik Modülasyonu (Pulse Width Modulation – PWM) In the graphic below, the green lines represent a regular time period. This duration or period is the inverse of the PWM frequency. In other words, with Arduino's PWM frequency at about 500Hz, the green lines would measure 2 milliseconds each. A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) requests a 100% duty cycle (always on), and analogWrite(127) is a 50% duty cycle (on half the time) for example.

Görev Çevrimi (Duty Cycle) A duty cycle is the percentage of one period in which a signal is active. A period is the time it takes for a signal to complete an on-and-off cycle. A 60% duty cycle means that the signal is on 60% of the time but off 40% of the time. The "on time" for a 60% duty cycle could be a fraction of a second, a day, or even a week, depending on the length of the period.

analogWrite Fonksiyonu ve Arduino UNO PWM Çıkış Pinleri Writes an analog value (PWM wave) to a pin. Can be used to light a LED at varying brightnesses or drive a motor at various speeds. After a call to analogWrite(), the pin will generate a steady square wave of the specified duty cycle until the next call to analogWrite() (or a call to digitalRead() or digitalWrite() on the same pin). The frequency of the PWM signal on most pins is approximately 490 Hz. On the Uno, this function works on pins 3, 5, 6, 9, 10, and 11. Those pins are marked with a tilde ~ symbol and output a variable duty cycle from 0 to 255 (0 to 100%). You do not need to call pinMode() to set the pin as an output before calling analogWrite(). The analogWrite function has nothing to do with the analog pins or the analogRead function. Syntax: analogWrite(pin, value) Parameters: pin: the pin to write to. value: the duty cycle: between 0 (always off) and 255 (always on).

PWM ile LED Parlaklığının Kontrolü

PWM ile LED Parlaklığının Kontrolü

PWM ile LED Parlaklığının Kontrolü

Dijital Giriş ve digitalRead Fonksiyonu digitalRead() reads the value from a specified digital pin, either HIGH or LOW. Syntax: digitalRead(pin) Parameters: pin: the number of the digital pin you want to read (int) Returns: HIGH or LOW

Geçici Anahtar ile LED Kontrolü

Geçici Anahtar ile LED Kontrolü

Geçici Anahtar ile LED Kontrolü

Analog Giriş ve analogRead Fonksiyonu analogRead() reads the value from the specified analog pin. The Arduino UNO board contains a 6-channel, 10-bit analog to digital converter (ADC). This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit. The input range and resolution can be changed using analogReference(). Syntax: analogRead(pin) Parameters: pin: the number of the analog input pin to read from (0 to 5) Returns: int (0 to 1023)

Potansiyometre Çıkış Geriliminin Analog Giriş Olarak Kullanılması

Potansiyometre Çıkış Geriliminin Analog Giriş Olarak Kullanılması