Design and implementation of vending machine based on embedded system

Publisher:HarmoniousVibesLatest update time:2013-05-22 Keywords:Embedded Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
We know that the root of intelligent devices lies in the development and application of embedded systems (embedded system development process). With the continuous development of electronic technology, many intelligent devices have gradually replaced manual labor. Vending machines are one of the intelligent devices based on embedded systems (what is an embedded system). For embedded system design examples, the editor will take the software and hardware design of vending machines as an example to briefly introduce the application of embedded systems. Let's first look at the knowledge about vending machines (embedded system programming).

  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.

Keywords:Embedded Reference address:Design and implementation of vending machine based on embedded system

Previous article:High-power intrinsically safe buck switching converter using LC filtering
Next article:51 MCU Design Schemes TOP10 (I)

Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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号