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

(Luận văn) thiết kế và phát triển module truyền thông gsm gprs gửi dữ liệu từ hệ thống wave đến webserver và database

19 2 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

Nội dung

BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƯỜNG ĐẠI HỌC BÀ RỊA-VŨNG TÀU  lu ĐỀ TÀI NGHIÊN CỨU KHOA HỌC HỢP TÁC an n va Co-operative research project between BVU and UBO to gh tn TÊN ĐỀ TÀI: p ie Thiết kế phát triển module truyền thông GSM/GPRS gửi liệu từ hệ thống WAVE đến webserver database nl w d oa (Design and Development of GSM/GPRS data transmission from WAVE system to webserver and database) an lu nf va Trình độ đào tạo: Chương trình trao đổi sinh viên với trường UBO -Université de Bretagne Occidentale (Pháp) lm ul z at nh oi Ngành đào tạo : Cơ khí Chuyên ngành : Cơ điện tử z m co l gm @ Giảng viên hướng dẫn: Ts LÊ NGỌC TRÂN Sinh viên thực : Florian Lohezic Lớp : Digital System Niên khóa : 2016-2018 an Lu Bà Rịa-Vũng Tàu, năm 2018 n va ac th si Internship report From the 20/05/2018 to the 20/08/2018 lu an n va p ie gh tn to d oa nl w nf va an lu z at nh oi lm ul z l gm @ Florian Lohézic m co Bachelor’s degree in electronics and embarked systems an Lu n va ac th ~2~ si Summary page 2) The project page lu 1) Thanks an n va p ie gh tn to Introduction 1) Introduction of WAVE project 2) Introduction of WAVE system GPRS communication 1) System’s hardware 2) Introduction of GPRS module d oa nl w page nf va an lu 3) Conclusion page z at nh oi lm ul z m co l gm @ an Lu n va ac th ~3~ si Thanks Before beginning the project presentation, I want to thank some people without who, this project never can be possible First, I want to thank my teacher Mr Claude Vo, because I am here thank to him, not only in Vietnam for my internship but also in the bachelor’s degree in UBO When in November I had to quit the ISEN engineering school because I couldn’t find a company, Mr Vo said me “come in the bachelor’s degree SEME”, the first thing I answered him but if I couldn’t find a company for engineering school how could I find one for the bachelor’s degree, and he answered me that’s not a lu an problem I can find you an internship in Vietnam, and he did it So, Mr Vo, I thank n va you for the year I spend with you tn to Then, I want to thank my teammates, first because they were enthusiasts when I ie gh join them this year to continue the work on our project of technical degree The p guy without the project was not possible to make it was our work team leader nl w Émilien Abgrall, I want to thank him to have convinced Mr Vo to let us make oa WAVE, I thank him also for all the great moment we had as a team and as friend, d and for all the help he gave to me during this project, thank you Émilien I want lu nf va an also to thank, Guénolé Picard who was our account and stock manager during the project and when we were in Vietnam to install the project, Raphaël Bergot with lm ul who I work on mechanical part of the project he was our reporter in Vietnam, and z at nh oi Quang Dung Truong with whom I work all this year and during the internship he helped us a lot when we were in Vietnam, thank you guys z Moreover, I want to thank Mr Lê Ngoc Tran who was my internship tutor, I want @ gm to thank him to have accepted my internship request in Baria Vung Tau co l University, to have helped me when I needed help, and to have rented his house to give me a place to live in Vung Tau, for all of this thank you Mr Tran m an Lu n va ac th ~4~ si Finally, I want to thank all BVU’s staff and former student to have helped us here and welcomed us in their university lu an n va p ie gh tn to d oa nl w nf va an lu z at nh oi lm ul z m co l gm @ an Lu n va ac th ~5~ si Chapter NECESSITY FOR DEVEOPING A WAVE PROJECT SYSTEM (Sự cần thiết để phát triển dự án WAVE) 1.1 Introduction of WAVE Project lu an n va to gh tn Fig Team members of the WAVE Project for Baria –Vung Tau Viet Nam p ie This project began after a request of Ba Ria Vung Tau Aquaculture w department Indeed, the province located in south Viet Nam have for main d sea oa nl industry fish and seafood breeding This breeding took place in enclosure near the nf va an lu However, significant issues of human’s pollution bring the death of breeding product The department look for a way to preserve farms and increase z at nh oi lm ul production z m co l gm @ an Lu n ac th ~6~ va Fig.2 Aquaculture of Baria-VungTau depend on natural si Aquaculture’s department don’t have water analyze direct method So, it’s only possible to know why the products die with laboratory analyses but only after when the pollution’s effects are irreversible It’s been asked at Baria Vung Tau University and the BTS SN of La Croix Rouge to realize a self-sufficient water monitoring system We have been studying the project’s feasibility in BTS (two-year technical degree in higher education) and we want to continue and finish it during our LP SEME (bachelor’s degree) We have make a complete and automated electronic system allowing to analyze continuously physical water parameter and to transmit measured data in real time lu We called our system « WAVE » for Water Analysis for Vietnamese Ecosystem an n va 1.2 Introduction of WAVE system p ie gh tn to The WAVE system is shown in figure d oa nl w nf va an lu z at nh oi lm ul z @ Figure WAVE system is implement in Baria-Vungtau province l gm WAVE system operation: Beginning of measurement cycle, Pump No take salt water from river into the tank to clean the pipe in the same time Pump No co m empty the tank, then Pump No fill the tank to execute a measurement process an Lu The measurement begins by the measurement of the temperature, then the pH, ac th ~7~ n va after that the salinity, next the chlorine, the pressure and the oxygen concentration si and saturation After the completion of measurement, the electronic box will send the measurement result to the raspberry pi3 by radio and alert you by sending a SMS through GSM wave Here, the measure information will be updated to the system's database and can be access through the web server and server interface Next, the tank cleaning process takes place: the Pump No draws water out of the tank, and Pump No the fresh water can be pumped from the clean water tank into the measurement tank and the spray nozzle clean the sensor After the cleaning, the Pump No draws water out from the tank again, the new measurement can start Seawater measurement is automated by setting the system lu frequency an The system use solar power system, Electronic box with LCD display and rotary n va button to choose easily the menu and function, sensor calibration, frequency to gh tn measurement as well as data transmission modes (GSM / radio waves) We have already install the system in a fish farm near Vung Tau, and now my ie p internship project was to improve the software by developing a new subroutine in nl w the software to allow WAVE’s electronic board to send all the data on a website, d oa created by Mr Quang Dung Truong, he also make a database to record the data nf va an lu z at nh oi lm ul z m co l gm @ an Lu Figure Implementation of the WAVE system in Cha Va river n va ac th ~8~ si Chapter II DESIGN OF GPRS MODULE FOR WAVE SYSTEM (Thiết kế mô – đun truyền thông GPRS cho hệ thống WAVE) 2.1 System’s hardware The WAVE system is handled by the electronic board, the schematic of electronic board is shown in attachment In this Project, my research target designs and make the communication between the WAVE system and webserver, the WAVE system can send or receive data to webserver or versa vise through GPRS module lu 2.2 Introduction of GPRS module an n va Sim800L is a GSM/GPRS module, it has many functions such as, send SMS, tn to make a call or transmit data through GPRS This module utilities for IoT applications in tiny custommer design Moreover, it can integrate the function of gh p ie Bluetooth, FM and Embedded AT The connection diagram is showned in Fig d oa nl w nf va an lu z at nh oi lm ul z m co l gm @ an Lu Figure Block diagram of GPRS communication n va ac th ~9~ si To send the data on the website I use GPRS communication, made possible thanks to the SIM800L device, which send also SMS when the measure reaches the minimum and maximum level configured, by the owner of the fish farm lu an n va p ie gh tn to w Figure Connection between Microprocessor with GPRS module SIM800L oa nl The SIM800L module is connect on the pin TX/RX of the PIC18F67J11 d To make my subroutine I must use “AT” commands to configure the SIM800L, I lu nf va an also ask for a Vietnamese sim card to put in the SIM800L to allow communications, GSM and GPRS “AT” commands are declared like character’s z at nh oi I had to use: lm ul string, inside this string I write text for different “AT” commands 1) AT+CGREG = 0,5; -> Enable network registration z 2) AT+CPIN = [PIN code]; -> connection with the sim card gm @ 3) AT+CGATT = 1; -> Attach GPRS Service m co 5) AT+CIPMUX=0; ->simple IP connection l 4) AT+CIPSHUT; -> detachment of packet data control for configuration an Lu 6) AT+CIPSRIP=0; ->configuration of the simple IP answer n va ac th ~ 10 ~ si 7) AT+CSTT=,; -> define the access point name of the sim card 8) AT+CIICR; -> 3G connection 9) AT+CIFSR; -> ask for an IP address 10) AT+SAPBR=3,1,””Contype””,””GPRS””; -> Setup GPRS, connection type 11) AT+SAPBR=3,1,””APN””,””m3-world””; -> set the APN (Access Point Name),Vinaphone APN 12) AT+SAPBR=3,1,””USER””,””mms’’; -> Vinaphone APN username lu 13) AT+SAPBR=3,1,””PWD””,””mms””; -> Vinaphone APN password an 14) AT+SAPBR=1,1; -> tries to connect GPRS n va 15) AT+SAPBR=2,1; -> to query GPRS context to gh tn 16) AT+HTTPINIT; -> initialize http service 17) AT+HTTPPARA=””CID””,1; -> set parameters for http session ie p 18) AT+HTTPPARA=””URL””,””http:0x2F0x2Fantrtech/wave/scripts/api.ph nl w p?create_data=true””; -> set the url of website you want to reach AT+HTTPACTION=0; -> start the session 20) AT+HTTPTERM; -> close the session 21) AT+SAPBR=0,1; -> close GPRS context d oa 19) nf va an lu lm ul I tried to send the data by diverse ways, first I write the URL line, and, in this line, z at nh oi I put the variable of measurement directly as text, but when I try this I saw it can’t work because nothing changes it was just text z After that I tried to put the variable of measurement not as text in the line, but this @ l gm way can’t work too because you can’t stop the text of a string and start over in the same line co m Then I tried to use %f to call the variable, so I can put all the variables at the end n ac th ~ 11 ~ va can’t put variable at the end of a text line an Lu of the line and don’t stop the string, but this way doesn’t work either, because you si So, after all this try which doesn’t work I think it in another way, and this way work, so like for the other way I define the “AT” command of the URL like a string but I don’t put all the URL, I stop just before the first variable Then I create a subroutine in which one I create another string, stringA, which contain all the variable name needed by the website, like &TempEau, next I create another string, stringB, which will take stringA value and add all the variable value lu an n va p ie gh tn to d oa nl w nf va an lu z at nh oi lm ul z m co l gm @ an Lu n va ac th ~ 12 ~ si lu an n va p ie gh tn to d oa nl w nf va an lu lm ul When this subroutine is done I have to call all the “AT” commands and verify if is it ok, that’s the main program of my subroutine z at nh oi In this program I must call the subroutine I made before to have the URL with the data, before use the command “AT+HTTPPARA” z Then I just have to call my subroutine GPRS_WEB.c in the main program to send @ gm the data on the website at each measurement made by WAVE’s station co l An other possibility was to use the command, “AT+HTTPDATA=(number of m bytes needed),(delay to send data);”, but the website take the data in the URL so an Lu I chose to don’t use this method n va ac th ~ 13 ~ si When my work is done I just have to build the software and to put it on the electronic board, to that I use mikroProg Suite for PIC and a compiler from MikroElektronika After some tests in campus 3, I go install the software in WAVE’s electronic board in the fish farm lu an n va p ie gh tn to d oa nl w nf va an lu z at nh oi lm ul z m co l gm @ an Lu n va ac th ~ 14 ~ si Conclusion My work here on GPRS communication, and Mr Quang Dung Truong work on the website and the database, conclude WAVE project, which is already working for few months I’m glad to take part at this project with WAVE team My internship here in BVU, allows me to increase my skills, first, in programming and in electronics, because I learn a lot in the way to discover how to send data with GPRS, and then in English essentially by talking with people, some students lu an of BVU, and all the people I have met here n va When I arrived first in Vietnam, I was surprised by the way who people are driving to gh tn here, how to cross the streets, but now I am used to it I was also surprised by the way of Vietnamese people welcome foreigners, by invited us in their house, offer ie p a meal or invited us at the restaurant, sometimes just to have a tea with them or to nl w make us discover Vung Tau city and area So that will be what I retain from d oa Vietnamese, they are very generous and very kind lu nf va an So, this internship made me learn a lot, first, about Viet Nam culture and way to live, and about myself, I am going back to France a bit change, more openminded, z at nh oi lm ul maybe more confident about living in another country, and about myself z m co l gm @ an Lu n va ac th ~ 15 ~ si ATTACHMENT Control Drawing lu an n va p ie gh tn to d oa nl w nf va an lu z at nh oi lm ul z m co l gm @ an Lu n va ac th ~ 16 ~ si Power Drawing lu an n va p ie gh tn to d oa nl w nf va an lu z at nh oi lm ul z m co l gm @ an Lu n va ac th ~ 17 ~ si Sensors part lu an n va p ie gh tn to d oa nl w nf va an lu z at nh oi lm ul z m co l gm @ an Lu n va ac th ~ 18 ~ si Display/ Radio/ GSM part lu an n va p ie gh tn to d oa nl w nf va an lu z at nh oi lm ul z m co l gm @ an Lu n va ac th ~ 19 ~ si

Ngày đăng: 17/07/2023, 09:45