
Based on Liangshanpai electronic material storage box
License
:GPL 3.0
Description
I. Background
============================================================================
Nowadays, in an era of electronic information, some companies, schools, classrooms, shops, etc. engaged in electronics need to reserve some electronic component materials. Due to the wide variety of materials, it is very inconvenient to take them.
II. Implement functions
============================================================================
(1) It can search for which cabinet a certain electronic material is placed in and automatically open the cabinet to light up the prompt;
Can add/remove a cabinet, add/remove an electronic material.
All stored electronic materials can be queried in detail.
You can check the remaining empty cabinets.
(5) It has the function of saving information after power failure;
The interaction pattern should include screen touch, automatic speech recognition, and mobile phone search.
To be added: Realize the reminder of misplaced storage boxes through RFID.
III. Control mode
============================================================================
I originally wanted to use wireless methods, but wireless methods require each container to have a wireless module and battery, which is a bit expensive for me, so I gave up the wireless solution.
1. Host
Install 16 slave interfaces on the host, that is, the maximum access container is 16; control the slave through 5 lines, namely 5V power supply positive and negative, servo control line, signal light control line, and box detection switch line.
Through the 595 and 165 control 16 channels from the machine, the screen uses Taojing Chi serial screen (7 inch capacitive touch screen), automatic speech recognition uses the smart SU-03T movement, mobile phone control through the WIFI module ESP8266 control.
2. Slave machine
The control method is to use the servo to pop up the container and light up the prompt. Then install a travel switch to detect whether the container is back in place. Install the slave behind the storage box. When the slave receives a signal from the host, control the servo to push out the container and light up the prompt.
IV. Technical indicators
============================================================================
1. Can search for the cabinet where a certain electronic material is placed and light up the prompt;
Because every time a material is added, the information of the material needs to be filled in and its container number needs to be saved. As long as the 16 container information saved in the flash is found, if the data is the same as the searched material data, it will pop up and light up.
2. Can add/remove a cabinet, add/remove an electronic material;
When on the homepage, check whether there is a Add Material or Delete Material mode on the touch screen, and if so, enter the corresponding mode.
Add container: In the add material mode, edit the new material information on the touch screen interface to complete the addition of cabinets or materials.
Delete container: In Delete Material mode, select the corresponding material container to delete.
3. You can check the details of all stored electronic materials;
Every time a material is added, the material data is saved in the flash of the chip, and all the data can be retrieved and displayed.
4. Can check the remaining empty cabinets;
Real-time detection of the box detection switch line in the machine line, when it is detected that there is no cabinet state (without access to the container), it indicates that the corresponding container interface is not connected to the container, and the interface that is not connected to the container can be displayed.
5. Locate the materials and open the cabinet automatically;
There are three ways to search, namely: mobile phone search, voice search, and touch screen search.
Mobile phone search: Make an Android software, mainly using socket and WIFI module ESP8266 for communication. Input the material information to be found on the mobile phone, and send it to the host for identification through WIFI. Need to have the function of mobile phone connection detection and material information transmission.
Voice search: Set some commonly used electronic components as voice commands, say the corresponding electronic component value + name, such as 1K resistor, and the corresponding container will pop up if the recognition is successful. Because the number of voice commands is limited, this function has a large defect.
Touch screen search: In the search material mode, all material information will be displayed and classified, and it can also be found through the touch screen's own Pinyin input method.
V. hardware design
============================================================================
1. Power supply part
It is powered by 3 batteries and charged with TC4056, with a maximum charging current of 1A. It uses two different USB ports to prevent the situation where there is no charging cable.
2. Serial port debugging
Because the WIFI module and automatic speech recognition communicate through a serial port, it's a waste to add USB but not use USB debugging function.
So a 340N is added. In the H6 pin header, you can short-circuit 340 to the WiFi module (U1RXTX) or short-circuit 340 to the voice module (B2B3) to achieve computer serial port debugging.
3. Boost circuit
Because the battery power is unstable, the battery voltage is increased to 5V, and then converted from this 5V to the required 3.3V.
Because there are many power consumers, with a 7-inch screen, automatic speech recognition speaker, WIFI module, and 16 servos. So I boosted the voltage from the battery to 5V for each part, and found that there was no power shortage problem after testing.
4. Module power gating
At first, the low-power design that came to mind was to disconnect the power of unused modules to reduce power consumption. So how to disconnect the power supply? I used a MOS tube control. When the signal terminal (such as CPKCON in the figure) is turned on by the low-level MOS tube, the battery voltage is output to CKPIN, and then CKPIN passes through the boost circuit of the module. The signal terminal (such as CPKCON in the figure) is turned off by the high-level MOS tube.
(Only the power gate control of the serial port screen is screenshot here)
VI. Software design
============================================================================
The code is a bit rubbish. If there are any places that can be saved, please boss point them out (bow).
1. Power detection display part
Divide the voltage through two resistors and calculate it through the voltage division formula
Use ADC to collect 100 times through DMA transmission, filter and display.
2. WIFI section
Mainly achieve two functions, one is to obtain network time for calibration; the other is to exchange data with mobile APP.
The downloaded firmware is MQTT firmware, the 1MB one. (If the WIFI module is AT firmware, just change the command AT + RST and the reply is OK.)
Too much code... can't write it anymore... let's skip it.
V. Achieve
============================================================================
1. Screen UI
Information link: http://wiki.tjc1688.com/doku.php?id=start
The screen is powerful. I directly put the time calculation and display function on the screen to run by myself (the screen comes with RTC function). As long as the microcontroller transfers a start time to the screen at the beginning, the screen can run the clock effect.
The "7-inch Screen Electronic Material Management Cabinet. HMI" in the attachment is based on the UI interface designed for this project.
2. Mobile APP
Designed using Android stdio. The [app-debug.apk] in the attachment is the Android app designed based on this project; the size is 3.73MB.
Permissions involved:
1. Access the network (check whether the WIFI connection of the storage box is successful)
2. Obtain network information status (determine whether the WIFI connection of the storage box is successful).
3. Obtain WIFI status (determine whether the WIFI connection of the storage box is successful).
4. Obtain location permission (if you want to add this permission, but find that if you don't add it, it will crash)
5. Memory read and write permissions (save the container information sent by the storage box. After closing the software, the container information will be automatically deleted, so there is no need to worry about the memory getting bigger).
Statement: I only know how to design simple applications for Android apps, sorry about IOS's (crying)
Summary
Debugging record:
2022-12-25
The general framework has been built and basic functions have been implemented.
Currently unfinished part:
Every container can be used
Out of the cabinet indicator light (LED)
Cabinet detection switch (travel switch)
Automatically shut down after a certain period of time
Minimize power consumption
2022-12-31
Add automatic speech recognition function, which can pop up voice in "Home", "View All Materials Mode" and "Access Materials Mode".
Improve the pop-up function of most containers.
Improve the time section, there will be no missing minutes or seconds after the interface jumps; add network calibration and improve manual calibration.
Find new issues:
When obtaining network time on the initialization interface, after clicking the "Cancel" button, although the interface jumps, the program still gets stuck in the network time acquisition section until it succeeds or times out.
2023-07-06
Adjusted the container inspection. But!!
The graduation project has been submitted! The actual product is gone. (wailing in pain)
Designed by 老怪鸽 (from OSHWHub)
a:https://oshwhub.com/int_and_long/ji-yu-liang-shan-pai-dian-zi-wu-liao-shou-na-he
Design Drawing


Comment