MC Project
MC Project
College of Engineering
Electrical and Computer Engineering Department
Microcontroller Project:
Student name:
1. Badria Mustafa
2. Lolav Saeed
3. Maryam Fakhri
Figure 1
Figure 2:
The DHT11 sensor
The DHT11 sensor is a commonly used Temperature and
humidity sensor that comes with a dedicated NTC to measure
temperature and an 8-bit microcontroller to output the values of
temperature and humidity as serial data [5].
Figure 3
LM35 sensor
Major Hardware Description the LM35 series are precision
integrated-circuit temperature sensors, whose output voltage is
linearly proportional to the Celsius (Centigrade) temperature if the
air temperature were much higher or lower than the surface
temperature, the actual temperature of the LM35 die would be at an
intermediate temperature between the surface temperature and the
air temperature. On the other hand, a small thermal mass may be
added to the sensor, to give the steadies treading despite small
deviations in the air temperature.
Figure 3
Figure 4
Implementation:
Figure
Hand connecting:
Figure
The Analog-to-Digital Converter (ADC)
The ADC is an integral component of a microcontroller that
translates continuous Analog signals, representing varying voltage
levels from sensors and external devices, into discrete digital values
[7]. This conversion process enables the microcontroller's digital
processing unit to interpret and utilize real-world physical
measurements, facilitating precise and accurate interactions with the
external environment in a wide range of applications such as
recording voice signals, temperature …etc.
.ORG 0x0000
MAIN: LDI R16, HIGH(RAMEND)
OUT SPH, R16
LDI R16, LOW(RAMEND)
OUT SPL,R16 ; setup stack
HERE: LDI R16, 0x87 ; enable ADC and select fs/128 = 125 KHz
STS ADCSRA, R16
LDI R16, 0x40
STS ADMUX, R16 ; Vref = 2.56V , input channel = ADC0 single ended
DEC R22
ADD R16,R21
MOV R23,R16 ;R23 IS THE FIRST DIGIT
DEC R22
ADD R16,R21
MOV R24,R16 ;R24 IS THE SECOND DIGIT
ORI R24,0X30
MOV R16,R24
CALL DATA ;call data write function
CALL D2MS
ORI R23,0X30
MOV R16,R23
CALL DATA ;call data write function
CALL D2MS
LDI R16,'C'
CALL DATA ;call data write function
CALL D2MS
DATA:
OUT PORTD, R16 ; LCD data port = R16
SBI PORTB, 0 ; RS = 1 for data
SBI PORTB, 1 ; E = 1
CALL D100US ; Make a wide EN pulse
CBI PORTB, 1 ; E = 0 for H-to-L pulse
CALL D100US ; Wait 100 us
RET