Professional Documents
Culture Documents
Chapter Eight
8.1 8.9
Outline
Introduction Keypads Seven-segment displays LCDs Sensors Actuators Summary
Dr. Gheith Abandah 2
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 Abandah 3
Output:
light-emitting diode (LED) Seven-segment LED Liquid crystal display (LCD)
The Keypad
Flow diagram
Reading a keypad with a microcontroll er port
10
11
12
;ensure output values still 0 ;read portb value, col. pattern ;suppress unwanted bits ;OR results into the pattern
Dr. Gheith Abandah 15
16
Seven-segment displays
Common Anode
Common Cathode
17
18
Timing diagram
19
20
24
Derbots LCD
28
Sensors
Convert physical variables to electrical. Examples:
The microswitch Light-dependent resistor Ultrasonic object sensor
29
The Microswitch
30
Light-dependent resistors
A light-dependent resistor (LDR) is made from a piece of exposed semiconductor material. When light falls on it, it creates holeelectron pairs in the material, which improve the conductivity. 20M to a few Dr. Gheith Abandah hundred ohms
31
32
33
34
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
35
(a) Spikes in signal, potentially harmful to device input. (b) Spikes in signal. (c) Excessively slow edges. (d) DC offset in signal.
Dr. Gheith Abandah 36
Input protection
For Rprot = 1K and max. diode current =20 mA What is the maximum voltage spike? Vmax = [(20mA 1 k ) + 5.3] Dr. Gheith Abandah 37 = 25V
38
39
Switch bouncing
40
41
42
43
Comparison
DC Motors Stepper Motors Range from the Simple interface with extremely powerful to digital systems the very small Can control speed and Wide speed range position Controllable speed Awkward start-up characteristics Good efficiency Lose torque at high Can provide accurate speed angular positioning Limited top speed with angular shafts Only the armature Less efficient winding needs to be Gheith Abandah Dr. More complex to drive44
Derbot DC Motor
45
46
Interfacing to actuators
Simple DC switching
Bipolar transistors MOSFET transistors
Reversible switching
The H-bridge
47
48
49
50
51
I = (5 3.4)/91 I = 17.6 mA
52
53
54
55
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 Dr. Gheith Abandah 56