The human and physical interfaces Chapter Eight 8.1 – 8.9 Dr. Gheith Abandah1.

Slides:



Advertisements
Similar presentations
Working with time: interrupts, counters and timers Chapter Six Dr. Gheith Abandah1.
Advertisements

Transducers PHYS3360/AEP3630 Lecture 33.
1 ECE 372 – Microcontroller Design Parallel IO Ports - Outputs Parallel IO Ports E.g. Port T, Port AD Used to interface with many devices Switches LEDs.
Week10 Boolean Instructions on the Boolean Instructions  Boolean (or Bit) addressable capability is unique to the 8051  Enables efficient handling.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Input/Output (I/O) Ports and Interfacing
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
Data acquisition and manipulation
Circuit Protection  Protective Devices – terminate current flow in a circuit.  Located in series within a circuit  Excessive current flow results from.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 12.
Digital Tachometer ENGR 4803 Electromechanical Systems & Mechatronics.
Starting with serial Chapter Ten 10.1, 10.2,
CMPE 118 MECHATRONICS Introduction to Sensors Or, How the world gets into our programs.
Railway Foundation Electronic, Electrical and Processor Engineering.
Taking timing further Chapter Nine 9.1 – 9.8 Dr. Gheith Abandah1.
Parallel ports, power supply, and the clock oscillator Chapter Three Dr. Gheith Abandah1.
ECE 265 – LECTURE 13 Interface to switches and LEDs 7/3/ ECE265.
ACTIVE SUSPENSION TEST PLATFORM BRANDON NAYDEN & CHIAO LIU BY ADVISED BY: STEVEN GUTSCHLAG.
Railway Foundation Electronic, Electrical and Processor Engineering.
Storey: Electrical & Electronic Systems © Pearson Education Limited 2004 OHT 4.1 Actuators  Introduction  Heat Actuators  Light Actuators  Force, Displacement.
ASPPRATECH.
Lecture – 7 Basic input and output
ECE 447 Fall 2009 Lecture 6: TI MSP430 IO Interfacing.
BASIC ELECTRONICS.
Submitted by:. CONTENTS Introduction Block diagram Power supply PIC Microcontroller BLDC Motor Opto-isolator MOSFET IR LED & Photodiode Keypad LCD Schematic.
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 12.
Microcontroller Programming How to make something almost do something else Raffi Krikorian MAS November 2003.
Electronic Troubleshooting
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
Building Assembler Programs Chapter Five Dr. Gheith Abandah1.
Parallel Ports, Power Supply and the Clock Oscillator Material to be covered  Parallel I/O ports  Interfacing external switches and LEDs  Clock Oscillator.
Input/Output Ports and Interfacing
One of the most important feature of the microcontroller is a number of input/output pins used for connection with peripherals. In the case of PIC 167CX,
PIC16F877 ISR Points to note Interrupt Triggers –Individual interrupt flag bits are set, regardless of the status of their corresponding mask bit, PEIE.
Engineering 1040: Mechanisms & Electric Circuits Winter 2015 Interfacing Light-Emitting Diodes (LEDs) & Push Buttons to Microcontrollers.
Lecture 9: Modeling Electromechanical Systems 1.Finish purely electrical systems Modeling in the Laplace domain Loading of cascaded elements 2.Modeling.
Chapter 8 The Human and Physical Interface The aims of this chapter are to introduce: Human interfacing needs and some simple means of meeting these; Some.
Interfacing to External Devices  Explore Digital Interfaces techniques  Introduce some complex optical devices and how to interface them  Describe methods.
Department of Electronic & Electrical Engineering Lecture 2 ● Introduction to IO ● Using a subroutine ● Driving a 7seg display.
Working with Time: Interrupts, Counters and Timers
Department of Electronic & Electrical Engineering Lecture 3. ● Template program. ● Introduction to IO ● PORTA PORTB TRISA TRISB ● Using a subroutine ●
BLDC Motor Speed Control with RPM Display. Introduction BLDC Motor Speed Control with RPM Display  The main objective of this.
1. 2 Meghanathi Gaurang k ( ) Pandey Prashant D ( ) Mishra sandip R ( )
DESIGN OF MONO-AXIS SOLAR TRACKING SYSTEM USING MICROCONTROLLER BASED STEPPER MOTOR KAMAL J K KOUSHIK VENKATRAMAN N PREM M PRASANTH K Guidance: Mrs.Kavitha.
Arduino Based DC Motor Speed Control
DC motor principles Speed control Direction Stepper motor principles
LED AND KEYBOARD INTERFACING PREPARED BY :- PREPARED BY :- RAVAL AKASH ( ) RAVAL AKASH ( ) PATEL HARDIK ( ) PATEL HARDIK.
I/O PORTS. General purpose I/O pins can be considered the simplest of peripherals. They allow the PICmicro™ to monitor and control other devices. To add.
Applications examples. A binary count : stepped manually and reset with push buttons. Define ports Reset portd Reset =0? INCF portd no Step =0? yes.
ADVANCED WATER LEVEL CONTROLLER
WATER LEVEL INDICATOR AND AUTOMATIC MOTOR SWITCHING SYSTEM
ARM CORTEX (STM32) BASED MOTOR SPEED CONTROL SUBMITTED BY EDGEFX TEAM.
Sensors and Actuators Simple Sensors Switches and Pots Other Sensors Simple Actuators LEDs and Buzzers DC Motors MAE 156A.
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
For further information
DIGITAL CALCULATOR USING 8051
Microprocessor Systems Design I
Microprocessor Systems Design I
Principles & Applications and Simple Interfacing
Interfacing different devices & considerations
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /10/2018.
EE Embedded Systems Fall 2015
Presentation of Robotics (3)
Electromagnetic Relay
Diodes AIM: To understand diode characteristics
ADC and DAC Data Converter
ACOE347 – Data Acquisition and Automation Systems
ADC and DAC Data Converter
Presentation transcript:

The human and physical interfaces Chapter Eight 8.1 – 8.9 Dr. Gheith Abandah1

Outline Introduction Keypads Seven-segment displays LCDs Sensors Actuators Summary Dr. Gheith Abandah2

Introduction A human interface is an important part of most embedded systems. Users need to conveniently get information from the embedded system. They also need to conveniently control the operation of this system. Examples: – Domestic fridge – Photocopier – Car dashboard Dr. Gheith Abandah3

Human Interface - Examples Dr. Gheith Abandah4

Human Interface - Examples Dr. Gheith Abandah5

Human interface types Input: – Switch – Push button – Keypad Output: – light-emitting diode (LED) – Seven-segment LED – Liquid crystal display (LCD) Dr. Gheith Abandah6

The LED version of the Derbot AGV Dr. Gheith Abandah7

The LCD version of the Derbot AGV Dr. Gheith Abandah8

The Keypad Dr. Gheith Abandah9

Flow diagram Reading a keypad with a microcontroller port Dr. Gheith Abandah10

Outputs for the keypad Port BitFunction 7Row 1 6Row 2 5Row 3 4Row 4 3Column 1 2Column 2 1Column 3 0Unused Dr. Gheith Abandah11

Flow diagram of program example Dr. Gheith Abandah12

Keypad Example – Initialization ;Initialize bsf status,rp0 ;select memory bank 1 movlw B' ' ;Port B initially Row bits ;are input, column output movwf trisb bcf status,rp0 ;select bank 0... clrf portb ;initialize keypad value bcf intcon,rbif;enable interrupt bsf intcon,rbie bsf intcon,gie loop goto loop ;await keypad entries Dr. Gheith Abandah13

Keypad Example – ISR kpad_to_lcd call kpad_rd call kp_code_conv bsf portc,lcd_RS ;set for character op movwf lcd_op call lcd_write rel_test;test now for keypad release call kpad_rd movf kpad_pat,0 andlw 0fe ;suppress lsb, not used sublw 0fe ;test if inactive btfss status,z goto rel_test bcf intcon,rbif ;clear interrupt flag retfie Dr. Gheith Abandah14

Keypad Example – Read keypad kpad_rd movf portb,w ;read portb value, row pattern andlw B' ' ;suppress unwanted bits movwf kpad_pat bsf status,rp0 ;set row to op, column to ip movlw B' ' movwf trisb bcf status,rp0 movlw 00 movwf portb ;ensure output values still 0 movf portb,w ;read portb value, col. pattern andlw B' ' ;suppress unwanted bits iorwf kpad_pat,1 ;OR results into the pattern Dr. Gheith Abandah15

Keypad Example – Read keypad 2 ;reset keypad interface bsf status,rp0 ;set row to ip, column to op movlw B' ' movwf trisb bcf status,rp0 clrf portb ;ensure output values still 0 return Dr. Gheith Abandah16

Seven-segment displays Dr. Gheith Abandah17 Common Anode Common Cathode

Connecting multiple digits Dr. Gheith Abandah18 Need 1.2 kΩ line resistors

Timing diagram Dr. Gheith Abandah19

7-seg. display example – page 1 Dr. Gheith Abandah20

7-seg. display example – page 2 ;Initialise bcf status,rp1 bsf status,rp0;bank 1 movlw B’ ’ ;out movwf trisa movwf trisb movwf trisc bcf status,rp0;bank 0 ; loop ;set digit 1 movlw B' ' ;H movwf porta bcf portc,6 ;seg a bsf portc,7 ;seg b bsf portc,1 ;dig 1 call delay5 bcf portc,1 ;set digit 2 … goto loop Dr. Gheith Abandah21

Liquid crystal displays (LCDs) Liquid crystal responds to an applied electric field by changing the alignment of its molecules, and in so doing changing the direction of the light polarization that it introduces. Liquid crystal can be trapped between two parallel sheets of glass, with a matching pattern of transparent electrode on each sheet. When a voltage is applied to the electrodes, the optical character of the crystal changes and the electrode pattern appears in the crystal. Dr. Gheith Abandah22

Interfacing with LCDs Hitachi developed a special microcontroller (HD44780) for interfacing LCDs. This microcontroller is usually integrated with LCDs. Features: – 8- or 4-bit data transfer – Simple instruction set to initialize, clear, display, and position cursor – Has instruction register and data register Dr. Gheith Abandah23

HD44780 timing diagram Dr. Gheith Abandah24

Derbot’s LCD Dr. Gheith Abandah25 Each digit is a liquid crystal dot matrix

LCD Drive Example – Page 1 lcd_write call busy_check bcf portc,lcd_rw bcf status,c rrf lcd_op,1 bcf portc,6 btfsc status,c bsf portc,6 bcf status,c rrf lcd_op,1 bcf portc,7 btfsc status,c bsf portc,7 movf lcd_op,0 movwf porta bsf portc,lcd_E bcf portc,lcd_E return Dr. Gheith Abandah26

LCD Drive Example – Page 2 busy_check bsf status,rp0 ;bank 1 movlw B' ' ;set port A all ip movwf trisa bcf status,rp0 bcf flags,0 btfsc portc,lcd_RS ;save RS in flags, 0 bsf flags,0 bcf portc,lcd_RS ;access instr register bsf portc,lcd_RW ;set to read Dr. Gheith Abandah27

LCD Drive Example – Page 3 busy_loop bcf portc,lcd_E bsf portc,lcd_E btfsc porta,lcd_busy ;test the busy flag goto busy_loop bcf portc,lcd_E bsf status,rp0 ;select memory bank 1 movlw B' ‘ ;set port A all op movwf trisa bcf status,rp0 bcf portc,lcd_RS btfsc flags,0 ;reinstate RS bit bsf portc,lcd_RS return Dr. Gheith Abandah28

Sensors Convert physical variables to electrical. Examples: – The microswitch – Light-dependent resistor – Ultrasonic object sensor Dr. Gheith Abandah29

The Microswitch Dr. Gheith Abandah30

Light-dependent resistors A light-dependent resistor (LDR) is made from a piece of exposed semiconductor material. When light falls on it, it creates hole–electron pairs in the material, which improve the conductivity. 20M Ω to a few hundred ohms Dr. Gheith Abandah31

Optical object sensing Infrared LED and phototransistor Dr. Gheith Abandah32

The opto-sensor applied as a shaft encoder Dr. Gheith Abandah33

Ultrasonic object sensor Dr. Gheith Abandah34

Digital input If a microcontroller is to receive logic signals, then it is essential that those signals are at voltage levels which are recognized by it as being either Logic 0 or Logic 1. Dr. Gheith Abandah35

Forms of signal corruption Dr. Gheith Abandah36 (a) Spikes in signal, potentially harmful to device input. (b) Spikes in signal. (c) Excessively slow edges. (d) DC offset in signal.

Input protection For R prot = 1KΩ and max. diode current =20 mA What is the maximum voltage spike? V max = [(20mA × 1 k Ω) + 5.3] = 25V Dr. Gheith Abandah37

Ensuring legal logic levels Can use Schmitt trigger for speeding up slow logic edges. Schmitt trigger with RC filter can be used to filter voltage spikes. Digital filtering: sample the input three times and use a majority vote. Dr. Gheith Abandah38

Isolation or level shifting with the opto-isolator Dr. Gheith Abandah39

Switch bouncing Dr. Gheith Abandah40

Hardware switch debouncing Dr. Gheith Abandah41

Software switch debouncing Dr. Gheith Abandah42 Typically 10 ms

Actuators: motors and servos Often need to cause physical movement For linear movement use solenoids For angular movement, use ‘servos’ For angular or rotary, use DC or stepper motors Dr. Gheith Abandah43

Comparison DC Motors Range from the extremely powerful to the very small Wide speed range Controllable speed Good efficiency Can provide accurate angular positioning with angular shafts Only the armature winding needs to be driven Stepper Motors Simple interface with digital systems Can control speed and position Awkward start-up characteristics Lose torque at high speed Limited top speed Less efficient More complex to drive Dr. Gheith Abandah44

Derbot DC Motor Dr. Gheith Abandah45

Servo input and output characteristics Dr. Gheith Abandah46

Interfacing to actuators Simple DC switching – Bipolar transistors – MOSFET transistors Reversible switching – The H-bridge Dr. Gheith Abandah47

Bipolar transistor switching of DC resistive loads Dr. Gheith Abandah48

MOSFET transistor switching of DC resistive loads Dr. Gheith Abandah49

MOSFET transistor switching of DC inductive loads Dr. Gheith Abandah50

Characteristics of two popular logic-compatible MOSFETs Dr. Gheith Abandah51

Driving piezo sounder and opto- sensors Dr. Gheith Abandah52 I = (5 − 3.4)/91 I = 17.6 mA

Reversible switching: the H-bridge Dr. Gheith Abandah53

The L293D dual H-bridge Dr. Gheith Abandah54

The L293D applied in the Derbot motor drive circuit Dr. Gheith Abandah55

Summary An embedded microcontroller must be able to interface with the physical world and possibly the human world as well. Much human interfacing can be done with switches, keypads and displays. To interface with the physical world, the microcontroller must be able to interface with a range of transducers. The designer needs an understanding of the main sensors and actuators available. Interfacing with sensors requires a reasonable knowledge of signal conditioning techniques. Interfacing with actuators requires a reasonable knowledge of power switching techniques. Dr. Gheith Abandah56