Khaled A. Al-Utaibi Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to.

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 6 Digital Inputs
Advertisements

EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Electrical team Arduino tutorial I BY: JOSHUA arduini
Khaled A. Al-Utaibi  Clock Generator Functions  Crystal Oscillator  8284 Pins  8284 Interfacing to the 8086  RC Circuit Charging.
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.
Embedded Sumo 1T4 – 1T5 UTRA.
LECTURE 4 DIODE LED ZENER DIODE DIODE LOGIC
MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
Programming Microcontrollers B. Furman 19MAR2011.
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
Living with the Lab Using Your Arduino, Breadboard and Multimeter EAS 199A Fall 2011 Work in teams of two!
ELCT 201 week 13 Analog ON/OFF control system conversion to Digital ON/OFF control system.
Digital Tachometer ENGR 4803 Electromechanical Systems & Mechatronics.
Intro to Programming and Microcontrollers. Activity Group into pairs and sit back-to-back. Pick one person who is going to draw. The other person will.
Living with the lab Introduction to Arduino Programming arduino.cc Gerald Recktenwald Portland State University
Arduino. Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source.
Digital Outputs 7-Segment Display
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team.
Embedded Programming and Robotics
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
chipKit Sense Switch & Control LED
Introduction to the Arduino
Khaled A. Al-Utaibi  The Push Button  Interfacing Push Buttons to Arduino  Programming Digital Inputs  Working with “Bouncy”
Cascade switching of an LED EAS 199B Winter 2013.
Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.
Lab 10 Experiment 21 Design a Traffic Arrow. Just so it is clear This is it. – Last official experiment for the semester. It is your option as to whether.
Experiment 21 Design a Traffic Arrow.
ME456: Mechatronics Systems Design Lecture 3 Chapter 2: Lights On –Lights Off Prof. Clark J. Radcliffe Mechanical Engineering Michigan State University.
Digital Inputs Interfacing Keypad
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.
Microcontrollers, Microcomputers, and Microprocessors
Arduino libraries Datatekniker Udvidet hardware/software.
Microcontroller basics Embedded systems for mortals.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
:Blink Blink: Er. Sahil Khanna
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Arduino.
Val Manes Department of Math & Computer Science
Microcontroller basics
UTA010 : Engineering Design – II
Welcome to Arduino A Microcontroller.
Get Your Project Started with Arduino
INC 161 , CPE 100 Computer Programming
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Arduino.
Въведение в Arduino.
Introduction to Arduino Microcontrollers
Introduction to Arduinos
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.
Arduino 101 Credit(s):
using the Arduino to make LEDs flash
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Welcome to Digital Electronics using the Arduino Board
Arduino : Introduction & Programming
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Arduino Motor Lab Inspired by NYU ITP project
Aeroponic Engineering and Vertical Farming
Arduino Uno circuit basics
Setting up a basic program with Arduino
Arduino程式範例.
Introduction to Arduino IDE and Software
Interrupts.
Presentation transcript:

Khaled A. Al-Utaibi

Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to Arduino Boards Programming Digital Outputs

A "Light Emitting Diode" or LED is basically just a specialized type of PN junction diode capable of emitting light when conducting.

LED is an important output device for visual indication in embedded systems: Status indicator lamps (e.g. Power ON) Direction signs Advertising Traffic signals

The LED has two DC characteristics: (1) Forward voltage (V F ) which is the minimum required voltage to turn on the LED (2) Full Drive/Forward Current (I F ) which is the maximum allowed current across the LED (i.e. a current larger than I F will burn the LED).

In order to protect the LED, a current limiting resistor R is usually used. The value of this resistor is calculated using the following formula:

Consider an LED with the following DC characteristics and calculate the minimum value of current limiting resistor R to protect the LED: Forward voltage V F = 2.2V Forward current I F = 10mA Assume V S = 5V

One way to interface an LED to the Arduino Uno Board is shown in the figures below.

Programming digital inputs/outputs involves two operations: (1) Configuring the desired pin as either input or output. (2) Controlling the pin to read/write digital data.

By default, all Arduino pins are set to inputs. If you want to make a pin an output, you need to first tell the Arduino how the pin should be configured (INPUT/OUTPUT). In the Arduino programming language, the program requires two parts: (1) the setup() function and (2) the loop() function. The setup() function runs one time at the start of the program, and the loop() function runs over and over again.

Because youll generally dedicate each pin to serve as either an input or an output, it is common practice to define all your pins as inputs or outputs in the setup. // set pin 9 as a digital output void setup() { pinMode(9, OUTPUT); }

The pinMode() function configures the specified pin to behave either as an input or an output. Syntax: pinMode(pin, mode) Parameters: pin: the number of the pin whose mode you wish to set. mode: INPUT or OUTPUT Returns: None

Because the loop() function runs over and over again, outputs are usually written in this function. // set pin 9 high void loop() { digitalWrite(9, HIGH); }

The digitalWrite() function writes a HIGH or a LOW value to a digital pin. If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the corresponding value: 5V for HIGH, 0V for LOW. Syntax: digitalWrite(pin, value) Parameters: pin: the pin number. value: HIGH or LOW Returns: None

Write an Arduino program that turns ON an LED connected to pin 13 for one second, then OFF for one second, repeatedly.

// Turns on an LED on for one second, then off for one second, // repeatedly. int led = 13; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off (LOW) delay(1000); // wait for a second }

The delay() function Pauses the program for the amount of time (in milliseconds) specified as parameter. Note: there are 1000 milliseconds in a second. Syntax: delay(ms) Parameters: ms: the number of milliseconds to pause (unsigned long) Returns: None