You are on page 1of 42

ĐẠI HỌC QUỐC GIA TP.

HỒ CHÍ MINH
TRƯỜNG ĐẠI HỌC BÁCH KHOA
KHOA ĐIỆN-ĐIỆN TỬ
BỘ MÔN KỸ THUẬT ĐIỆN TỬ

Embedded System Design

Chapter 3: Hardware design for an embedded


system part2

1. Basic I/O
2. Sensor

1
1. Button Interface

Bộ môn Kỹ Thuật Điện Tử Chapter 4 2


Debounce

Bộ môn Kỹ Thuật Điện Tử 3


Input protection

Bộ môn Kỹ Thuật Điện Tử 4


Input protection

• Find the fastest edge of the incoming signal – or determine the fastest frequency
of the incoming signal and assume an edge speed of 1/100th of the input period
(a 1 kHz input frequency has an edge of 10 µs).

• Select ‘R’. Usually this can be selected to a common value already in the
system, such as 1 kΩ.

• Use the equation: Risetime = 2.2RC to determine the value of ‘C’.

• In some cases, the input signal is a very slow moving signal (button press, switch
closure, etc.), so the value of ‘C’ can be then changed to match a common value
on the board, as long as the order of magnitude is maintained.
Bộ môn Kỹ Thuật Điện Tử 5
Input protection

Bộ môn Kỹ Thuật Điện Tử 6


Dipswitch
SW1

SW DIP-10

R1
1 2
3
4
5
6
7
8
9
10

RESISTOR SIP 10

Bộ môn Kỹ Thuật Điện Tử 7


Keypad

Bộ môn Kỹ Thuật Điện Tử 8


Digital output

Current Sourcing Current Sinking

Bộ môn Kỹ Thuật Điện Tử 9


Bộ môn Kỹ Thuật Điện Tử 10
Drive high current/voltage
What is the possible problem?

Bộ môn Kỹ Thuật Điện Tử 11


Drive relays

Driving an Inductive Driving a Mains Bulb Using a Relay


Load (e.g., a Relay)

Bộ môn Kỹ Thuật Điện Tử 12


Triac drive

Bộ môn Kỹ Thuật Điện Tử 13


Drive IC
•The ULN2803 can provides much higher drive-current.
•The ULN2803 also has internal diode protection that eliminates the need for
the fly-back diode
•ULN is better choice for simple design of circuit & PCB

Bộ môn Kỹ Thuật Điện Tử 14


Led7seg

decimal
point

Bộ môn Kỹ Thuật Điện Tử 15


Led7seg interface

Draw the schematic for 4 common anod Led7seg

Bộ môn Kỹ Thuật Điện Tử 16


Common Anod Led7seg interface

VCC

R402 R404 R406 R408


4.7k 4.7k 4.7k 4.7k

LED0 Q401 LED1 Q402 LED2 Q403 LED3 Q404


A1015 A1015 A1015 A1015
R401 R403 R405 R407
1k LSEG401 1k LSEG402 1k LSEG403 1k LSEG404
LED0 LED1 LED2 LED3

3 3 3 3

8 8 8 8

DP 5 DP 5 DP 5 DP 5
VCC VCC VCC VCC
A B C D E F G A B C D E F G A B C D E F G A B C D E F G
7
6
4
2
1
9
10

7
6
4
2
1
9
10

7
6
4
2
1
9
10

7
6
4
2
1
9
10
G

G
C
D

C
D

C
D

C
D
A
B

A
B

A
B

A
B

E
F

F
P1.0 R413 100 A
P1.1 R414 100 B
P1.2 R415 100 C
P1.3 R416 100 D
P1.4 R417 100 E
P1.5 R418 100 F
P1.6 R419 100 G

Bộ môn Kỹ Thuật Điện Tử 17


Paralell LCD interface

E communications
R/W bus
RS
DB7–DB0

8
LCD
controller

LCD Module

Bộ môn Kỹ Thuật Điện Tử 18


SPI/TFT LCD

https://www.displaymodule.com/

Bộ môn Kỹ Thuật Điện Tử 19


Temperature sensor
Protocol: one wire

DS1820

MCP9808

Bộ môn Kỹ Thuật Điện Tử 20


Temperature sensor
• Linear + 10-mV/°C Scale Factor
• 0.5°C Ensured Accuracy (at 25°C)
• Rated for Full −55°C to 150°C Range

https://www.mouser.com/blog/what-are-you-sensing-pros-and-cons-of-four-
temperature-sensor-types
Accuracy vs precision
Bộ môn Kỹ Thuật Điện Tử 21
Resistance Thermometer Detectors (RTD)

Bộ môn Kỹ Thuật Điện Tử 22


Bộ môn Kỹ Thuật Điện Tử 23
Thermo couple 

Bộ môn Kỹ Thuật Điện Tử 24


Bộ môn Kỹ Thuật Điện Tử 25
Bộ môn Kỹ Thuật Điện Tử 26
Thermo couple interface

Bộ môn Kỹ Thuật Điện Tử 27


Thermistor 

Bộ môn Kỹ Thuật Điện Tử 28


Temperature sensor comparison

Bộ môn Kỹ Thuật Điện Tử 29


Humidity sensor

Bộ môn Kỹ Thuật Điện Tử 30


Gyroscope

• Gyroscopes measure angular velocity


• Unit is rotations per minute (RPM), or degrees per second (°/s)

Device Range Interface Axes Power Requirements Bonus Features


power‐down and 
±250°/s,  sleep mode, 
±500°/s  temperature sensor, 
L3G4200D or  High shock 
±2000°/s SPI and I2C 3 2.4‐3.6V, 6.1mA survivability

Bộ môn Kỹ Thuật Điện Tử 31


Accelerometer

Accelerometer measure acceleration (static or dynamic)


Unit is meters per second squared (m/s2), or G-force (g, or 9.8m/s2)

Bộ môn Kỹ Thuật Điện Tử 32


Accelerometer

Device Range Interface Axes Power Requirements Bonus Features


ADXL193 +/‐250g Analog 1 3.5‐6V, 1.5‐2mA Self test
Selectable measuring 
range, free‐fall 
detection, 
tap/double‐tap 
detection, bandwidth 
selectable, 
ADXL345 ±2, 4, 8,  programmable 
16g SPI and I2C 3 2.0‐3.6V, 40‐145µA power modes

Bộ môn Kỹ Thuật Điện Tử 33


inertial measurement unit (IMU)

• IMU is the combination of gyroscope and accelerometer, sometimes also


magnetometers.
• Can be in one chip or separated, placed on 1 PCB

Bộ môn Kỹ Thuật Điện Tử 34


inertial measurement unit (IMU)
Device Range Interface Axes Power Requirements Bonus Features
Onboard Digital 
Motion Processor™ 
Accel:±2,  (DMP™), auxiliary I2C 
4, 8, 16g  bus to access external 
Gyro:±25 magnetometers and 
0, 500,  other sensors, Digital‐
MPU‐6050 1000,  Accel: 3  output temperature 
2000°/s I2C Gyro: 3 2.3 ‐ 3.4VDC sensor

• Complementary filter
• Kalman filter
• Mahony filter
• Madgwick filter

http://www.starlino.com/imu_kalman_arduino.html
Bộ môn Kỹ Thuật Điện Tử 35
IR (infrared)

TSOP31238
3V PH.MODULE 38KHZ

Bộ môn Kỹ Thuật Điện Tử 36


IrDA

Bộ môn Kỹ Thuật Điện Tử 37


Light sensor

Bộ môn Kỹ Thuật Điện Tử 38


Ambience sensor

Bộ môn Kỹ Thuật Điện Tử 39


Ambience sensor

Bộ môn Kỹ Thuật Điện Tử 40


Motion sensor

Bộ môn Kỹ Thuật Điện Tử 41


Environment monitor

PH sensor Orp sensor

https://www.atlas-scientific.com/

Bộ môn Kỹ Thuật Điện Tử 42

You might also like