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.

Slides:



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

EMS1EP Lecture 9 Analog to Digital Conversion (ADC) Dr. Robert Ross.
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
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Introduction to Arduino Programming January MER-421:Mechatronic System Design.
Potentiometer Electric circuit Cell or Battery Resistor Switch Bulb Earth/Ground LED.
Lesson 4: Breathing Monitors. Breathing Monitors In the past 3 classes, we’ve learned – How to write to a digital pin – How to read the value of a digital.
Secret Door Knock Detector
Servo Control Using Analog Signal Obtain “analog” input using analogRead().
Microprocessors Tutorial 2: Arduino Robotics
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Basic Circuits – Lab 2 Arduino and Sensors
Lecture 9: Microcontrollers – part 1 BJ Furman 29OCT2012.
chipKit Sense Switch & Control LED
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
1 Applied Control Systems Technology. 2 Pin configuration Applied Control Systems.
Control Angle via Button Pushes One button increases angle. Other decreases angle. Both light LED.
Cascade switching of an LED EAS 199B Winter 2013.
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.
Good LED Circuit 5V0 GND. What Voltage Does Meter See? Answer: 5 V.
Servos The material presented is taken from a variety of sources including:
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.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
Lecture 10: Peripherals Bryan Burlingame 04 November 2015.
Servo Demonstration In MPIDE, select File > Examples > Servo > Sweep.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
1 4-Integrating Peripherals in Embedded Systems (cont.)
PWM: Pulse Width Modulation © 2014 Project Lead The Way, Inc.Digital Electronics.
Motor TYWu.
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.
ME 120: User-defined functions: average analog input reading Arduino Programming – Part 5: User-defined functions ME 120 Mechanical and Materials Engineering.
Microcontroller basics Embedded systems for mortals.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Istituto Tecnico Industriale A.Monaco EURLAB Moving a robot simple example program to control a DC-Motor Next - Press the button (left)
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).
Intro to Arduino Basic Arduino John Wolf (WolfDenElectronics.com)
Pulse-Width Modulation: Simulating variable DC output
Microcontroller basics Embedded systems for mortals.
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
Arduino Application: Speed control of small DC Motors
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)
Microcontroller basics
Outline Introduction to digital-to-analog converter (DAC)
CU ATLAS Practical electronics Motion and Servos
Microcontroller basics
If you want to swing an robot arm or …
Week 6: Style and Peripherals
Microcontroller basics
Cascade switching of an LED
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
Въведение в Arduino.
Arduino - Introduction
Control the color and brightness of an RGB LED with a Potentiometer
Control a motors angular position with a flex sensor
BM-305 Mikrodenetleyiciler Güz 2017 (3. Sunu)
Analog Input through POT
Arduino Application: Speed control of small DC Motors
IoT Programming the Particle Photon.
Secret Door Knock Detector
Arduino : Introduction & Programming
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
Sensors and actuators Sensors Resistive sensors
UNIT 5 Analog signals.
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

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 the duty cycle on a pin. The value must be between 0 and 255. The pin must be one of the underlined pins.

Pulse Width Modulation (PWM) If you take the average value over one period, you can think of the voltage as being between 0 V (0% duty cycle) and 3.3 V (100% duty cycle). There are 256 different voltage levels (0 to 255).

Conversion of Analog to Digital Obtain “analog” input using analogRead(). analogRead() returns a value between 0 (if pin at ground) and 1023 (if pin at 3.3 V). Argument of analogRead() is the pin to read (only pins labeled ANALOG IN can be used). Used this to read setting of a potentiometer.

Pulse Width Modulation (PWM) Wrote led_with_potentiometer for this circuit.

Dimmable LED Program int potPin = 0; // Pin for potentiometer. int ledPin = 9; // Pin for LED. int pwmValue = 0; void setup() { Serial.begin(9600); // To see potentiometer setting. } void loop() { // Read potentiometer value and set PWM value. pwmValue = analogRead(potPin) / 4; Serial.println(pwmValue, DEC); analogWrite(ledPin, pwmValue); // Set PWM duty cycle. delay(15); // Waits 15 ms. }

Different Circuit; Same Result

Transistor: Electrically Controlled Switch If “base” of the transistor is high, then current can flow freely.

Transistor: Electrically Controlled Switch If “base” of the transistor is low, then current cannot flow.

Variable Speed Motor