当前位置:网站首页>Based on all volunteers - H and D1 XR806 rare plant monitoring device
Based on all volunteers - H and D1 XR806 rare plant monitoring device
2022-07-30 04:05:00 【DOT Xiaowen】
The graduation design is the use of the wholeD1-HNezha development andXR806开发板,Supplemented by various peripheral circuits and sensor components,A precious plant monitoring device made.
进行控制.
充电电路
Because the voltage of the battery will change to a certain extent with the change of lighting,So it needs to be stabilized before it can be used.The power supply part uses aAMS1117芯片,Stabilize the unstable voltage output by the lithium battery to3.3V,给XR806Development board and sensor power supply.AMS1117Is a positive linear regulator of low pressure drop,The pressure drop is small.It integrates overheating protection function and current limiting circuit,Can effectively protect the normal operation of the circuit,Ideal for Portable Equipment Voltage Regulators.
光线、温湿度控制
The fill light control is mainly usedPWM调光技术.The control code is mainly to controlPWMThe duty cycle of the output to adjust the intensity of the light.在XR806中,首先初始化PWM的硬件,使用的是pwm_cycle_mode_Set(0)和pwm_capture_mode_set()函数.The main configuration in the function is the relevant initialization structure parameters、PWM的频率、Output Mode and Duty Cycle.初始化结束后,Just call the function that sets the duty cycle,You can set the duty cycle.Control combined with light sensor,The local light intensity can be controlled within a certain range,suitable light for plants.
The water replenishment part mainly cooperates with the soil moisture sensor to work.After the soil moisture sensor obtains the soil moisture data,XR806will make a judgment,如果ADCCollected the voltage is greater than a certain threshold,then activate the relay,Drive the water pump to work,pump water into the pot.on the display,You can see if the soil is wet or dry.
温湿度、光照、Soil sensors are connected toXR806上,Here, the data collected by the three sets of sensors are compared with the data collected by the standard instrument.,Controlled by two test points,Two sets of light intensities were measured.对比可以看出,The overall error is not large,meet the requirements of the device.
D1-H与XR806通信
TCPThe design of the server is mainly to ensure thatD1-H与XR806connect stably,并在XR806Can continue to wait after disconnectionXR806的重新连接.这边借鉴了github上的一个开源的socket服务器代码,It uses multi-threading technology,And can withstand greater server pressure,Ideal for use with this device.
The basic process of debugging is as follows,首先使用D1-HThe development board is connected to the previous oneWiFi,然后用XR806also connect the sameWiFi,在D1-HThe code to start the server on,然后,启动XR806Connect as a client.经过多次测试,D1-HThe server on the development board runs very stable,After the lower computer is disconnected, it will wait for the connection again,Can be reconnected very quickly after the lower computer is restarted.并且,在Linux下,可以使用system(wifi_info)函数来调用命令行,Just keep the command as a character array,You can use the command line operation in the program,非常方便.connected in this unitWiFiThe part is using this method,Invoke the command line to connectWiFi的.
D1-H服务端设计
D1-HThe server software design of the master is divided into three parts according to the functions required by the project.The first part is the design of the graphical interface,采用的是LVGL,Mainly used to display temperature、湿度等数据;第二部分是TCP服务器的设计(Introduced in the previous section),For data transmission and communication between upper and lower computers;The third part is the image processing part,使用了YOLOV5+NCNN.
数据显示界面
图形界面使用的是LVGL.LVGL的作者是来自匈牙利的Gabor Kiss-Vamosikisvegabor,LVGL用C语言编写,具有很强的兼容性(并且与C++兼容),模拟器可在没有嵌入式硬件的PC上启动嵌入式GUI设计,同时LVGL作为一个图形库,它自带着接近三十多种小工具可以供开发者使用.这些强大的构建块按钮搭配上带有非常丝滑的动画以及可以做到平滑滚动的高级图形,同时兼具着不高的配置要求以及开源属性,成为广大开发者在选择GUI时的第一选择.
根据系统的需求,The graphical interface needs to be able to display the data sent from the lower computer,而LVGLYou can use text controls to display data in.Displaying pictures can be done with an image controlPNGdecoder to display.首先,Need to create two basic control objects,An image control for docking the acquired processed image,One is the control that docks the data display child control.on the image control,An image is docked,That is, the image after acquisition and processing;on the data display area,A series of controls are placed to display environment parameter information;There are also switches on the top for controlling the light intensity and the water pump.
图像处理
The image processing part is mainlyYOLOV5的使用.使用之前,First train a model for a specific scenario.First you need to create your own dataset,数据集分为两个部分,Image files and label files.The image file is the image containing the part of the target to be detected and the image without the target to be detected,Train as positive and negative samples respectively.The tag file contains information about the detection target,The format of the label file is as follows4.2所示.A row represents a target in the image,If the file contains multiple lines of data,indicates that there are multiple objects in the image.Label files need to need to detect target, do yourself.
There is a special,YOLOV5The label format istxt后缀的,不是我们常见的xml格式后缀的,You need to write your own code to convert.After the images and labels are ready,Also need to make sure that each label are consistent with the name of the image.准备就绪后,就可以调用train.py文件进行训练.在训练的时候,需要指定一些参数,如下图所示
Start the training,The computer will automatically start training.训练完成后,We can see where the target training results are saved,有一个pt格式的文件.然后可以用detect.pyfile to do a test,Replace the loaded weight file with the weight file generated just after training.detectThe program will use this file for detection,Finally, a result image will be output.The result of the target detection can be seen from the result graph.
原贴链接:https://bbs.aw-ol.com/topic/1826/
全志在线开发者交流企鹅群(客服机器人24小时在线解答):498263967
资源获取、问题讨论可以到全志在线开发者社区进行:https://www.aw-ol.com
全志及开发者最新动态可以关注全志在线微信公众号
边栏推荐
- Chapter 51 - Knowing the request header parameter analysis【2022-07-28】
- After 5 years of Ali internship interview~
- Mini Program Graduation Works WeChat Points Mall Mini Program Graduation Design Finished Products (3) Background Functions
- mysql structure, index details
- Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Work (2) Mini Program Function
- EasyCVR启动时报错“no such file or directory”,该如何解决?
- 新型LaaS协议Elephant Swap给ePLATO提供可持续溢价空间
- [Driver] udev aliases each serial port of USB to 4 serial ports
- Eureka Registry
- Small application project works WeChat integral mall small program of graduation design (4) the opening report of finished product
猜你喜欢
Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Work (2) Mini Program Function
Pytorch框架学习记录4——数据集的使用(torchvision.dataset)
【转】Swift 中的面向协议编程:引言
How to Effectively Conduct Retrospective Meetings (Part 1)?
Nacos service registration and discovery
OpenFeign implementation downgrade
Roperties class configuration file & DOS to view the host network situation
小程序毕设作品之微信积分商城小程序毕业设计成品(1)开发概要
【C进阶】数组传参与函数指针
Operational configuration: How to run multiple EasyCVR programs as a service in one server?
随机推荐
Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Work (2) Mini Program Function
spicy (1) basic definition
Organizations Going Online: A New Trend in Organizational Digital Transformation
Mini Program Graduation Works WeChat Points Mall Mini Program Graduation Design Finished Products (1) Development Overview
MySQ deadlock
Eureka Registry
ospf 导图
How to compare struct, slice, map for equality and the difference between several comparison methods in golang
数组和结构体
Pytorch框架学习记录3——Transform的使用
2022.7.29-----leetcode.593
How to extract year, month and day data in date type in SQL Server
Pytorch framework learning record 4 - the use of datasets (torchvision.dataset)
How does the AI intelligent security video platform EasyCVR configure the simultaneous transmission of audio and video?
New LaaS protocol Elephant Swap provides ePLATO with sustainable premium space
运行时间监控:如何确保网络设备运行时间
After 5 years of Ali internship interview~
Introduction to management for technical people 1: What is management
Send it to your friends and let TA treat you to fried chicken!
Redis "super explanation!!!!!!"