The mobile value-added service of vending machines is a new business model and a new market channel, and has a large customer base. Due to the mobility, convenience and security of mobile e-commerce, it will surely attract many merchants and customers to use it for business and consumption activities. This will lead to the formation of a mobile value chain, successfully bind users, integrate them into all walks of life in society, and make all walks of life in society inseparable from mobile, ultimately forming a "win-win" situation.
Hardware Design of Embedded System in Vending Machine
(1) MCU part
The ATmegal28 microcontroller produced by Atmel integrates a large capacity memory and rich and powerful hardware interfaces: timer/counter, real-time clock, PWM channel, A/D converter, I2C serial interface, programmable serial USART interface, SPI serial interface, programmable watchdog timer with on-chip crystal oscillator and on-chip analog comparator, etc. It is very distinctive in terms of power saving performance, stability, anti-interference performance and flexibility. The microcontroller system is powered by a 5 V power supply, and the external power supply is 24 V, which is converted to 5 V by the LM2576s chip switching power supply and is the main power supply of the system.
(2) GSM/GPRS module
The GSM/GPRS module uses the BENQ M22 module, as shown in Figure 1.
GSM/GPRS module uses BENQ's M22 module
The module uses the standard AT command set. The normal operating voltage is 3.3-4.3 V. The 5 V VCC is stepped down to about 4.3 V by IN5401 for the module to use, as shown in Figure 2.
GSM/GPRS module power supply
Since the GSM/GPRS module has instantaneous pulsating current, a 2200 μF electrolytic capacitor was added during the circuit design process to meet the module's instantaneous high current requirements.
(3) LCD part
The OCMJ Chinese module series LCD display of Jinpeng Technology Co., Ltd. contains GB 2312 16×16 dot matrix national standard first-level simplified Chinese characters and ASCII8×8 (half-height) and 8×16 (full-height) dot matrix English word library, so that the system does not need to expand external storage space. The user can display text by entering the area code or ASCII code. This series of modules has commands to move the current display screen up/down/left/right and clear the screen. All initialization settings of the OCMJ Chinese module are automatically completed when powered on, realizing "plug and play". At the same time, a dedicated reset line is reserved for forced reset. The 10 neatly planned user interface command codes are very easy to remember. The hardware interface adopts REQ/BUSY handshake protocol, which is simple and reliable. The positive pin of the backlight source of the OCMJ5XlO module requires a large current to ensure the brightness of the LCD, so a 9012 transistor is added for amplification. The selection of the transistor base resistor must consider the characteristics of the transistor at low temperature to ensure that the LCD can be driven normally.
(4)ISP download interface
JTAG emulators are relatively expensive, so using ISP download plus serial port debugging can save costs. The ATmega 28's PDI, PDO, SCK and RESET plus VCC and GND form the ISP interface. Use the download cable and related software provided by Guangzhou Shuanglong Electronics to perform fuse configuration. As shown in Table 1: If CKSEL3..1 is 111, it is configured as an external crystal oscillator 8 MHz, and can be downloaded using the ISP download cable. Use the serial port LJSARTl of ATmega]28 to communicate with the PC, and the hyperterminal is used to display the debugging information.
(5) The motor drive part and the motor 5×10 control array
The process of the vending machine dispensing beverages is actually the action of the motor to push the beverages down. Since the motors are all inductive, there will be reverse current when they stop, so the PC847 optoelectronic isolator is needed to isolate the control and drive signals, and then use L293D to drive the motor. The motor drive requires a 24 V voltage. The control signal is converted into a power signal of about 24 V after passing through L293D to drive the motor. The motor has three wires: power supply, ground wire and feedback signal (the motor sends a low level when it rotates one circle). Since 50 motors are to be controlled, 15 I/O ports of the microcontroller are occupied, of which 5 are row lines with low validity and 10 are column lines with high validity, forming a 5×10 array. When the motor moves at an intersection with a low row and a high column, the goods are pushed out. In mechanical manufacturing, the motor rotates one circle just to push out a bottle of beverage, and the motor rotates one circle at the same time to generate a feedback signal, which stops the motor. Another case is that the motor stops rotating when infrared detects that goods have fallen.
Software design of embedded system in vending machine
The built-in main control module controls the internal processes of the vending machine for actual management, including: dispensing process, transaction process data reporting, LCD user interface display and fault reporting.
The program of the vending machine control board is written in C language, and the development environment uses ICCAVR provided by Atmel. The control board program block diagram is shown in Figure 3.
Control panel block diagram
USSD wireless communication method
USSD (Unstructured Supplementary Service Data) is defined as a mechanism for transmitting information and instructions between mobile stations and network applications through the Home Location Register (HLR). It provides a text-based interface for mobile communication users to manage their services. USSD uses a stand-alone dedicated control channel SDCCH (Stand-aIon (Dedicated Control ChanneD) with a data transmission rate of about 600 bps in the call state; when not in the call state, USSD uses a fast auxiliary control channel FACCH (Fast Associated Control Channel) with a data transmission rate of about 1 kbps, which is higher than the SMS transmission rate.
Introduction to the main functions of vending machines
The vending machine is the terminal interface that users directly face. The main functions of the above design scheme are:
① Storage and delivery of goods. The vending machine stores the goods to be sold. For example, a beverage machine can store up to 300 beverages. The vending machine is equipped with a constant temperature control system and a closed storage space, which can effectively ensure the storage period of goods under various complex climatic conditions.
② Wireless data exchange. The vending machine has wireless communication function, which can be connected to the existing (3SM/CDMA network, accept various wireless communication connections initiated by the network side, and can also actively initiate connections to the GSM/CDMA network. Through wireless data exchange, wireless remote control of the vending machine can be realized, and the current system status and sales situation of the vending machine can be obtained in real time, so as to realize the controllable transaction process of the entire business. The wireless communication methods supported by the vending machine include: SMS, USSD, GPRS and CDMA lX. For the software and hardware design of the vending machine in the embedded system design example
Summarize
The vending machine is just one of the embedded system design examples. There are many other embedded application cases, so I will not introduce them one by one here. This article mainly introduces the hardware design of the embedded system in the vending machine, namely the design of the microcontroller, GSM/GPRS module, LCD, ISP download interface and other parts as well as the software part, and briefly analyzes the main functions of the vending machine.
Previous article:High-power intrinsically safe buck switching converter using LC filtering
Next article:51 MCU Design Schemes TOP10 (I)
- Popular Resources
- Popular amplifiers
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- MSP430F5529 clock multiplier setting is effective
- C language basics, I think it's a good book
- Musk asked engineers to write the code silently: tear it up after review and recreate it on the computer
- DIY an eco-bottle
- How many layers does TCP/IP have? What is the function of each layer?
- MSP430 Flash information area
- 【Silicon Labs Development Kit Review 04】_Simplicity Studio v5 printf redirection
- How to choose a wireless router to maximize the transmission rate of WIFI
- Design of interpolation filter based on FPGA
- Fundamentals of Digital Electronics (Fifth Edition)