0% found this document useful (0 votes)
19 views10 pages

Chapter 3 Theoretical Basis

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 10

CHAPTER 3 THEORETICAL BASIS

3.1 System monitoring process


Initially, Arduino communicates with the heat, light, air and light sensors through
the communication standards that display the measured data on a 20x4 LCD.

3.2 Hardware introduction


3.2.1 Sensor block
3.2.1.1 Temperature and humidity sensor DHT11
A, Describe the pins and connection diagram of the sensor

Pic1.Pin diagram of DHT11


B, Interfacing DHT11 sensor with Arduino
Initially MCU sends a start signal in low state, DHT11 changes from the low-
power-consumption mode to the running-mode, this process must take at least
18ms to ensure DHT’s detection of MCU’s signal then MCU will pull up voltage
and wait 20-40us for DHT’s response.
Once DHT detects the start signal, it will send out a low-voltage-level response
signal, which lasts 80us. Then the program of DHT sets Data Single-bus voltage
level from low to high and keeps it for 80us for DHT’s preparation for sending
data.
When DATA Single-Bus is at the low voltage level, this means that DHT is
sending the response signal. Once DHT sent out the response signal, it pulls up
voltage and keeps it for 80us and prepares for data transmission.
When DHT is sending data to MCU, every bit of data begins with the 50us low-
voltage-level and the length of the following high-voltage-level signal determines
whether data bit is “0” or “1”. If the duration of high voltage level form the sensor
is in between 26µs to 28µs then bit “0” is received, and if the duration of high
voltage level form the sensor is 70µs then bit “1” is received.
C, Read value on DHT11
After communicating with control block, DHT11 sensor will return temperature
and humidity values as 40 bits of data, respectively divided into 5 bytes:
Byte 1: 8-bit data for integral part of humidity value
Byte 2:8-bit data for decimal part of humidity value
Byte 3:8-bit data for integral part of temperature value
Byte 4:8-bit data for decimal part of temperature value
Byte 5:8-bit data for checksum

3.2.1.2 Dust sensor Sharp GP2Y10


A, Dust sensor Sharp GP2Y10 specification:
-Supply voltage 3.3-5v.
-consumption curent:20mA max, 11mA typical
-Output of the sensor is an analog voltage proportional to the measured dust
density, with a sensitivity of 0.5v~0.1mg/m3
-Operating temperature:40~85 Celcius degree
B, Pin configuration details
Pic2.Pin out of GP2Y10

Pin details table.


No. Pin Name FUNCTION
1 V-Led Provides vcc to IR LED through phototransistor. Conect 5v
to this pin
2 LED- Connect the ground terminal of the power supply to this
GND pin. It is a ground pin of IRED
LED This pin is used to toggleIRLED to emit infrared light
4 S-GND Ground pin of GP2Y10
5 VOUT This pin produces analog voltage pulse according to
concentration of dust particles in air
6 VCC Vcc pin powers the optical sensor and operating voltage is
between 4.5V to 5V

C, Interfacing with Arduino


To interface GP2Y10 optical sensors with microcontrollers such as Arduino, we
need only an Analog pin to read the analog voltage output of the sensor. Other than
this, we also need one digital output pin to toggle IR LED of the GP2Y10 sensor.
Hence, we can interface the GP2Y10 dust sensor with any microcontroller having
one ADC channel and at least one digital output pin.
For example, Arduino has 5 ADC or analog channels which can be used to
measure output voltage value of optical dust sensor. Furthermore, Arduino also
supports 10 digital input-output pins. We can use any one of these pins to toggle
the IR LED of GP2Y10.

3.2.2 microcontroller block


3.2.2.1 arduino uno r3
The Arduino Uno R3 is a microcontroller board based on the ATmega328P. It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog
inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP
header and a reset button. It is one of the most popular Arduino boards, and is a
great choice for beginners and experienced users alike.

Configuration details of Arduino Uno R3:


BOARD NAME ARDUINO UNO R3
SKU A000066
MICROCON ATMEGA328P
TROLLER
USB USB-B
CONNECTE
R
Built-in LED Pin 13
PINS Digital I/O Pins 14

Analog input pins 6


PWM pins 6
COMMUNIC UART Yes
ATION
I2C Yes
SPI Yes
POWER I/O Voltage 5V
Input voltage (nominal) 7-12V
DC Current per I/O Pin 20mA
Power Supply Connector Barrel Plug
CLOCK Main Processor ATmega328P 16 MHz
SPEED
USB-Serial Processor ATmega16U2 16 MHz

MEMORY ATmega328P 2KB SRAM, 32KB FLASH, 1KB


EEPROM
DIMENSION Weight 25g
S
Width 53.4mm
Length 68.6mm

Main structure of arduino r3:

 Digital input/output pins: These pins can be used to connect to sensors, actuators,
and other electronic components. They can be used as either inputs or outputs,
depending on the needs of the project.
 PWM outputs: Pulse width modulation (PWM) is a technique that can be used to
control the speed or brightness of electronic devices. The Arduino Uno R3 has 6
PWM outputs, which can be used to control motors, LEDs, and other devices.
 Analog inputs: Analog inputs can be used to read the value of sensors and other
electronic components. The Arduino Uno R3 has 6 analog inputs, which can be
used to read the voltage from a potentiometer, the temperature from a thermistor,
or the light level from a photoresistor.
 16 MHz ceramic resonator: The ceramic resonator is a clock that provides the
Arduino Uno R3 with a stable timing signal. This is important for many projects,
such as those that need to generate accurate tones or measure time intervals.
 USB connection: The USB connection can be used to program the Arduino Uno
R3 and to communicate with it from a computer.
 Power jack: The power jack can be used to power the Arduino Uno R3 with an
external power supply, such as a wall adapter or a battery.
 ICSP header: The ICSP header can be used to program the Arduino Uno R3 using
an external programmer, such as the Arduino Uno Rev3 with ISP programmer.
 Reset button: The reset button can be used to reset the Arduino Uno R3 to its
default state.

Pic3.Arduino Uno R3
The Arduino Uno R3 has 14 digital input/output pins (of which 6 can be used as
PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a
power jack, an ICSP header and a reset button.

Digital pins:

 Pins 0 (RX) and 1 (TX) are used for serial communication.


 Pins 2 (INT0) and 3 (INT1) are used for interrupts.
 Pins 3, 5, 6, 9, 10, and 11 can be used as PWM outputs.
 All digital pins can be used for general-purpose input or output.

Analog pins:
 Pins A0 through A5 can be used to read the voltage from sensors and other
electronic components.

Other pins:

 Reset button: Resets the Arduino to its default state.


 Power jack: Can be used to power the Arduino with an external power supply, such
as a wall adapter or a battery.
 USB port: Can be used to program the Arduino and to communicate with it from a
computer.
 ICSP header: Can be used to program the Arduino using an external programmer.

Special functions:

 PWM (pulse width modulation): PWM is a technique that can be used to control
the speed or brightness of electronic devices. The Arduino Uno R3 has 6 PWM
outputs, which can be used to control motors, LEDs, and other devices.
 Interrupts: Interrupts are signals that tell the Arduino to stop what it is doing and
run a specific piece of code. The Arduino Uno R3 has two interrupt pins, pins 2
and 3.

3.2.3 Display block

3.2.3.1 LCD 20X4


PIC3.LCD 20X4

A, LCD 20X4 specification:

 Resolution: 20 characters x 4 lines


 Character size: 5x7 pixels
 Viewing angle: 160 degrees
 Backlight: Optional
 Power supply: 5V DC
 Interface: Parallel
 Operating temperature range: 0-50 degrees Celsius

Pin details table.


PIN NO NAME FUNCTION
1 VSS It is ground pinout potential at
this pinout is zero.

2 VCC At this pinout, five volts are


provided.

3 VEE This pinout is used to set the


contrast of the screen.

4 RS It used to H/L register select


signal.

5 RW It used for H/L read/write signal.

6 E It used for H/L enable signal.

7 D0 Data bus line

8 D1 Data bus line

9 D2 Data bus line

10 D3 Data bus line

11 D4 Data bus line

12 D5 Data bus line

13 D6 Data bus line

14 D7 Data bus line


15 CATHODE It used to set backlight anode.

16 ANODE It used to set backlight cathode.

You might also like