Digital Logic and Micro controller
Digital Logic and Micro controller
ENVIRONMENTAL SENSORS
Applications
1. Weather Stations: These sensors are used to collect environmental data
such as temperature and humidity for personal weather stations.
2. HVAC Systems: They help monitor and control indoor climate.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 1
3. Greenhouses: Used to maintain optimal growing conditions by tracking
temperature and humidity.
4. IoT Applications: Integrated into smart devices for home automation.
5. Health Monitoring Devices: Used in systems where maintaining a specific
humidity and temperature is crucial.
Advantages
Ease of Use: Single-wire communication protocol simplifies wiring.
Low Power Consumption: Suitable for battery-operated devices.
Compact Size: Fits easily into small projects.
Limitations
DHT11: Limited range and lower accuracy make it unsuitable for high-
precision applications.
DHT22: Slower sampling rate means it's not ideal for real-time or fast-
changing environments.
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 2
outputs temperature as a digital value, eliminating the need for analog-to-digital
conversion.
How It Works
1. Temperature Sensing Element:
o The DS18B20 uses a silicon-based sensing element to measure
temperature. It is embedded within the sensor package and converts
thermal changes into an electrical signal.
2. 1-Wire Protocol:
o This sensor communicates using the 1-Wire protocol, which requires
only a single data line (plus ground) to transmit information. This
simplifies wiring and allows multiple sensors to share the same data
line.
3. Digital Output:
o The sensor outputs temperature readings directly in a digital format
(Celsius by default) with a precision of up to 12 bits. This eliminates
noise issues common with analog sensors.
Specifications
Feature Specification
Temperature Range -55°C to +125°C
Accuracy ±0.5°C (between -10°C and +85°C)
Resolution Configurable from 9 to 12 bits
Power Supply 3.0V to 5.5V
Interface 1-Wire Protocol
Applications
1. Cold Chain Monitoring: Tracks temperature in refrigerators and freezers.
2. Industrial Systems: Monitors machinery to ensure they operate within safe
temperature ranges.
3. Weather Stations: Provides precise environmental temperature data.
4. IoT Devices: Used in smart home systems for climate monitoring.
Advantages
High Precision: Accurate temperature readings up to ±0.5°C.
Simplicity: Digital output makes it easy to interface with microcontrollers.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 3
Multiple Sensors on One Bus: The unique 64-bit serial number for each
sensor allows multiple DS18B20 sensors to be connected to the same data
line.
Limitations
Slow Sampling Rate: Reading temperatures at maximum resolution can
take up to 750ms.
Limited Temperature Range: While adequate for most applications, it may
not suit extreme industrial conditions beyond its range.
Diagram
1. LM35
LM35 is a precision temperature sensor with an analog voltage output linearly
proportional to the temperature in Celsius (°C).
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 4
How It Works
It generates a voltage directly proportional to the temperature in °C.
The output increases by 10 mV per degree Celsius.
For example:
o At 25°C, the output is 250 mV.
Specifications
Feature Value
Temperature Range -55°C to +150°C
Output 10 mV/°C
Accuracy ±0.5°C (at room temp)
Power Supply 4V to 30V
Applications
HVAC systems
Battery temperature monitoring
Embedded systems requiring Celsius temperature readings
2. LM335
LM335 is similar to the LM35 but outputs a voltage proportional to the absolute
temperature in Kelvin (K).
How It Works
The output is scaled to 10 mV per Kelvin.
To convert to Celsius
T(°C)=T(K)−273.15T(°C) = T(K) - 273.15T(°C)=T(K)−273.15.
For example,
o At 300 K (room temperature), the output is 3.00 V.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 5
Specifications
Feature Value
Temperature Range -40°C to +100°C
Output 10 mV/K
Accuracy ±1°C
Power Supply 4V to 30V
Applications
Scientific experiments requiring Kelvin temperature scale
Precision temperature monitoring in physics labs
3. LM34
LM34 outputs a voltage proportional to temperature in Fahrenheit (°F).
How It Works
The output increases by 10 mV per degree Fahrenheit.
For example:
o At 77°F (25°C), the output is 0.77 V.
Specifications
Feature Value
Temperature Range -50°F to +300°F
Output 10 mV/°F
Accuracy ±1°F
Power Supply 4V to 30V
Applications
Systems where temperatures are conventionally measured in Fahrenheit
Industrial environments in countries using Imperial units
Common Features
1. Ease of Use: No calibration required; direct proportional output.
2. Low Power Consumption: Ideal for battery-powered devices.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 6
3. Analog Output: Easy to interface with ADCs in microcontrollers.
Comparison Table
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 7
D. K-Type Thermocouple with MAX6675 Amplifier
K-Type Thermocouple is a widely used temperature sensor known for its ability to
measure very high and low temperatures. It generates a voltage based on the
Seebeck Effect, where two dissimilar metals (Chromel and Alumel in the K-type)
produce a voltage when exposed to a temperature gradient.
The MAX6675 Amplifier is a dedicated integrated circuit designed to amplify and
convert the thermocouple’s analog signal into a digital output, making it easier to
interface with microcontrollers.
How It Works
K-Type Thermocouple
1. Seebeck Effect:
o The thermocouple consists of two different metals joined at one end
(the hot junction).
o The other ends (cold junction) are exposed to a reference temperature.
At 0°C: 0 mV
At 100°C: ~4.1 mV
At 500°C: ~20.6 mV
MAX6675 Amplifier
1. Signal Amplification:
o The MAX6675 amplifies the thermocouple’s tiny voltage output for
accurate reading.
2. Cold Junction Compensation:
o Thermocouple readings depend on the temperature of the cold
junction.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 8
o The MAX6675 includes a built-in temperature sensor to compensate for
changes in the cold junction temperature.
3. Digital Conversion:
o The MAX6675 converts the amplified signal into a 12-bit digital value.
Specifications
K-Type Thermocouple
Feature Specification
Temperature Range -200°C to +1350°C
Material Chromel (+) and Alumel (-)
Accuracy ±1.5°C (typical)
Voltage Output ~41 µV/°C
MAX6675 Amplifier
Feature Specification
Temperature Range 0°C to 1024°C
Resolution 0.25°C
Interface SPI
Power Supply 3.0V to 5.5V
Applications
1. Industrial Monitoring:
o Measures furnace, kiln, or oven temperatures.
2. HVAC Systems:
o Monitors high-temperature ducts and pipes.
3. Scientific Research:
o Used in laboratories for high-temperature experiments.
4. 3D Printing:
o Monitors extruder and heated bed temperatures.
Advantages
1. Wide Temperature Range:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 9
o Can measure extreme temperatures, making it versatile.
2. Accuracy:
o The MAX6675 provides precise temperature readings with
compensation.
3. Digital Output:
o Simplifies integration with microcontrollers.
4. Durable:
o The K-Type thermocouple can withstand harsh conditions.
Limitations
1. Accuracy Limitation:
±2°C to ±5°C error for very high or low temperatures.
2. Limited Amplifier Range:
The MAX6675 is restricted to 0°C–1024°C, while the K-Type
thermocouple itself can handle a broader range.
3. Cold Junction Dependency:
Requires compensation for accurate readings.
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 10
E. BME280 (Pressure, Temperature, and Humidity Sensor)
BME280 is a highly integrated environmental sensor that measures pressure,
temperature, and humidity in a compact package. It is widely used in IoT,
weather monitoring, and environmental sensing applications due to its low power
consumption, high accuracy, and versatility.
How It Works
1. Pressure Measurement:
o The BME280 uses a piezo-resistive sensing element to measure
atmospheric pressure.
o Changes in pressure cause tiny deflections in the diaphragm of the
sensor, altering the resistance. This change is converted into a precise
pressure value.
2. Temperature Measurement:
o A MEMS-based temperature sensor provides temperature readings,
which are also used for temperature compensation in pressure and
humidity measurements.
3. Humidity Measurement:
o A capacitive humidity sensor measures the relative humidity (RH).
o The sensor detects water vapor in the air by measuring changes in the
dielectric constant of the sensor's substrate.
4. Data Communication:
o The sensor communicates via I2C or SPI, making it easy to integrate
with microcontrollers.
Specifications
Feature Specification
Pressure Range 300 hPa to 1100 hPa
Temperature Range -40°C to +85°C
Humidity Range 0% to 100% RH
Accuracy (Pressure) ±1 hPa
Accuracy (Temp) ±0.5°C
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 11
Accuracy (Humidity) ±3% RH
Interface I2C or SPI
Power Consumption 3.6 µA (in sleep mode)
Applications
1. Weather Monitoring Stations:
o Tracks temperature, humidity, and atmospheric pressure for
forecasting.
2. Altimeters:
o Calculates altitude based on atmospheric pressure.
3. IoT Devices:
o Used in smart homes for indoor climate monitoring.
4. GPS Navigation:
o Enhances altitude accuracy in outdoor navigation systems.
5. Aviation:
o Measures pressure for altitude and weather data in flight instruments.
Advantages
1. Highly Integrated:
o Combines three environmental parameters in one device.
2. Compact Size:
o Ideal for portable and space-constrained applications.
3. Power-Efficient:
o Operates with minimal energy, suitable for battery-powered devices.
4. Versatile Communication:
o Compatible with I2C and SPI protocols.
Limitations
1. Environmental Constraints:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 12
o The sensor may degrade over time if exposed to water or
contaminants.
2. Limited Pressure Accuracy:
o ±1 hPa is sufficient for most applications but may not be suitable for
precision measurements like barometry.
Diagram
SPI Mode
o Use MOSI, MISO, SCK, and CS pins for communication
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 13
models)
GND GND Ground connection
SCL A5 (Uno), D21 (Mega) I2C clock line
SDA A4 (Uno), D20 (Mega) I2C data line
Feature Specification
Pressure Range 300 hPa to 1250 hPa
Temperature Range -40°C to +85°C
Pressure Resolution 0.08 Pa
Altitude Resolution 0.2 meters
Temperature Accuracy ±0.5°C
Pressure Accuracy ±0.5 hPa
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 14
Interface I2C (up to 3.4 MHz) / SPI (up to 10 MHz)
Applications
1. Drones and UAVs:
o For accurate altitude control and flight stabilization.
2. Weather Stations:
o To monitor atmospheric pressure and temperature.
3. Navigation Systems:
o To enhance GPS accuracy with altitude data.
5. Scientific Experiments:
o For pressure and altitude monitoring in lab setups.
Advantages
1. High Accuracy:
o Provides precise pressure and altitude readings.
4. Dual Interfaces:
o Supports both I2C and SPI for versatile connectivity.
Limitations
1. Temperature Dependency:
o Although compensated, the sensor’s accuracy might drift slightly in
extreme temperatures.
2. Environmental Constraints:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 15
o Requires protection in environments with high humidity, water
exposure, or dust.
3. Altitude Calculation Assumptions:
o Assumes a standard atmospheric model, which may cause errors in
non-standard conditions.
Interfacing BMP388 with Arduino
Connections (I2C Mode)
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 16
G. MQ Sensors
MQ sensors are a series of gas sensors that detect the presence and concentration
of various gases in the air. These sensors are widely used in safety systems,
environmental monitoring, and industrial applications due to their affordability, ease
of use, and versatility.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 17
MQ-7 Carbon Monoxide CO 20 - 2,000
MQ-8 Hydrogen Hydrogen 100 - 10,000
MQ-9 Carbon Monoxide and Methane CO, Methane 10 - 10,000
Air Quality Ammonia, Alcohol, 10 - 1,000
MQ-135
Benzene, Smoke
Specifications
Feature Specification
Operating Voltage 5V
Output Analog and Digital (via Comparator)
Preheat Time 20–60 seconds
Response Time < 10 seconds
Operating Temperature -20°C to +50°C
Lifespan ~2 years
Applications
1. Gas Leak Detection:
o MQ-2, MQ-5, and MQ-6 for LPG or methane leaks.
2. Breath Analyzers:
o MQ-3 for alcohol detection.
4. Fire Safety:
o MQ-2 and MQ-7 for smoke and CO detection.
5. Industrial Monitoring:
o To ensure safe levels of specific gases.
Advantages
1. Affordable and Versatile:
o Available for detecting a wide range of gases.
2. Simple Integration:
o Easy to use with microcontrollers.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 18
Limitations
1. Heater Power Consumption:
o Requires continuous heating, which increases power consumption.
2. Environmental Sensitivity:
o May provide inaccurate readings in high humidity or fluctuating
temperatures.
3. Calibration Requirement:
o Must be calibrated for precise measurements.
4. Limited Lifespan:
o The sensing element degrades over time.
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 19
H. FC-37 or YL-83 Rain Sensor
The FC-37 and YL-83 Rain Sensors are simple and effective tools for detecting
rain or water presence. These sensors are widely used in weather monitoring
systems, automatic wipers, smart irrigation systems, and outdoor IoT projects. The
sensor consists of a rain detection module and a control module with an onboard
comparator.
How It Works
1. Rain Detection Plate:
o The rain detection plate is a PCB with conductive traces. When water
droplets fall on it, they form a conductive path between the traces,
decreasing resistance.
2. Signal Generation:
o The change in resistance modifies the voltage output, which is
interpreted as rain presence and intensity.
3. Control Module:
o The sensor control module uses an LM393 comparator to generate a
digital output (HIGH/LOW) based on a threshold set using a
potentiometer.
o The module also provides an analog output for precise monitoring of
water intensity.
Specifications
Feature Specification
Operating Voltage 3.3V - 5V
Output Digital (HIGH/LOW) and Analog (0-5V)
Dimensions ~30mm x 50mm
Operating Temperature -40°C to +85°C
Control Module Chip LM393 Comparator
Applications
1. Weather Stations:
o Detect rain to monitor weather conditions.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 20
2. Automatic Wiper Systems:
o Trigger wipers in vehicles when rain is detected.
3. Smart Irrigation:
o Delay watering when rain is detected.
4. IoT Projects:
o Integrate into outdoor sensors for water presence detection.
Advantages
1. Simple and Reliable:
o Easy to use with minimal external components.
2. Dual Outputs:
o Provides both digital and analog signals for flexible use.
3. Adjustable Sensitivity:
o Potentiometer allows threshold customization for rain intensity.
Limitations
1. Corrosion:
o The rain detection plate is prone to corrosion if not coated or
maintained.
2. Limited Precision:
o Cannot differentiate between light and heavy rain without calibration.
3. Environmental Sensitivity:
o False positives can occur due to condensation or dew.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 21
VCC 5V Power supply.
GND GND Ground connection.
DO (Digital) D2 Digital output for rain detection.
AO (Analog) A0 Analog output for rain intensity.
2. Vehicle Safety:
o Trigger rain sensors to improve wiper response in real time.
3. Agriculture:
o Monitor rainfall to optimize irrigation schedules.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 22
I. YL-69 or HL-69 Soil Moisture Sensor
The YL-69 and HL-69 Soil Moisture Sensors are affordable and effective tools for
monitoring soil moisture levels. These sensors are widely used in agriculture,
gardening, and environmental monitoring projects. The sensor consists of a
moisture-detection probe and a control module with an onboard comparator.
How It Works
1. Moisture Detection Probe:
o The probe has two electrodes that are inserted into the soil.
2. Signal Generation:
o The control module converts the resistance into a corresponding
voltage signal.
3. Control Module:
o Equipped with an LM393 comparator to provide both analog and
digital outputs.
o A potentiometer adjusts the digital output threshold.
Specifications
Feature Specification
Operating Voltage 3.3V - 5V
Output Analog (0-5V) and Digital (HIGH/LOW)
Probe Dimensions ~60mm x 20mm
Control Module Chip LM393 Comparator
Operating Temperature 10°C - 50°C
Applications
1. Smart Irrigation Systems:
o Automate watering based on soil moisture levels.
2. Environmental Monitoring:
o Monitor soil conditions in gardens or farmlands.
3. IoT Projects:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 23
o Integrate into smart devices for soil health tracking.
4. Greenhouses:
o Ensure optimal moisture levels for plant growth.
Advantages
1. Affordable:
o Low-cost solution for moisture detection.
2. Dual Outputs:
o Both digital and analog signals for flexible use.
3. Easy to Integrate:
o Works seamlessly with microcontrollers like Arduino or Raspberry Pi.
Limitations
1. Corrosion:
o The electrodes can corrode over time if left in soil continuously.
2. Environmental Sensitivity:
o Prone to errors in highly conductive soils or extreme conditions.
3. Limited Lifespan:
o Frequent cleaning and maintenance are required for accuracy.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 24
1. Probe:
o Two metal electrodes detect soil moisture through resistance changes.
2. Control Module:
o LM393 comparator for digital threshold output.
3. Smart Greenhouses:
o Automate climate and soil moisture control for optimal plant health
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 25
systems, home automation, lighting systems, and other applications where motion
detection is required.
How It Works
1. Infrared Radiation:
o All objects emit infrared (IR) radiation based on their temperature.
Specifications
Feature Specification
Operating Voltage 4.5V – 20V (commonly 5V)
Output Digital (HIGH/LOW)
Detection Range ~5m – 12m (depending on model)
Detection Angle ~110° to 120°
Delay Time Adjustable (0.3s to 5min, typical)
Trigger Modes Single Trigger / Continuous Trigger
2. Fresnel Lens:
o Focuses infrared radiation onto the sensor.
4. Potentiometers:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 26
o Adjust the detection sensitivity and delay time.
Applications
1. Security Systems:
Detect intrusions and trigger alarms or notifications.
2. Automatic Lighting:
Turn lights on/off based on motion detection.
3. Energy Conservation:
Automatically turn off appliances in unoccupied areas.
4. Home Automation:
Trigger smart devices when motion is detected.
5. Robotics:
Detect nearby obstacles or moving objects.
Advantages
1. Low Power Consumption:
o Ideal for battery-operated devices.
Limitations
1. Environmental Sensitivity:
o Heat sources like sunlight or heaters can cause false triggers.
2. No Object Identification:
o Cannot differentiate between objects.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 27
Interfacing PIR Sensor with Arduino
Connections
Trigger Modes
1. Single Trigger Mode:
o The sensor sends a HIGH signal once when motion is detected, then
LOW after the delay time.
o Ideal for simple on/off actions.
Adjustments
1. Sensitivity:
o Adjust using the potentiometer to modify the detection range.
2. Delay Time:
o Set the time the output stays HIGH after detecting motion.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 28
Applications in Real-Life Projects
1. Motion-Activated Lights:
o Automatically turn on lights when someone enters a room.
3. Energy-Saving Systems:
o Switch off unused appliances in unoccupied areas.
3. Echo Detection:
o The sensor's receiver detects the returning wave and calculates the
time taken for the round trip.
4. Distance Calculation:
o Using the formula
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 29
Specifications
Feature Specification
Operating Voltage 5V
Operating Current <15mA
Operating Frequency 40 kHz
Measurement Range 2 cm – 400 cm
Accuracy ±3 mm
Trigger Pulse Width 10 µs
Output Digital pulse proportional to distance
Operating Temperature -15°C to +70°C
Applications
1. Robotics:
o Obstacle detection and avoidance.
2. Automation Systems:
o Measure liquid levels in tanks or detect objects.
3. IoT Projects:
o Integrate into smart devices for distance monitoring.
4. Parking Assistance:
o Detect proximity to obstacles in vehicles.
5. Security Systems:
o Monitor restricted areas for movement or presence.
Advantages
1. Non-Contact Measurement:
o Measures distance without physical contact.
2. Affordable:
o Cost-effective for various applications.
3. Wide Range:
o Covers distances from 2 cm to 4 meters.
4. Simple Interfacing:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 30
o Works easily with microcontrollers like Arduino.
Limitations
1. Environmental Sensitivity:
o Performance is affected by temperature and humidity.
2. Hard Surfaces:
o Reflects better from flat surfaces than irregular ones.
3. Dead Zone:
o Unable to detect objects closer than 2 cm.
2. Echo Pin:
o Receives the reflected pulse.
3. Calculation:
o The time difference is used to compute the distance.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 31
3. Positioning:
o Place the sensor perpendicular to the surface for optimal detection.
3. Parking Sensors:
o Alert users of nearby obstacles while parking vehicles.
Diagram
How It Works
1. Accelerometer:
o Measures linear acceleration (g-force) along three axes: X, Y, and Z.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 32
2. Gyroscope:
o Measures angular velocity (rate of rotation) in degrees per second (°/s)
along three axes: X, Y, and Z.
o Ideal for tracking rotational motion.
4. I²C Communication:
o Data is transmitted via the I²C protocol for easy integration with
microcontrollers.
Specifications
Feature Specification
Operating Voltage 3.3V – 5V
Communication Protocol I²C (default address: 0x68)
Accelerometer Range ±2g, ±4g, ±8g, ±16g
Gyroscope Range ±250, ±500, ±1000, ±2000 °/s
Power Consumption ~3.6mA
Sampling Rate Up to 1 kHz
Operating Temperature -40°C to +85°C
Applications
1. Drones:
o Stabilization and orientation control.
2. Robotics:
o Balance control (e.g., self-balancing robots).
3. Wearables:
o Fitness trackers or smartwatches for motion sensing.
4. Gaming Devices:
o Motion controllers for immersive gameplay.
5. Gesture Recognition:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 33
o Detecting and interpreting hand movements.
Advantages
1. Compact and Lightweight:
o Combines accelerometer and gyroscope in a small package.
2. High Sensitivity:
o Accurate motion and orientation detection.
3. Integrated DMP:
o Offloads computational work from the microcontroller.
Limitations
1. Temperature Drift:
o Requires calibration for consistent results in varying environments.
2. Noise Sensitivity:
o Outputs raw data that may need filtering.
3. Complex Calibration:
o Requires algorithms for precise orientation computation.
2. Drone Stabilization:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 34
o Process sensor data to maintain steady flight.
3. Gesture-Controlled Devices:
o Detect hand motions for controlling gadgets or robots.
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 35
Feature DS1307 DS3231
Accuracy ±2 seconds/day ±2 ppm (±0.1728 seconds/day) due
(uncompensated) to temperature compensation
Temperature Compensation No Yes
Operating Voltage 4.5V–5.5V 2.3V–5.5V
Battery Voltage 3.3V (typical CR2032) 3.3V (typical CR2032)
Temperature Range 0°C to +70°C -40°C to +85°C
Additional Features Basic RTC Integrated temperature sensor,
alarms, and 32 kHz output
Core Features
1. Timekeeping:
o Tracks seconds, minutes, hours, day, date, month, and year.
Applications
1. Data Logging:
o Timestamp measurements from sensors in IoT applications.
2. Automation:
o Scheduled tasks such as turning devices on/off at specific times.
3. Clocks:
o Create digital clocks for homes, vehicles, or industrial use.
4. Reminder Systems:
o Trigger alarms for time-sensitive processes.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 36
5. Wearables:
o Timekeeping in smartwatches and fitness trackers.
Specifications
DS1307
Feature Specification
Operating Voltage 4.5V–5.5V
Time Format 12-hour/24-hour
Battery Backup Yes (CR2032 coin cell)
I²C Address 0x68
Power Consumption ~500 nA during battery backup
DS3231
Feature Specification
Operating Voltage 2.3V–5.5V
Temperature Accuracy ±3°C (typical)
Alarm Capability Yes, two programmable alarms
Temperature Sensor Integrated
I²C Address 0x68
Advantages
1. DS1307:
o Simple and affordable.
2. DS3231:
o High accuracy with temperature compensation.
Limitations
1. DS1307:
o Loses accuracy over time, especially in varying temperatures.
2. DS3231:
o Higher cost compared to DS1307.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 37
Interfacing DS1307/DS3231 with Arduino
Connections
2. Data Logger:
o Record temperature, humidity, or other sensor readings with
timestamps.
3. Alarms:
o Set programmable alarms using DS3231 for precise scheduling.
4. Event-Based Systems:
o Activate processes based on specific times.
Diagrams
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 38
A load cell is a transducer that converts force (or weight) into an electrical signal.
The signal is typically very small, requiring amplification and conversion into a
digital format. This is achieved using the HX711 amplifier module, which is a
precise 24-bit ADC (Analog-to-Digital Converter) designed for weight measurement.
The combination of a load cell and HX711 is widely used in electronic weighing
scales, industrial force measurement systems, and IoT projects requiring weight or
pressure sensing.
How It Works
1. Load Cell:
o Contains strain gauges bonded to a flexible structure. When weight
or force is applied, the strain gauge's resistance changes
proportionally.
o The resistance change causes a small voltage difference, which is the
raw signal.
2. HX711 Amplifier:
o Amplifies the small voltage from the load cell.
o Converts the amplified analog signal into a digital signal using a 24-bit
ADC.
o Transmits the digital data to a microcontroller via a serial interface.
Specifications
Load Cell:
Feature Specification
Material Aluminum or Steel
Rated Load Varies (e.g., 5kg, 10kg, 50kg, etc.)
Sensitivity ~2mV/V
Excitation Voltage 5V to 10V
Output Resistance 350Ω
HX711 Amplifier
Feature Specification
Operating Voltage 2.6V–5.5V
ADC Resolution 24-bit
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 39
Input Channels 2 (A and B)
Gain Options 32, 64, 128
Interface Serial (Clock and Data)
Applications
1. Weighing Scales:
o Household, industrial, or precision scales.
2. Force Measurement:
o Measure force in machines or robotic grippers.
3. IoT Applications:
o Smart weighing systems or inventory monitoring.
4. Process Automation:
o Weight-based quality control in manufacturing.
Advantages
1. High Accuracy:
o 24-bit resolution provides precise weight readings.
2. Compact Design:
o Easy to integrate into systems.
Limitations
1. Environmental Factors:
o Temperature changes can affect accuracy; compensation may be
needed.
2. Sensitivity to Noise:
o Shielded cables and proper grounding are required for reliable
readings.
3. Calibration Requirement:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 40
o Must be calibrated for consistent and accurate measurements.
Diagram
2. Robotics:
o Measure the force exerted by robotic arms or grippers.
3. Quality Control:
o Ensure precise ingredient weights in food or chemical production.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 41
C. Fingerprint Sensor Module (FPM10A)
The FPM10A is a compact fingerprint sensor module capable of capturing, storing,
and matching fingerprints. It is widely used in security systems like door locks,
safes, and attendance systems. The module integrates a fingerprint scanner and an
onboard DSP (Digital Signal Processor) to process captured images.
How It Works
1. Image Capture:
o The sensor scans the ridges and valleys of a finger to create a high-
resolution image.
2. Feature Extraction:
o The module processes the image to extract unique features called
minutiae.
3. Storage:
o Extracted fingerprint templates are stored in the module's internal
memory.
4. Matching:
o During verification, the module compares the newly scanned
fingerprint with stored templates to determine a match.
Features
1. Onboard Processing:
o The FPM10A handles image processing, feature extraction, and
template matching internally, reducing the workload on the
microcontroller.
2. Storage Capacity:
o Stores up to 1000 fingerprint templates in its flash memory.
3. Communication:
o Supports UART (TX/RX) for interfacing with microcontrollers like
Arduino, ESP32, or Raspberry Pi.
4. Two Modes of Operation:
o Enrolling Mode: Add new fingerprints to the module.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 42
o Verification Mode: Match a fingerprint against stored templates.
Specifications
Feature Specification
Operating Voltage 3.6V–6V
Current Consumption <100mA
Interface UART (TTL Logic)
Image Resolution 500 DPI
Storage Capacity 1000 fingerprints
Verification Speed <1 second
Module Size 56mm x 20mm x 21.5mm
Applications
1. Access Control Systems:
o Secure doors, lockers, or safes using fingerprint authentication.
2. Attendance Systems:
o Automate attendance logging in schools, offices, and factories.
3. IoT Security:
o Add biometric security to IoT devices like smart home systems.
4. Embedded Devices:
o Integrate into robotics or DIY electronics projects.
Advantages
1. High Security:
o Fingerprints provide a unique and non-replicable method of
authentication.
2. Compact and Standalone:
o The module can function independently without requiring external
image processing.
3. Ease of Integration:
o UART communication simplifies connections with popular
microcontrollers.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 43
Limitations
1. Environmental Sensitivity:
o Moist or dirty fingers may reduce the sensor's effectiveness.
2. Limited Memory:
o Only supports up to 1000 templates; not suitable for large-scale
systems.
3. Dependency on Physical Contact:
o Cannot be used for remote biometric verification.
3. Personalized Gadgets:
o Configure custom actions for specific users based on fingerprint IDs.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 44
IV. DISPLAYS
A. OLED Display
An OLED (Organic Light Emitting Diode) display is a type of flat-panel display
that uses organic compounds to emit light when electricity is applied. Unlike
traditional LCDs (Liquid Crystal Displays), OLEDs do not require a backlight, as each
pixel emits its own light. This results in better contrast, thinner panels, and lower
power consumption. OLEDs are used in a wide range of applications, including
smartphones, TVs, wearables, and embedded systems.
How It Works
1. Organic Materials:
o The display is composed of organic compounds that emit light when
current passes through them.
2. Pixels:
o Each pixel in an OLED display consists of a combination of red, green,
and blue OLED materials, allowing for full-color display capabilities.
3. Electrodes:
o OLED displays use two electrodes: one is transparent (for the top
layer), and the other is opaque (for the bottom layer), facilitating
current flow through the organic materials.
4. Emitting Light:
o When voltage is applied, the organic materials emit light directly,
allowing each pixel to glow without the need for an external backlight.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 45
Specifications of Common OLED Displays
0.96-inch OLED Display (most commonly used in Arduino projects)
Feature Specification
Display Size 0.96 inches
Resolution 128x64 pixels
Color Depth Monochrome (Black and White)
Communication I²C (or SPI, depending on module)
Operating Voltage 3.3V–5V
Power Consumption Low power, typically <20mA
Dimensions 27.5mm x 27.5mm x 4mm
Applications
1. Wearables:
o OLEDs are commonly used in fitness trackers and smartwatches due to
their low power consumption and compact size.
2. Embedded Systems:
o Used in Arduino-based projects, IoT devices, and robotics to display
sensor data, status, or feedback to users.
3. Displays in Consumer Electronics:
o In smartphones, TVs, and laptops for their vibrant colors, deep blacks,
and energy-efficient properties.
4. Automotive:
o OLEDs are becoming popular for dashboards, infotainment systems,
and heads-up displays in vehicles.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 46
o OLED displays can be made thinner and more flexible than LCDs,
allowing for curved or foldable screens.
4. Wide Viewing Angles:
o OLED displays have wider viewing angles than traditional LCDs, with
no color distortion or brightness loss.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 47
o Build a simple digital clock that shows current time using an RTC (Real-
Time Clock) module and display it on the OLED.
4. Smart Devices:
o Display statuses like battery level, network connection, or user inputs.
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 48
To control the individual LEDs, driver ICs (such as the MAX7219) are
used. These chips handle the multiplexing and simplify the control of
the matrix.
4. Controlling Pixels:
By activating a specific row and column, a particular pixel is
illuminated. For instance, to light up the LED at position (1,1), you
activate row 1 and column 1. The same concept applies for creating
characters or images by controlling multiple pixels.
Feature Specification
Matrix Size 8x8 (64 LEDs)
Voltage 5V (Typically)
Interface Common interfaces: SPI, I2C
LED Color Typically Red, Green, or RGB
Control IC MAX7219 (for SPI-based control)
Current Consumption ~100mA for full brightness
Dimensions 32mm x 32mm x 6mm (depends on model)
Applications
1. Scrolling Text:
Display scrolling messages or announcements, typically used in
information boards, digital signage, or home projects.
2. Clocks and Timers:
Display time and countdown timers on digital clocks or countdown
projects.
3. Games:
Create simple pixel-based games like Pong or Snake.
4. Simple Graphics:
Show basic graphics, logos, or symbols using the individual dots in the
matrix.
5. Indicators:
Use as status indicators for devices or machines (e.g., battery level,
temperature, etc.).
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 49
1. Flexible Display:
Capable of displaying text, symbols, and basic graphics, offering
flexibility in visual output.
2. Compact Size:
The 8x8 matrix is relatively small and compact, making it suitable for
embedded systems and small projects.
3. Low Cost:
Dot matrix displays are inexpensive compared to larger, more complex
displays like OLED or TFT.
4. Low Power Consumption:
When using multiplexing techniques, the power consumption can be
optimized, especially in low-power devices.
Limitations
1. Low Resolution:
With only 64 LEDs, the display resolution is low, limiting the complexity
of the content that can be shown.
2. No Color Display:
Typically limited to a single color (red, green, or RGB), which may not
be suitable for applications requiring full-color images.
3. Limited Control:
Without the use of multiplexing or driver ICs, controlling the entire
matrix can be complex and may require a lot of wiring and pins.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 50
Wiring (MAX7219 and 8x8 Dot Matrix)
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 51
C. LCD (Liquid Crystal Display)
A Liquid Crystal Display (LCD) is a type of flat-panel display technology that uses
liquid crystals to produce visible images. These liquid crystals do not emit light by
themselves but instead manipulate light passing through them to create images.
LCDs are widely used in various electronic devices like calculators, clocks, TVs,
computer monitors, and embedded systems due to their low power consumption,
thin form factor, and versatility.
How It Works
1. Liquid Crystal Layer:
At the core of an LCD is a layer of liquid crystals, which are molecules
that align differently when an electric current is applied. These
molecules control the passage of light through the display.
2. Backlight:
LCDs require an external light source (backlight) since the liquid
crystals do not emit light. The backlight is typically provided by LEDs
placed behind or along the edges of the display.
3. Polarizers:
LCDs use two polarizing filters (one at the front and one at the back) to
control the direction of light passing through the display. The liquid
crystals align themselves to either block or allow light to pass
depending on the applied voltage.
4. Display Segments:
LCDs can be categorized into segment-based displays (such as 7-
segment displays) or pixel-based displays (like graphical LCDs). In
pixel-based displays, each pixel is controlled independently to display a
wide range of images or text.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 52
Graphical displays have a matrix of pixels (e.g., 128x64, 240x128) and
can display a wider variety of images, text, and custom graphics.
Used in devices requiring more complex outputs, like handheld gaming
devices, digital cameras, and advanced embedded systems.
Feature Specification
Display Size 16 characters per line x 2 lines
Resolution 16x2 (32 characters in total)
Interface Parallel (or I²C via adapter)
Operating Voltage 5V
Backlight Color Typically Green or Blue
Dimensions 80mm x 36mm x 12mm
Current Consumption ~20mA (depends on backlight setting)
Control IC HD44780 or compatible
Applications
1. Embedded Systems:
o LCDs are frequently used to display information like sensor readings,
system statuses, and user interfaces in embedded systems.
2. Consumer Electronics:
o Commonly found in household electronics such as microwave ovens,
calculators, alarm clocks, and thermostats.
3. Data Displays:
o Used in applications that require continuous display of data, such as
digital meters, stock tickers, or weather stations.
4. Industrial Equipment:
o LCDs are used in machines, power meters, and other industrial
equipment for displaying operational data, error messages, and system
statuses.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 53
o LCDs consume less power compared to other displays like OLED or
CRT, especially in character displays, where only a small part of the
screen needs to be lit.
2. Thin and Lightweight:
o The flat nature of LCDs makes them ideal for portable and space-
constrained applications.
3. High Visibility:
o LCDs can be easily viewed in bright conditions with a proper backlight,
making them ideal for outdoor and daylight use.
4. Cost-Effective:
o LCD technology is widely used and inexpensive, making it affordable
for a wide range of applications.
Limitations
1. Limited Viewing Angles:
o LCDs generally have a limited viewing angle, and the display may
appear washed out when viewed from extreme angles.
2. Requires Backlight:
o Unlike OLED, which emits light on its own, an LCD requires a backlight,
which increases its power consumption, particularly in large screens.
3. Lower Contrast Ratio:
o LCDs typically have a lower contrast ratio compared to OLEDs,
especially in bright scenes or dark rooms, due to their reliance on
backlighting.
4. Slower Response Time:
o LCDs generally have slower response times than OLED or LED displays,
which may be noticeable in fast-moving visuals.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 54
RS D12 Register select
RW GND Read/Write mode
E D11 Enable
D4 D5 Data pin 4
D5 D4 Data pin 5
D6 D3 Data pin 6
D7 D2 Data pin 7
A (Anode) 5V Backlight (if applicable)
K (Cathode) GND Backlight ground
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 55
V. COMMUNICATION MODULES
How It Works
1. Radio Frequency Communication:
o The MFRC522 communicates using RFID technology that operates on
the 13.56 MHz frequency band. RFID tags contain a chip and an
antenna, and when the tag is brought near the RFID reader, it
communicates wirelessly with the reader.
2. Antenna:
o The MFRC522 module uses an antenna to transmit and receive signals.
When an RFID tag comes into range, the antenna generates a
magnetic field that powers the tag and facilitates communication
between the tag and the reader.
3. Modulation:
o The MFRC522 uses Amplitude Shift Keying (ASK) modulation to
communicate with RFID tags. The RFID tag responds by changing the
magnetic field, which is detected by the reader's antenna.
4. Data Transfer:
o The reader sends and receives data in digital form, allowing it to read
unique IDs from RFID tags and, depending on the application, store or
process this data.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 56
5. Communication with Microcontroller:
o The MFRC522 communicates with a microcontroller (such as Arduino)
using SPI (Serial Peripheral Interface). This communication is fast
and efficient, allowing the system to read RFID data and take
corresponding actions quickly.
Feature Specification
Operating Frequency 13.56 MHz
Interface SPI (Standard), I2C (with additional module)
Operating Voltage 3.3V to 5V
Current Consumption 13.5mA (idle), up to 30mA (active)
Range Up to 5 cm (depends on tag and environment)
Protocol ISO/IEC 14443 A/MIFARE
Data Storage Unique ID for each tag
Control IC MFRC522
Applications
1. Access Control Systems:
o RFID is commonly used in access control systems, where RFID tags (in
the form of cards, key fobs, or wristbands) are used to grant access to
secure areas.
2. Inventory Management:
o RFID tags can be placed on items, and the MFRC522 can be used to
track inventory by reading the tags when items are scanned.
3. Cashless Payments:
o RFID readers are used in contactless payment systems, allowing users
to pay by simply tapping their RFID-enabled card or device.
4. Attendance Systems:
o RFID is often used in schools and workplaces for attendance systems
where an RFID tag (student ID or employee card) is scanned to record
presence.
5. Library Systems:
o RFID tags are placed in books, and the MFRC522 is used to track books
during check-out and return.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 57
Advantages of MFRC522 RFID Reader
1. Low Cost:
o The MFRC522 module is inexpensive and widely available, making it
accessible for hobbyists, students, and developers.
2. Ease of Use:
o The MFRC522 is easy to interface with microcontrollers like Arduino,
with available libraries and sample code.
3. Fast Data Transfer:
o The module uses SPI for fast and efficient data transfer, ensuring quick
reading and processing of RFID data.
4. Compact Size:
o The module is small and lightweight, making it suitable for use in
embedded systems and portable applications.
Limitations
Short Range:
The typical operating range is about 5 cm or less, which limits its use in
applications requiring a longer read distance.
Limited Tag Compatibility:
The MFRC522 is designed to work with ISO 14443-A RFID tags and certain
MIFARE tags, limiting compatibility with other RFID standards.
Power Consumption:
Although the MFRC522 is low-power, it still requires a constant power supply
to function and may not be ideal for battery-powered projects unless carefully
managed.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 58
IRQ Not connected Interrupt (optional)
GND GND Ground
RST D9 Reset signal
VCC 5V Power supply
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 59
B. GSM (Global System for Mobile Communications) Module
The GSM module is a device that allows microcontrollers (like Arduino or Raspberry
Pi) to communicate over a cellular network, enabling them to send and receive SMS
messages, make and receive voice calls, and even connect to the internet using
mobile data. One of the most commonly used GSM modules is the SIM900 or
SIM800, which provides a low-cost way to integrate cellular communication into
various projects.
GSM modules are widely used in projects that require remote communication, such
as home automation systems, vehicle tracking, remote weather stations, and
security systems.
How It Works
1. Communication via Cellular Network:
The GSM module communicates with a mobile network (cellular tower)
via SIM cards. Once the module is powered and a valid SIM card is
inserted, it can access mobile networks to send SMS messages, make
calls, or access mobile data services.
2. Serial Communication:
GSM modules typically use serial communication (UART), allowing
them to communicate with microcontrollers. Through this interface,
commands are sent to the GSM module to perform actions like sending
an SMS, receiving messages, or making a call.
3. AT Commands:
The GSM module uses AT commands (Attention commands) to
interface with the microcontroller. These commands are used to control
the module’s functions, such as sending SMS, checking signal strength,
and dialing a number.
4. Power Requirements:
GSM modules require a power supply of 3.4V to 4.4V, depending on
the module. A separate power supply is often used to avoid power
fluctuations from the microcontroller.
Specifications of GSM Modules (e.g., SIM900)
Feature Specification
Operating Voltage 3.4V to 4.4V
Communication Interface UART (Serial), sometimes USB or SPI
Frequency Band 850 MHz, 900 MHz, 1800 MHz, 1900 MHz (Quad-band)
Data Communication GPRS (General Packet Radio Service)
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 60
SMS Send and receive SMS (Text messages)
Call Functionality Make and receive voice calls
Power Consumption ~60-250mA (depends on activity, e.g., sending SMS)
Standby Current ~1-2mA
Control Interface AT Commands (via Serial Communication)
Size ~30mm x 25mm
Applications
1. Remote Communication:
o SMS Alerts: The GSM module is used in systems like alarm systems
to send SMS alerts when triggered. It can also be used in weather
stations to send periodic updates.
2. Home Automation:
o GSM is commonly integrated into home automation systems, allowing
users to control home appliances via SMS. For example, turning on/off
lights, fans, or gates remotely using SMS commands.
3. Vehicle Tracking Systems:
o GSM modules are used in GPS tracking systems for vehicles. The GSM
module sends real-time location data via SMS or GPRS to a central
server or a mobile phone.
4. Security Systems:
o GSM modules are used in security systems where, in case of
intrusion, the system sends an SMS alert or makes a phone call to a
predefined number to notify the user.
5. Health Monitoring:
o In remote health monitoring systems, the GSM module sends
patient data (like heart rate, temperature) via SMS to healthcare
providers for quick monitoring and action.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 61
o GSM modules are generally inexpensive, and using a simple prepaid
SIM card in a GSM module makes it a low-cost communication
solution.
3. Wide Range of Applications:
o The ability to send SMS, make calls, and even use mobile data enables
a wide variety of uses, from simple alerts to complex remote
communication systems.
4. No Need for Wi-Fi or Internet:
o Unlike Wi-Fi-based communication systems, GSM does not require an
internet connection, making it highly suitable for areas with poor or no
internet coverage.
3. Power Consumption:
o GSM modules can be power-hungry, especially during active
communication (e.g., sending SMS or making calls), which may not be
ideal for battery-powered devices unless managed efficiently.
4. SIM Card Management:
o GSM modules require a SIM card, which introduces additional costs,
and some modules might have restrictions on the types of SIM cards
they can work with.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 62
GSM Module Pin Arduino Pin Description
VCC 5V Power supply for the GSM module
GND GND Ground
TXD RX (D2) Transmit data from GSM to Arduino
RXD TX (D3) Receive data from Arduino to GSM
RST Not connected Reset pin (optional)
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 63
C. Keypad Module
The keypad module is a commonly used input device that allows users to provide
numerical or textual input to an embedded system. It typically consists of an array
of buttons arranged in rows and columns, with each button representing a unique
key press. The most common keypad configurations are 3x4 (3 rows and 4 columns)
and 4x4 (4 rows and 4 columns), but they can vary based on the design.
Keypads are used in various applications, including security systems, calculators,
and any project requiring user input, such as PIN entry systems or menu navigation
interfaces.
How It Works
1. Matrix Configuration:
o The keypad operates as a matrix where each key is located at the
intersection of a row and a column. When a key is pressed, it connects
one specific row and one column, creating a unique combination that
can be detected by the microcontroller.
2. Row and Column Scanning:
o A typical keypad has multiple rows and columns. The microcontroller
scans the rows and columns to detect which key is pressed.
Each row is set as an output pin, and each column is set as an
input pin.
The microcontroller sends a signal through each row, one by
one, and checks the state of the columns to identify the pressed
key.
3. Keypad Encoding:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 64
o Each key press generates a unique combination of row and column
signals, which is then converted into a corresponding value (like a
number or character).
o For example, in a 4x4 keypad, pressing the first key in the first row
and first column (key "1") will produce a specific signal corresponding
to that key.
4. Connection to Microcontroller:
o The keypad is usually connected to a microcontroller through digital I/O
pins, where the microcontroller continuously checks the state of each
key, scanning the rows and columns to detect key presses.
Feature Specification
Number of Keys 3x4 (12 keys), 4x4 (16 keys)
Connection Interface Digital I/O pins (for row and column scanning)
Operating Voltage 3.3V to 5V
Current Consumption Low current consumption
Keypad Type Membrane or mechanical switch-based
Keypad Material Typically rubber or conductive membrane
Size Varies, typically around 5x5 cm for 4x4
Applications
1. Access Control Systems:
o Keypads are widely used in security systems where users need to enter
a PIN code to gain access to restricted areas or devices.
2. ATM Machines:
o ATM machines use keypads for users to enter their PIN codes and
perform banking transactions.
3. Home Automation Systems:
o In home automation, keypads are used to control devices such as
lights, fans, and alarms, based on user input.
4. Electronic Locking Systems:
o A keypad is often used to input a password to unlock a door or safe.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 65
6. Industrial Control Systems:
o Keypads are used in industrial machinery for inputting values like
parameters or settings.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 66
Interfacing with Arduino
Keypad modules are typically interfaced with microcontrollers using digital I/O
pins for row and column scanning. For a 4x4 keypad, 8 pins (4 for rows and 4 for
columns) are required. There are also libraries available for Arduino (like Keypad
library) to simplify the process of detecting key presses.
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 67
2. Triangulation Process:
o The GPS module uses the principle of triangulation to calculate the
position. Each satellite sends a signal that includes the satellite’s
position and the exact time the signal was sent.
o The module calculates the time it took for the signal to reach the
receiver and multiplies it by the speed of light to determine the
distance to each satellite.
o Using the distances from multiple satellites, the GPS module can
calculate its latitude, longitude, and altitude.
3. NMEA Data Format:
o GPS modules typically output data in the NMEA (National Marine
Electronics Association) format. The NMEA format provides location
data, including latitude, longitude, altitude, time, and other relevant
information.
4. Accuracy:
o The accuracy of GPS modules depends on various factors such as
signal strength, satellite coverage, and the environment (e.g., urban
areas with tall buildings may cause signal interference). Typically, GPS
can provide accuracy within 5-10 meters under good conditions, but
more advanced systems (like differential GPS) can achieve sub-meter
accuracy.
Feature Specification
Operating Voltage 3.3V to 5V
Communication Interface UART (Serial), I2C, or SPI
Signal Acquisition Time Typically 30-60 seconds (Cold Start)
Accuracy 5-10 meters (under ideal conditions)
1 Hz (1 update per second) or higher in some
Update Rate
models
Antenna Built-in or external antenna
Satellite Channels 20-60 channels (depends on the model)
Size Varies; typically around 3-5 cm for small modules
Power Consumption ~20mA to 50mA depending on activity
Applications
1. Navigation Systems:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 68
o GPS modules are extensively used in automotive navigation systems,
portable GPS devices, and smartphone navigation apps to provide
real-time directions and route planning.
2. Location Tracking:
o Used in vehicle tracking, asset tracking, and personal tracking.
GPS data can be sent over the internet to track locations in real-time.
3. Geotagging:
o GPS modules are used in cameras and smartphones for geotagging,
which involves embedding location data into photos and videos.
4. Surveying and Mapping:
o GPS is an essential tool for creating maps, conducting land surveys,
and generating GIS data.
5. Drones:
o Drones use GPS modules for autonomous navigation, waypoints,
and geo-fencing (limiting the drone's flight area).
6. Agricultural Applications:
o GPS is used in precision farming, enabling automatic control of
tractors, harvesters, and other farming equipment based on location
data.
7. Emergency Services:
o GPS is used in emergency location tracking systems to assist with
rescue operations, ensuring fast response times.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 69
4. Easy Integration:
o GPS modules are easy to integrate with microcontrollers and other
embedded systems via UART, I2C, or SPI, and are supported by a
variety of libraries in platforms like Arduino and Raspberry Pi.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 70
The data sent from the GPS module is in NMEA format. To parse and display
the GPS data (latitude, longitude, altitude, speed), you can use libraries like
TinyGPS++ or Adafruit GPS in Arduino.
Applications in Real-Life Projects
Automotive Navigation:
Used in car GPS systems to provide turn-by-turn directions and real-time
tracking of the vehicle’s location.
Personal GPS Tracking:
Used in wearable devices to track the location of individuals, such as
children or pets, for safety purposes.
Drone Navigation:
Drones use GPS for autonomous navigation, creating flight paths, and
returning to home locations.
Remote Sensing Systems:
GPS is used in remote sensing systems for geographical data collection, such
as weather stations, environmental monitoring, and wildlife tracking.
Diagram
A. Buzzer Module
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 71
A buzzer is an audio signaling device that produces sound in response to electrical
input. It is commonly used in electronic projects to provide feedback, alerts, or
notifications. Buzzers are available in two types: active buzzers and passive
buzzers, each having distinct characteristics.
Types of Buzzers
1. Active Buzzer:
o An active buzzer has a built-in oscillator circuit, which allows it to
produce sound as soon as power is applied. It requires only a DC
voltage to operate and can generate a sound without requiring an
external signal. It often emits a continuous tone when powered.
2. Passive Buzzer:
o A passive buzzer requires an external signal (such as a square wave)
to generate sound. It does not have a built-in oscillator. By varying the
frequency of the signal, a passive buzzer can produce different tones,
making it more flexible in producing various sounds.
How It Works
1. Active Buzzer:
o When a voltage is applied to an active buzzer, it internally generates a
sound, typically a beep or tone, without requiring a waveform input. It
operates at a fixed frequency (usually between 2kHz to 5kHz) and has
a straightforward on/off operation.
2. Passive Buzzer:
o A passive buzzer works by converting an alternating signal (usually
from a microcontroller or external oscillator) into sound. When a square
wave signal is sent to the buzzer, it vibrates at the frequency of the
wave, producing sound at the corresponding pitch.
3. Frequency Control (for Passive Buzzers):
o A passive buzzer can produce different tones by adjusting the
frequency of the driving signal. For instance, a higher frequency will
generate a higher-pitched sound, while a lower frequency will produce
a deeper sound. This can be useful for generating melodies or alerts
with varying tones.
Feature Specification
Type Active or Passive
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 72
Operating Voltage 3V to 5V (typical)
Frequency Range (Active) Fixed frequency (usually 2-5 kHz)
Frequency Range (Passive) Can vary based on the input signal
~10-30 mA for active, ~20-40 mA for
Current Consumption
passive
Sound Level 60-100 dB depending on size and type
Typically, between 10mm and 30mm
Size
diameter
Connection Usually connected through GPIO pins
Response Time Instantaneous (depends on type)
Applications
1. Alarms and Alerts:
o Buzzers are often used in security systems, fire alarms, and smoke
detectors to provide an auditory warning. They are also used in
systems to alert users of specific conditions, such as low battery or
errors.
2. Timers and Clocks:
o In applications such as kitchen timers or alarm clocks, buzzers are
used to indicate the completion of a countdown or as an alarm to wake
up the user.
3. Interactive Systems
o Buzzers are commonly used in keypad systems, quiz boards, and
game shows to provide audio feedback when a correct or incorrect
answer is given.
4. Control Feedback
o In embedded systems, buzzers are used to provide simple feedback
to users, indicating a button press or confirming an action, such as a
successful task completion.
5. Automated Systems
o Buzzers are used in robots and automated machines to indicate
successful operation, warning conditions, or user interaction.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 73
2. Low Power Consumption
o Buzzers, especially active ones, consume very little power, making
them ideal for battery-operated devices.
3. Cost-Effective
o Buzzers are relatively inexpensive components, making them ideal for
a wide variety of applications.
4. Audible Feedback
o Buzzers provide clear, audible feedback that can be heard in noisy
environments, making them suitable for alarms or notifications.
Passive Buzzer
o Connect one pin of the passive buzzer to a PWM-capable digital output
pin (e.g., Pin 3) on the Arduino.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 74
o Connect the other pin of the buzzer to GND.
Diagram
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 75
The typical range of PWM control is from 0 to 180 degrees for most
servos, though some high-torque or continuous rotation servos may
have different ranges.
A 1ms pulse typically corresponds to a 0° position, while a 2ms pulse
corresponds to 180°.
3. Position Control:
The servo motor adjusts its shaft position based on the received PWM
signal. The motor will continuously correct itself until it reaches the
target position as determined by the PWM signal. This feedback loop
allows for accurate and stable positioning.
4. Torque and Speed:
Servo motors offer high torque at low speeds and can hold a position
under load. However, the torque decreases as the speed increases.
They are typically used for applications requiring accurate control over
a small range of motion rather than continuous rotation.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 76
Specifications of Servo Motors
Feature Specification
Voltage 4.8V to 6V (commonly)
Torque Varies (usually 1-20 kg·cm for standard servos)
Speed Varies (typically 0.1-0.2 sec/60°)
Control Signal Pulse Width Modulation (PWM)
Range of Motion 0° to 180° (standard servos)
Current Consumption ~100-500mA (depends on load and torque)
Size Typically ranges from 20mm to 50mm in diameter
Type Standard, Continuous, High-Torque
Applications
1. Robotics:
Servo motors are commonly used in robotics for controlling the
movement of arms, grippers, and legs. They allow for precise control of
angles, making them ideal for robotic systems requiring high precision.
2. Remote-Controlled Vehicles:
In RC planes, helicopters, cars, and boats, servos control the
movement of control surfaces like rudders, ailerons, and elevators.
They are also used for steering and throttle control.
3. Camera Gimbals:
Servo motors are used in camera stabilizers (gimbals) to provide
precise adjustments to the camera's position, ensuring smooth footage
by compensating for camera shake.
4. Automation Systems:
Servo motors are used in CNC machines, conveyor belts, and
automated assembly lines where precise control of movement is
necessary.
5. Mechanical Systems:
Servo motors are used to control various mechanical parts, such as
adjusting valves in fluid control systems or positioning solar panels for
maximum efficiency.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 77
Servo motors are highly accurate, with feedback mechanisms ensuring
they can maintain a precise position and move exactly where they are
commanded to.
2. High Torque at Low Speeds:
Servo motors provide high torque at low speeds, making them suitable
for applications where strong force is required to position a load.
3. Compact and Lightweight:
Servo motors are typically small and lightweight, making them ideal for
applications where size and weight are critical factors.
4. Feedback Mechanism:
Servo motors come with built-in feedback, which ensures that the
motor can self-correct to achieve the desired position, making them
highly reliable for positioning applications.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 78
Servo Motor Pin Arduino Pin Description
VCC 5V Power supply for the servo motor
GND GND Ground
Signal (PWM) Digital Pin PWM signal to control position
Diagram
C. Stepper Motor
A stepper motor is a type of DC motor that moves in discrete steps, with each
step representing a fixed angle of rotation. Unlike standard DC motors, which rotate
continuously when powered, stepper motors offer precise control over position
without the need for feedback systems. This makes them ideal for applications
requiring accurate and repeatable motion, such as in robotics, 3D printers, and CNC
machines.
How It Works
1. Step Angle:
o A stepper motor moves in defined increments, or steps, typically
ranging from 0.9° to 1.8° per step. The exact angle per step depends
on the design of the motor. For example, a 1.8° stepper motor will
make 200 steps to complete one full rotation (360° ÷ 1.8° = 200
steps).
2. Electromagnetic Coils:
o Stepper motors are driven by electromagnetic coils that are
energized in a specific sequence. These coils are arranged around a
central rotor, and when energized, they create magnetic fields that
attract or repel the rotor, causing it to step forward or backward.
3. Modes of Operation:
o Full-Step: In full-step mode, two coils are energized at a time, and the
motor steps in full increments (e.g., 1.8° per step).
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 79
o Half-Step: In half-step mode, the current is applied in a way that the
motor takes half the number of steps per full rotation, increasing
resolution and smoothness.
o Microstepping: Microstepping divides each step into smaller
increments (e.g., 0.1°), allowing for even smoother movement and
finer control.
4. Control Signal (Pulse Input):
o Stepper motors are controlled by pulses sent to the motor driver. Each
pulse corresponds to one step, and by sending a series of pulses, the
motor rotates a specific number of steps. The speed and direction of
rotation are determined by the frequency and sequence of the pulses.
Feature Specification
Voltage 3.6V to 12V (commonly)
Step Angle 0.9°, 1.8°, or fractional (microstepping)
Current per Phase 1A to 2A (depends on the motor)
Typically 10 to 100 N·cm (depends on
Holding Torque
motor)
Speed Range Varies based on motor and driver
Shaft Diameter Typically 5mm to 8mm
Weight 100g to 500g (depends on size and
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 80
torque)
Requires a stepper motor driver for
Driver Requirement
operation
Applications
1. 3D Printers:
o Stepper motors are widely used in 3D printers to control the
movement of the extruder and print bed. The precise control over step
angles ensures accurate positioning of the printhead.
2. CNC Machines:
o Stepper motors are used in CNC machines (computer numerical
control) for controlling the position of the cutting tool, enabling highly
accurate cutting, engraving, and milling operations.
3. Robotics:
o In robotic systems, stepper motors are used to control limbs,
grippers, and wheels, providing precise movements in joint actuators
and steering systems.
4. Camera Gimbals:
o Stepper motors are used in camera gimbals to stabilize and adjust
the orientation of the camera, providing smooth and precise control
over positioning.
5. Automated Systems:
o Stepper motors are used in automated machines for tasks such as
material handling, conveyor belts, and process control systems where
precise rotation and positioning are required.
6. Medical Equipment:
o Stepper motors are used in medical devices like infusion pumps,
surgical robots, and prosthetic devices where accurate movement is
critical.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 81
o Stepper motors can be operated in an open-loop system, meaning
they do not require feedback sensors to know their position. This
simplifies the control circuitry and reduces costs.
3. High Torque at Low Speeds:
o Stepper motors provide high torque even at low speeds, making them
ideal for applications where slow and steady movement is needed.
4. Reliability:
o Stepper motors are simple in construction and have no brushes or
commutators, making them durable and requiring minimal
maintenance.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 82
o Connect the motor's coil wires (typically four wires for bipolar motors)
to the motor driver.
Arduino to Motor Driver:
o Connect the control pins (step, direction, enable) of the motor driver
to the digital pins on the Arduino (e.g., pins 2, 3, and 4).
Power:
o Connect the motor power supply to the motor driver, ensuring it
matches the motor's rated voltage (often 5V to 12V).
o The Arduino and motor driver share a common ground (GND).
Diagram
D. RELAY
A relay is an electromechanical switch used to control a high-voltage or high-
current circuit with a low-voltage control signal. It consists of a coil, an armature (a
moving part), and one or more sets of contacts. When the coil is energized, it
creates a magnetic field that pulls the armature, which in turn closes or opens the
contacts. Relays are used to isolate low-voltage circuits from high-voltage circuits
and are commonly found in automotive, home automation, and industrial
applications.
How It Works
1. Electromagnetic Coil:
o The relay contains a coil of wire that, when energized, generates a
magnetic field. The coil is typically powered by a low-voltage signal
(such as from a microcontroller or an external circuit).
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 83
o Attached to the coil is an armature, a moving metal piece that is
attracted to the magnetic field created when the coil is energized. The
armature is connected to a set of contacts that open or close based
on the movement of the armature.
3. Switching Mechanism:
o Normally Open (NO) Contacts: When the relay coil is not energized,
the contacts remain open. When the coil is energized, the armature
pulls the NO contacts together, closing the circuit and allowing current
to flow.
o Normally Closed (NC) Contacts: When the relay is not energized,
the contacts are closed. Energizing the coil pulls the armature, opening
the NC contacts and breaking the circuit.
4. Types of Relays:
o SPST (Single Pole Single Throw): This is the simplest type, with a
single contact that opens or closes the circuit.
o SPDT (Single Pole Double Throw): A more complex relay with one
input (common) and two outputs (NO and NC). It can switch between
two circuits, allowing the output to change between two different
states.
o DPDT (Double Pole Double Throw): A relay with two independent
switches, each with NO and NC contacts, allowing it to control two
separate circuits simultaneously.
Relay Specifications
Feature Specification
Coil Voltage 5V, 12V, 24V, or other standard values
Contact Voltage Typically 110V AC or 240V AC
Current Rating 10A to 30A (depends on relay model)
Coil Resistance 50Ω to several kΩ (depends on the relay)
Contact Configuration NO, NC, SPST, SPDT, DPDT
Switching Speed Typically 10 to 20 milliseconds
Mechanical Life 10 million operations (depends on model)
Electrical Life 100,000 to 1 million operations
Operating Temperature -40°C to 85°C (depending on the relay model)
Applications
1. Home Automation:
o Relays are widely used in home automation systems to control lights,
fans, or other appliances using microcontrollers (like Arduino or
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 84
Raspberry Pi). They allow you to control high-power devices with low-
power signals.
2. Automotive:
o Relays are found in car electrical systems, such as for controlling
headlights, horns, air conditioning systems, and other high-current
components. A low-current control circuit is used to switch the relay,
which then activates a high-current circuit.
3. Industrial Control:
o Relays are essential in industrial control systems for switching large
machines, motors, or actuators. They help isolate the control circuit
from high-power components, improving safety and reliability.
4. Safety Systems:
o Relays are used in safety-critical applications where they control circuit
breakers, emergency shutdown systems, and alarms. Their ability to
provide electrical isolation between control and power circuits is vital
for ensuring safe operation.
5. Telecommunication Systems:
o In telecommunications, relays are used to route signals between
different parts of a network. They provide a way to switch circuits on
and off or select between different paths.
Advantages of Relays
1. Electrical Isolation:
o One of the key advantages of a relay is electrical isolation between
the control and switching circuits. This ensures that high-voltage
components do not interfere with low-voltage control signals,
protecting sensitive components.
2. High Power Switching:
o Relays can control high-power circuits (up to 30A or more) using low-
power control signals, making them ideal for switching devices like
motors, heaters, and lights.
3. Versatile Switching:
o Relays are available with various contact configurations (NO, NC, SPDT,
DPDT), allowing them to be used in a wide range of applications, from
simple on/off switching to more complex tasks.
4. No Need for Complex Circuitry:
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 85
o A relay can be used to control high-power circuits without the need for
complex circuitry, making them a simple and cost-effective solution for
switching.
Limitations of Relays
1. Slower Switching Speed:
o Compared to solid-state switches (like transistors or MOSFETs), relays
are slower and may not be suitable for high-speed switching
applications.
2. Mechanical Wear:
o Mechanical relays have moving parts, which can wear out over time
and limit the number of operations. This makes them less ideal for
high-frequency switching.
3. Noise and Sparking:
o When the contacts open or close, especially under high current, they
can produce sparking or electrical noise, which can lead to
component degradation and interference in sensitive circuits.
4. Power Consumption:
o The coil in a relay consumes power while energized. While it is
generally low (in the range of a few milliwatts to a few watts), it still
requires constant energy when the relay is in operation.
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 86
Diagram
PlayWithCircuit. (n.d.). How to interface DHT11 and DHT22 sensors with Arduino Uno
https://playwithcircuit.com/how-to-interface-dht11-and-dht22-sensors-with-arduino-uno/
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 87
Utmel. (n.d.). DHT11 vs. DHT22: Datasheet, pinout, and features
https://www.utmel.com/components/dht11-vs-dht22-datasheet-pinout-and-features?id=1148
Ariat Tech. (n.d.). Working principle and application of HX711 load cell amplifier
https://www.ariat-tech.com/blog/working-principle-and-application-of-hx711-load-cell-amplifier.html
DIGITAL LOGIC AND MICRO CONTROLLER | GROUP NO. 7 ASSIGNMENT | NTA LEVEL 7 – 1 2024 88