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↓]
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.
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.
The device's MQTT server is built using the open source EMQ developed by ERLANG.
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.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.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;
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 |
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
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.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet