1. Trang chủ
  2. » Luận Văn - Báo Cáo

HỆ THỐNG báo ĐỘNG CHỮA CHÁY TRONG NHÀ THÔNG MINH, có CODE

31 12 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Hệ Thống Báo Động Chữa Cháy Trong Nhà Thông Minh Có Code
Thể loại Graduation Project
Định dạng
Số trang 31
Dung lượng 20,96 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

With Arduino, it is too famous, but there are limitations such as: ● Inability to self-complete code, suggestions leading to typos and I really hate this point ● Unable to view source of

Trang 1

HỆ THỐNG BÁO ĐỘNG CHỮA CHÁY

TRONG NHÀ THÔNG MINH

CÓ CODE

Trang 3

LIST OF IMAGES

FIGURE 1.1: Logo Arduino IDE……….10

FIGURE 1.2: Timer and counter in microcontroller……… 13

FIGURE 1.3: Sensor diagram……… 14

FIGURE 1.4: Module ESP32………16

FIGURE 1.5: Commuinication webserver with ESP32………16

FIGURE 1.6: Connect wireless devices………18

FIGURE 2.1: ESP32……….19

FIGURE 2.2: ESP32 pinout……… 20

FIGURE 2.3: Principle diagram ESP32………21

FIGURE 2.4: Flame sensor………23

FIGURE 2.5: Principle diagram of flame sensor……… 24

FIGURE 2.6: Buzzer……… 25

FIGURE 2.7: Principle diagram buzzer……….27

FIGURE 2.8: General principle diagram……… 27

FIGURE 3.1: Algorithm flowchart of ESP32………29

FIGURE 3.2: Algorithm flow chart of computer……… 31

FIGURE 4.1: Arduino programming……….33

FIGURE 4.2: SIMULATION………34

FIGURE 4.3: SIMULATION………34

Trang 4

Chapter 1: Overview of the topic 1.1 Introduction topic

- The smart fire alarm system for houses has not yet been applied by manyfamilies and also knows a lot about it Smart fire alarm systems are designed toalert us in an emergency so we can take action to protect ourselves, ourfamilies and others Early detection is also a key factor in helping to protect thesafety of life and property, and giving emergency responders enough time toprovide timely assistance in the event of a fire or small toxic gas Protectionmechanism including detection of fires or flames Warning mechanis includingsiren, indicator light or sending sms

- Automatic fire alarm system is a device system that automatically detects andannounces fire locations (according to Vietnamese standards TCVN 5738-2001) Automatic fire alarm system includes: Fire alarm center, fire detectors,(combination of bells, lights, push buttons) and other peripheral devices Working principle: Normally the whole system is on duty In this mode, thefire alarm center always has a signal to check the work of the equipment in thesystem, and the addressable fire detectors, modules, etc also have a responsesignal to the center Periodically, from time to time (depending on setting) thecenter will print the status of the system and information about the equipmentthat needs maintenance In the circuit there is always current Io flowingthrough In the monitoring mode, if the center receives an error signal from thedevices or does not receive a response signal from the devices, the center willswitch to trouble mode

- How it works when the sensor detects a fire within a range of about 80cm, then

a signal will be sent to the owner via sms, then the owner will confirm the real

or fake alarm and then press the alarm button, and at the same time call the firebrigade to come to the rescue

Trang 5

- The fire alarm system can be applied to houses or apartments, the fire alarmsystem is compact, so it can be placed in the corners on the ceiling withoutoccupying the area of the house or losing its beauty.

1.2 Research purpose

- To make a microcontroller, it is important that we know about the ArduinoIDE software, IDE stands for Integrated Development Environment ArduinoIDE is an open source software mainly used to write and compile code intoArduino modules Arduino has versions for operating systems such as MAC,Windows and runs on the Java platform that comes with built-in functions andcommands to play an important role in debugging, editing and compiling thecode in the environment Each module contains an onboard microcontrollerthat is programmed and accepts information in the form of code, the mastercode is also known as a sketch

Figure 1.1: Logo Arduino IDE

- Programming environment (IDE) In the world people program ESP32 through

2 IDEs, VS Code and Arduino With Arduino, it is too famous, but there are limitations such as:

● Inability to self-complete code, suggestions (leading to typos) and I really hate this point

● Unable to view source of included libraries Leads to you not knowing how

to use that library, and have to use another editor to open it

Trang 6

● The original function could not be found When programming you forget topass any parameters, with VS Code just a simple operation of Ctr Click, it will open the file containing that original function, but the Arduino does nothave this effect a lot on the process submit your code

● Not cool and Pro One thing is for sure, when you use VS code, you won't want to use arduino again

- Arduino: Written based on ESP-IDF, it can also be said that Arduino lib is a sublibrary of ESP-IDF

- Strength:

● Familiar with Arduino users

● The code is fast and easy, there are many sources of support

- Weakness:

● No code optimization

● Some functions are missing

- ESP-IDF: is a library package released by the company, with an entire API manual, suitable for English learners

- From time immemorial, the prevention of fire or the work of fire preventionhas always been considered a top important issue in each country In Vietnamtoday, the speed of infrastructure construction is taking place strongly.Townhouses are appearing more and more, especially in big cities Houseswith many different architectures and more importantly, houses are often donot focus on creating safety for the home, so with the knowledge that I havelearned at school, I decied to apply this research to find a good solution I thinkmicrocontroller is very suitable for me to apply in this research although I amnot very good at it but I still want to try it

- The purpose of my research is to apply the learned microcontroller to create abetter product I want to use the knowledge that I have learned to be able tocreate a product so that it can be applied in practice in a more useful way andcan help more people

Trang 7

- Today, people often do not pay attention to the safety of home fire alarms onthe market, often the system is quite complex and takes up a lot of space in thehouse Because of this inconvenience, it was the idea for me to research smarthome fire alarm systems The purpose of this is to bring safety and aesthetics tothe house, and especially to learn more new knowledge about microcontrollers

so that I can experience more new things that can be applied more practicaluse

1.3 Research subjects

- The objects that I study in this topic are microcontrollers and sensors

- Microcontroller is like a computer intergrated on a chip and used to controlelectronic devices It a self-contained embedded system with peripherals,processor, and memory It is applied in the manufacture of many civilelectronic devices such as phones, cars, led equipment, ambient temperaturegauges,… There are different types of microcontrollers, they are classifiedaccording to parameters such as Bits, RAM size, Flash, number of input andoutput lines

- The microcontroller has the following components:

● CPU: This is considered the brain of the microcontroller

● I/O port: Used to control and communicate with devices

● Memory: Used to store data and programs

● The serial port is the part that connects the microcontroller and otherexternal peripherals

● ADC and DAC converter: ADC is used to convert analog signals to digital.DAC is used to convert digital signal to analog

● Timer and counter: Timer and counter function in microcontroller

Trang 8

Figure 1.2: Timer and counter in microcontroller

- A sensor is a device that detects and responds to some kind of input from thephysical environment The specific input is light, heat or any one of many otherenviromental phenomena The output is generally a signal converted to adisplay readable at the sensor position, or transmitted electronically over anetwork for further reading or processing In this research, I chose a fire alarmsensor to match the topic I am researching Flame sensor has a detection range

of about 80cm with a scanning angle of 60 degrees and has 2 signal outputs,digital and analog, very easy to use There is also built-in IC LM393 to convertADC When the module is active, the signal pins will signal to the controldevice At that time signal pin Dout:

● High level signal is no fire

● Low level signal is fire

Trang 9

Figure 1.3: Sensor diagram

- Arduino is an open source platform that helps people build electronicapplications that are better able to link and interact with each other Arduinocan be seen as a miniature computer that helps users program and executeprograms Electronic projects do not need specialized tools for the codeloading process

- The Arduino components include the following hardware and software:

● Armature: Microcontroller with some open source circuit boards for controland programming including:

● Arduino Uno a kind of simple board suitable for beginners This data boardincludes 14 pins, 6 pins 5V to help resolve 1024 levels Arduino Uno canrun at 16MHz, voltage 7v-12v The size of this board is 5.5x7cm and itcosts about 200,000 VND

● Arduino Micro has 20 pins compact design, light weight, board size 5x2cm

● New design Arduino Pro, digital pin is not available This type of boardusually has 2 sources of 3.3v and 5v

● Arduino Nano is the most compact size, easy to install with the size of2x4cm

Trang 10

● Arduino Mega design part counting pins 64 pins, size 5x10cm.

● Arduino Leonardo does not have a USB port for programming Designboard with small chip to control, connect via virtual COM

● The IDE integrated development support software is responsible forediting, compiling code, loading chapters for the board

- The history of the Arduino: In the 9th century in Italy, the Arduino was bornand was named after the king of that country, King Arduin Arduino wasofficially introduced in 2005 as a tool for students to learn One of the Arduinodevelopers at the Interaction Design Institute Ivrea Arduino has now beenapplied in many areas of life This open source code brings many practicalbenefits to people Thanks to that, Arduino was born for a long time but stillexists and is so popular

- Applications of Arduino in human life When it comes to applications ofArduino, there are a number of areas that must be mentioned as follows:

● Arduino makes Robot with the ability to monopolize sensor devices,control motors Arduino helps the central processing unit do its jobthrough a variety of robots

● Interactive games: Arduino is used to interact with the screen, Joystick, when playing games like breaking bricks, Mario, Tetris,

● The plane is unmanned

● Control traffic lights, flashing LED effects

● Make a 3D printer

● Lighting design

● Make a toaster with a tweet warning when the cake is done

- Ability to connect to other devices You can use Arduino to do a few things:

● Arduino works independently

● The Arduino connects to the computer to access sensor data from theoutside world and provide you with feedback

● The Arduinos will connect themselves to each other

Trang 11

● Arduino connects to another electronic device.

● Arduino connects to the control chip

Figure 1.4: Module ESP32

- A webserver or web server is a computer that installs programs that serve web applications Webserver is capable of receiving requests from web browsers and sending responses to clients via HTTP or other protocols

- Whenever you view a web page on the internet, you are requesting that page from a web server

Figure 1.5: Commuinication webserver with ESP32

Trang 12

- When you enter the URL on a browser (web browser) like chrome, firefox actually does the following steps:

● The browser will request information from one or more DNS servers

(through the internet) The DNS server will tell the browser which IP address the domain name should point to which is also where the website islocated

● The DNS server will redirect the browser to the IP address of the server corresponding to that domain name

● The server responds to the browser with the requested information: Usually it's an HTML page

● The browser renders the html, css, js files that the server transmits into a website displayed on the computer for the user to use

1.4 Research scope

- The scope of application of this topic can be used for households, corporateoffices or even important small corners of factories But since this is a smallmodel, applying this model in practice is really not very promising because themodules applied to this topic are quite small and limited by many things such

as the range of development, present in the range of 80cm and has a scanningangle of 60 degrees Besides, the sensor only detects flames and does not detectsmoke But if a larger model is developed, households will be much moresuitable for this system because the housing space is small in scope and can beidentified more accurately, not affected by factors outside Also the model cansend warning messages to the user

- Station mode in wifi connection To connect wireless devices (such assmartphones, laptops) or wired devices (such as desktop computers) to a localarea network (LAN), we use a device called an Access Point (access point) ).Devices connected to the Access Point are called Stations

Trang 13

Figure 1.6: Connect wireless devices

- In the family, the router/modem device that has the function of transmittingWiFi is an Access Point for stations such as phones and computers to connect

to Then those Routers/Modems connect to the internet via fiber optic network.Each Access Point has a specific SSID (Service Set IDentifier) or we often call

it Wifi Name Stations connect to APs according to TCP/IP model, so todistinguish Stations and APs in a network we use IP Address

1.5 Expected results

- After doing the topic, the final product that I can bring is a fire alarm systemwith sirens, warning lights and can send automatic messages via sms.Programmable arduino to connect arduino with fire alarm sensor, and canoutput the results to the web The sensor devices can work well receiving andreceiving the signal to successfully output to the web Besides, the signaltransmission lines can be stable and the sensor works stably to give the mostaccurate warning

Trang 14

Chapter 2: Design and Construction 2.1 The block diagram of the system

2.1.1 Block A

- Block A inlcude a USB port to connect to a computer and the main component

is the ESP32 As the control center of the system, this controller is the mainbody to help us program the output devices as we want by the programmingsoftware The output also cannot output the desired signal Besides, the mainfunction of the module is to receive and transmit wifi for the device

Trang 15

ensure the flexibility of the module Wifi connection is guaranteed in a largeradius and while using Bluetooth allows the user to easily detect a module andconnect it to a smartphone Besides, the configuration of ESP32 is very diversesuch as CPU running 32bit system, processing speed of 160MHz up to240MHz and clock speed of reading flash chip 40MHz to 80MHz Support 2wireless communication, support all kinds of communication, built-in sensor

on ESP32 chip and in addition very fast processing speed

- This is pinout of ESP32:

Figure 2.2: ESP32 pinout

- Specifications of ESP32:

● Single-core or dual-core 32bit LX6 processor with up to 240MHz

● 520 KB SRAM, 448 KB ROM and 16 KB SRAM RTC

● Supports 802.11b/g/n wifi connection with speed up to 150Mbps

● Support for both classic Bluetooth V4.2 and BLE specifications

● 34 programmable GPIOs

● 18 channels of 12bit SAR ADC and 2 channels of 8bit DAC

● Serial connections including 4xSPI, 2xI2C and 3xUART

● Ethernet MAC for physical LAN communication

● 1 host controller for SD/SDIO/MMC and 1 slave controller for SDIO/SPI

Ngày đăng: 14/05/2022, 21:00

TỪ KHÓA LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm

w