aerobotics

#the4thLichuangcompetition#Scan code switch module

 
Overview

Note: * is required.

[Please fill in during the registration stage↓] * Brief introduction to the work: By scanning a specific QR code and paying a certain amount using WeChat, the corresponding device will run for a certain period of time. The device can be paused during operation and execution can be terminated. And record the bill, the balance will still be available next time you scan the QR code.

[Please fill in during the competition stage↓]

* 1. Work details:

1.1 Hardware part:

ESP8266 is used as the main control, three 8-segment digital tubes are driven through 74HC595 expansion IO to display the remaining time, and a relay is driven through 8050 to realize the device function. In order to facilitate development, the CH340 USB serial port chip is used to realize the program download between the computer and the target, and the program DEBUG.

1.2 Circuit software part:

The device program uses the ESP8266-NONOS-SDK officially provided by ESPRESSIF as a template and is developed in C language. Data exchange with the server via MQTT.

1.3 MQTT server architecture:

The device's MQTT server is built using the open source EMQ developed by ERLANG.

1.4 Server software part

The front-end uses the mature VUE-ELEMENT-TEMPLATE as the front-end framework, the back-end uses THINKPHP, and the part that communicates with MQTT uses SWOOLE. The mobile webpage that the user scans and SWOOLE communicate through WEBSOCKET.

* 2. Describe the challenges faced by the work and the problems it solves:

2.1. Because the peripheral circuit uses a lot of IO, but the ESP12F module provides a limited number of IO, so both GPIO9 and GPIO10 are used. Once the program is run and operated, GPIO9 will be reset. By querying the ESP12F schematic diagram, And query the SPI memory chip. After modifying the internal circuit of ESP12F, the circuit can be used normally.

**2.2, **As an electrician, the span of writing server programs is a bit large. Although I have the foundation of HTML, PHP, etc., I am at a loss when it comes to frameworks. In particular, VUE-ELEMENT-TEMPLATE mainly uses JS. Code, THINKPHP is the PHP language, and WEBSOCKET and SWOOLE used in real-time communication technology need to be implemented through query data. I encountered many problems, some of which could not be solved. Through the relevant technical groups, I received the support and enthusiastic answers from many group members. I would like to express my heartfelt thanks to them.

**2.3, **The biggest challenge of this project is still on the server, mainly due to the problems caused by server process isolation and concurrency. In terms of operating database and data caching, it will always cause multiple billings, generate multiple records, etc. . Until the night before submitting the project, I had been solving this part of the problem until two o'clock in the morning. But the problem was finally solved, relying on the spin lock provided by SWOOLE. Thanks to Han Tianfeng's team for providing such a useful PHP extension library.

**2.4, ** Our young man worked hard on this project, helping to lay out the boards, weld the boards, and improve the information on Lichuang. Although he lacked professional foundation, he had unparalleled curiosity and interest, and we worked together to solve the problem enthusiastically. Problem, I also recorded some videos of his work in the middle, but because the time was almost up, I found bugs in the code I had written, so I probably didn’t have time to edit it, so I can only express regret for this.

* 3. Describe the key points involved in the hardware and software parts of the work:

**3.1, ** The hardware part uses ESP8266 as the main control chip. There is no other MCU. Three FJ11001BH digital tubes display the remaining time, and five LEDs display the network and working status; **3.2, ** Use WeChat To pay, scan the QR code of the device and pay a certain amount to purchase the corresponding remaining time. Each time the remaining time is used, the corresponding time will be deducted and the remaining time will be available next time; **3.3, **MQTT is used between the device and the server Protocol, WEBSOCKET is used between the mobile page and the server; REDIS is used between THINKPHP and SWOOLE;

* 4. List of work materials:

BOM list
name Encapsulation Specification bit number Dosage
Chip resistor 0603 NC R25, R27, R29 3
Chip resistor 0603 0 R28 1
Chip resistor 0603 101 R12, R13 2
Chip resistor 0603 102 R3, R4, R10, R14,R15, R16, R17, R20, R23 9
Chip resistor 0603 103 R2, R5, R6, R7, R8, R9, R19, R24, R26, R1, R11, R18, R22 9
Adjustable resistance RES-ADJ-TH_3PIN-V-L9.50-W4.85-PITCH2.50 103 R21 1
capacitance CASE-B_3528 NC C7 1
capacitance 0603 100nF C8, C9, C10 3
capacitance 0604 104 C1, C2, C3, C5 8
capacitance CASE-B_3528 10uF C4, C6 2
led LED-3MM/2.54 R LED1, LED5 2
led LED-3MM/2.54 G LED2 1
led LED-3MM/2.54 B LED3 1
led LED-3MM/2.54 Y LED4 1
Chip diode SMA(DO-214AC) M7 D1, D2 2
Digital Tube FJ-10106-24MMX34MMX10.5MM-PITCH2.54MM FJ11001BH LED6, LED7, LED8 3
triode SOT-23(SOT-23-3) CJ2301 S1 Q1, Q4, Q6, Q7 4
triode SOT-23 8050M-D Q2, Q5, Q8, Q9 4
triode SOT-23(SOT-23-3) S8550 Q3 1
Connecting seat CONN-TH_3PIN-H-PITCH5.08-L_DB2ER-5.08-3P DB2ER-5.08-3P CN1 1
Connecting seat XH-4A XH-4A CN2, CN3 2
exclusion 0603_X4 102 RN1, RN2 2
DC005 DC-5020 DC005-2.0MM DC1 1
relay RELAY-TH_5PIN_HF3FF-012-1ZS HF3FF/005-1ZS K1 1
button KEY-6.0*6.0-2 SW 6X6X6 KEY1, KEY2 2
ESP-12F LGA22-2.0-24X16MM ESP8266-12F U1 1
Optocoupler SOP-4_4PIN-L4.83-W10.20-PITCH2.54-BL CYPC817(C-TP2) U2 1
Voltage regulator chip SOT-223 AMS1117-3.3_C165482 U3 1
integrated circuit SOP-16_150MIL U74HC595AG-S16-R U4 1
integrated circuit SOP-16_150MIL CH340C U5 1
USB interface UF-M5DD-Y-1 UF-M5DD-Y-1 USB1 1

* 5. Upload pictures of works: (The competition logo must be on the PCB and photos should be uploaded. If not, it will be deemed as giving up the competition)

Finished product front

WeChat picture_20190917145441.jpg

Back of finished product

WeChat picture_20190917145452.jpg

Scan device QR code

image.png

Purchase services

1.jpg

WeChat Pay

payment successful

3.jpg

start operation

2.jpg

job run

IMG_20190912_170253.jpg

* 6. Demonstrate your work and record it as a video for upload: (The content of the video must include: introduction of the work; functional demonstration; performance test; close-up of the competition logo on the PCB. Failure to do so will be deemed as giving up the competition)

Experience URL: http://www.ekongyun.cn The account and password are all default. You can log in by clicking directly. All deletion operations will be intercepted by the backend and will not be executed. Only feedback will be provided on the frontend.

Product operation video  https://v.youku.com/v_show/id_XNDM3MDk4NTM2OA==.html?spm=a2h0j.11185381.listitem_page1.5!2~A

7. Open source documents:

Hardware part code: Link: https://pan.baidu.com/s/1_VAVCGFk5n8tlOtfCmx0bQ Extraction code: zh8u Copy this content and open Baidu Netdisk mobile App, the operation is more convenient.

Part of the code of the management page: Link: https://pan.baidu.com/s/15w0cc-nEuhZFxwbHqVosAQ extraction code: gcal After copying this content, open the Baidu Netdisk mobile app for more convenient operation.

Server daemon code: Link: https://pan.baidu.com/s/1OaP51NyaqHdmHPyVp5ZPZw Extraction code: bnh2 After copying this content, open the Baidu Netdisk mobile app for more convenient operation. NOTE: This is a basic function test implementation program. This code is not actually used for actual use. This code is only provided for enthusiast testing and may have concurrent operation issues.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-19 17:57:51

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号