ROYAL UNIVERSITY OF DHAKA
Assignment on (Mid Exam)
Microcontroller
Couse Code: EEE-109
Assignment Topic:
What is sensor? Write down the process of interfacing sensor in microcontroller.
Submitted To:
Ahmed Abdullah
Assistant Professor & Coordinator
Department of Computer Science & Engineering
Royal University of Dhaka
Submitted By:
Abid Ahmed
Student ID: 1801110181
Batch: 43 CSE(Day)
Semester: Fall-2020
Date of Submission: 31-10-2020
Sensor:
A sensor is a device that detects and responds to some type of input from the physical
environment. The specific input could be light, heat, motion, moisture, pressure, or any one
of a great number of other environmental phenomena. The output is generally a signal that is
converted to human-readable display at the sensor location or transmitted electronically over
a network for reading or further processing.
Different Types of Sensors
The following is a list of different types of sensors that are commonly used in various
applications. All these sensors are used for measuring one of the physical properties like
Temperature, Resistance, Capacitance, Conduction, Heat Transfer etc.
Temperature Sensor
Proximity Sensor
Accelerometer
IR Sensor (Infrared Sensor)
Pressure Sensor
Light Sensor
Ultrasonic Sensor
Smoke, Gas and Alcohol Sensor
Touch Sensor
Color Sensor
Humidity Sensor
Tilt Sensor
Flow and Level Sensor
The process of interfacing sensor in
microcontroller:
Overview:
Micro-controllers are useful to the extent that they communicate with other devices, such as
sensors,motors, switches, keypads, displays, memory and even other micro-controllers.
Many interface methods have been developed over the years to solve the complex problem of
balancingcircuit design criteria such as features, cost, size, weight, power consumption,
reliability, availability,manufacturability.
Many microcontrollersdesign typically mix multiple interfacing methods. In a very simplistic
form, a microcontroller system can be viewed as a system that reads from (monitors) inputs,
performs processing andwrites to (controls) outputs.
Figure: Input output devices and microcontroller interfaces.
Analog Inputs/Outputs:
Voltage-based control and monitoring.
Advantages:
Simple interface
Low cost for low-resolutions
High speed
Low programming overhead
Disadvantages:
High cost for higher resolutions
Not all microcontrollers have analoginputs/outputs built-in
Complicates the circuit design when external ADCor DAC are needed.
Short distance, few feet maximum
Voltage type:Typical ranges
0 to 2.5V
0 to 4V
0 to 5V
+/- 2.5V
+/- 4V
+/- 5V
Current type:Typical ranges
0-20mA
4-20mA
Figure: Microcontroller analog interface
RTD’s
Thermistors
Thermistors are thermally sensitive resistors and have, according to type, a negative (NTC),
or positive (PTC) resistance/temperature coefficient.
Manufactured from the oxides of the transition metals - manganese, cobalt, copper and
nickel, NTCthermistors are temperature dependent semiconductor resistors. Operating over a
range of -200°C to +1000°C, they are supplied in glass bead, disc, chips and probe formats.
Thermistors are typically very low-cost devices (under $1).
Thermocouples:
Thermocouples convert temperature to voltage. They rely on See beck effect which states that
a junctionof different metals will generate a voltage that is proportional to the temperature of
the metals. Thermocouples are low cost temperature sensors; they are readily available from
multiple sources andthey can measure a wide range of temperatures that cannot be measured
with semiconductor typetemperature sensor. For example, they can be used to measure the
temperature of the inside of aceramics kiln which can reach 1200 Celsius.
The temperature range of a thermocouple depends on the type of metals that make up the
thermocouple.
There are some industry standard types as shown in the table:
Thermocouples give out voltages in the range of micro volts so the output of a thermocouple
must beamplified before it can be converted into a digital value.
BiPOM offers a dedicated thermocouple board THERMOCOUPLE-1 that supports all the
popularthermocouple types (jumperselectable) and accepts up to 4 thermocouples
simultaneously.
Semiconductor Temperature Sensors:
Analog:
Digital:
Analog Digital Conversion:
Voltage to Frequency
Flash ADC
Successive Approximation
Dual-Slope Integration
Delta-Sigma
Successive approximation ADC:
Successive Approximation ADC’s are popular for use with microcontrollers due to low-cost
and ease of interfacing. A successive approximation ADC consists of:
Successive Approximation Register
Result Register
DAC
Comparator
Successive-approximation register counts by trying all values of bits starting with the most
significant bit and finishing at the least-significant bit. Throughout the count process, the
register monitors the comparator's output to see if the binary count is less than or greater
than the analog signal input, adjusting the bit values accordingly. This way, the DAC output
eventually converges on the analog input signal and the result is presented in the Result
register.
ADC can be external to the microcontroller or built-in:
Noise considerations:
Many sensors, such as thermocouples, generate a relatively small voltage so noise is always
an issue.The most common source of noise is the utility power lines (50 Hz or 60 Hz).
Typically, the bandwidth for temperature sensors is much lower than 50 or 60 Hz so a simple
low-passfilter will work well in many cases.
Other measures to keep noise away:
Keep the sensor wires short.
Use shielded sensor cables with twisted pair wires.
Use a dedicated precision voltage reference, not the microcontroller supply.
Use 4-20mA loop or even better, a digital signal for long cable runs.
Provide low impedance paths to ground at the ADC inputs if possible.
Average readings in software.
Analog ground and digital ground should connect at the ADC.
Analog ground should not carry large currents.
Ground planes should not carry any currents.
Thank You