In the hot summer, the ice drink, the watermelon of Ice is never absept ... Of course, there is a hot big sun in the top. Recently, the graffiti "siege" small and a few friends is about a higher racket, and the scene has been running half an hour, and the brakes are braking ...
He found that there was no place to sell water around, and finally there was a convenience store in front of him, and the tonne tonne tonne did the water.
Imagine the top of the six or seven strong Han, it is not easy to drink the water!
At this time, Xiao Zhang thinks that you have passed the subway station every time, you will see the subway station has an automatic container specializing in the mask. To solve the urgent needs of consumers to share masks or masks damage, in the office, tea will place a snacks , Beverage vending machine, eliminating the exhaustion of the afternoon ...
Then, in the basketball hall with beverage automatic sale containers, the gap replenishment moisture is an inevitable demand! Xiao Zhang's brain flashes a thought, it is better to DIY a vending machine to solve the summer troubles of players.
The heart is going to act, and Xiao Zhang immediately grabs ~
No.1 hardware design
The intelligent vending machine integral hardware scheme consists of a master unit, a motor drive control unit, a motor to a position detection unit, a wireless communication unit, and other peripheral units.
1, the main control unit
The main control uses a 4G chip of the graffiti. The chip is based on the high-density performance 32-bit microprocessor of the ARM architecture. The main frequency can support 72 MHz, up to 11 timers, integrated reset circuit, low voltage detection, regulator, and precise RC oscillator circuit.
2, power supply unit
The vending machine mainly includes the power supply of the following components:
Main power: You need to enter 24V DC power as a main power source. The 24V DC power can directly connect the MOS tube as the input power of the motor in the vending machine.
Wireless communication unit: The power supply voltage is 4V, which can be converted to 4V to 4V using the LM2576 DC-DC regulator chip.
Master cell chip: Generally, the supply voltage is 3.3V, using S-1206B33-U3T1G this LDO chip reduces 4V voltage to 3.3V.
3, motor drive control unit
With a 74HC595 eight-bit serial input, the shift register of the parallel output is used to provide a control signal for outputting each motor.
4. Motor is in place detection unit
With a 74HC165 eight-bit parallel input, the serial output shift register is used to detect the position of the motor rotation.
5, wireless communication unit
A LTE Cat.1 cellular network module developed by graffiti intelligence is used for information interaction of vending machines and cloud platforms.
6, other peripherals (you can also design it according to the development needs)
Increase the network indicator to indicate the current network status.
Increase the power indicator to represent the current power status.
Increase the temperature sensor for detecting the internal temperature of the vending machine.
Increase the drop detection device, which is used to detect whether the item does drop, and form feedback.
Increase multiple buttons for a specific key function.
Increase the RS-485 communication interface for the vending machine to communicate with other RS-485 devices, enhance linkagence.
Increase the liquid crystal display unit for human machine interaction.
After completing the design of the above hardware, the corresponding PCB can be designed according to the structure size, and the welding, testing and other work can be completed.
No.2 Create product
Log in to the Graffiti IoT platform, click Create Products. In the standard category navigation bar, select Outdoors> Smart Electric Vehicles (due to vending machines and smart electric owners control the same 4G module, "it is classified in" Outdoor Export ").
Note: Create product specific operations can refer to operation instructions within the platform.
No.3 Embedded Development
Our smart vending machine packages have been opened to Github, you can download it yourself.
Note: The specific address of GitHub pays attention to "Doodle Developer", you can get "vending machine", you can get it ~
There are two points here to pay attention:
1. After obtaining the MCU SDK, you need to add an SDK file to its own project, modify according to the error message in the compile.
Note: Details of the specific transplantation method can be obtained by paying attention to the "graffiti developer", copy the "MCU SDK transplant" to the recovery column, you can get it ~
2. Since the MCU and the selected PIN pin are not necessarily the same, it is necessary to process according to the actual hardware.
Installing the development package requires setting the following serial port and chip driver: (Please refer to GitHub full calendar case)
Serial configuration
Serial port receiving data
Serial port transmission data
Read 74HC165 data
Send 74HC165 data
Dedicated serial event processing
No.4 Edit and download
After the program is written, click Build and modify the relevant error or warning information based on the software prompt.
After the program is compiled, you can download to the development board for debugging and testing.
STM32 supports ST-LINK, J-Link and other tools, here we use ST-LINK as an example, the pin connection is as follows:
After the connection is correct, click Download to download the program to the development board.
No.5 Action demo
Open the graffiti intelligent app, enter Xxyyzzzzzzzz in the ITEM input field, where:
XX represents the first line;
YY indicates the amount of items remaining on the car;
Zzzzzzzz is the order number (can be any value).
For example: Enter 0104aabbccdd, indicating that the remaining 4 items remaining, the order number is AABBCCDD. After the data is transmitted, it can be seen that the motor starts to rotate. When the item falls, the motor stops rotation.
Note: The remainder of the current lane must be the same as the input item number. For example, when there are 4 items in the first container, only input 0104 will be effective, enter 0105 or 0103, etc., the motor will not rotate of.
Such an MCU SDK low-code development, maximizing promotion, supporting mobile phone app self-service transactions, and vending machines for 24-hour distribution of goods are completed! Convenient you and your life, come to DIY exclusive vending machine, happily happiness ~