This paper introduces the design of a smart medicine box based on STC90C516RD+ single-chip microcomputer. The main structure includes main control unit, clock unit, alarm unit and display unit. The display unit displays the relevant information of the medicine and the time of taking the medicine, which is beneficial for the user to grasp various information in time; the alarm unit can perform an alarm reminder within a prescribed time to ensure that the user can take the medicine in time.
For those who are forgetful, those who need to take medication for a long time, those who need to be hospitalized, and those who are busy with work, it is difficult to remember clearly the information about different drugs and the time of medication and to ensure that they take medicine on time. How to promptly remind the above people to take medicine on time and in volume is a difficult problem. Aiming at this problem, this paper designs a smart medicine box based on the enhanced 51 single-chip microcomputer - STC90C516RD + single chip microcomputer. The medicine box is provided with a detecting unit to detect whether the user takes the medicine on time within a prescribed time. When detecting that the user has taken the medicine according to the time, the user is prompted to take the medicine through the display unit to avoid repeated taking medicine. Through the display unit, the user can conveniently obtain information such as the current medication situation, medication time and drug information.
1 working principleThe design is mainly composed of main control unit, clock unit, detection unit, alarm unit, display unit, power supply unit and host computer software. The main control unit is composed of STC90C516 RD+ MCU module; the time unit is composed of DS1302 clock module. It is used to detect the current time information; the detecting unit is composed of a photosensitive sensor module and a DS18B20 module, respectively detecting the condition of the medication and detecting the ambient temperature; the alarm unit is composed of a buzzer module and a GSM short message module, respectively performing an on-site sound alarm prompt and SMS alarm prompt; display unit displays information about the drug name, usage and usage of drugs, time of medication, medication and current date and time information; power supply unit provides power required by the system; PC software through RS232 interface and master control The unit communicates. The structure of the medicine box is shown in Figure 1.
The main control unit plays the role of information processing and control in the whole ICare system. The main control chip selects the enhanced 51 single-chip microcomputer - STC90C516RD + single chip microcomputer. STC90C516RD+ MCU is a new generation of super anti-interference, high-speed, low-power MCU based on 8051 core. The instruction code is fully compatible with traditional 8051 MCU, including central processing unit, 64 kbyte Flash program memory, 1280 bytes SRAM, 35 Bidirectional input/output (I/O) port, three 16-bit timer/counters, eight interrupt sources, on-chip clock oscillation circuit.
2.2 clock unitThe clock unit uses the DS1302 chip from DALLAS. The DS1302 is a low-power real-time clock chip with a fine current charging capability that includes a real-time clock/calendar and 31-byte static RAM that can communicate with the microcontroller via a serial interface. It can count the year, month, day, week, hour, minute and second, and has many functions such as leap year compensation. The DS13 02 uses the SPI three-wire interface to communicate synchronously with the CPU, which are reset (RST), I/O data lines, and serial clock (SCLK).
2.3 detection unitThe detection unit consists of a photosensor module and a temperature sensor DS18B20 module.
1) Photosensitive sensor moduleThe photosensitive sensor module outputs a high level when the light box is not opened or the light intensity does not reach the threshold value, that is, when the medicine box is not opened; when the ambient light intensity exceeds the set threshold, the medicine box is opened, and the low level is output. The main control unit determines whether the patient opens the medicine box to take the medicine by detecting the high level and low level of the light sensor module output. The schematic diagram of the photosensitive sensor module is shown in Figure 2.
The DS18B20 module is a commonly used temperature sensor with the advantages of simple temperature measurement system, high temperature measurement accuracy, convenient connection, less occupied line, strong anti-interference ability and high precision. The module adopts a unique single-wire interface mode. When the microprocessor is connected, only one port line is needed to realize the two-way communication between the microprocessor and the DS18B20, and the measurement result is serially transmitted in a 9-12 digit digital manner. No external components are required in use.
The main control unit detects the current ambient temperature in real time through the temperature sensor DS18B20 module, and displays the current temperature information through the display unit. The display effect is shown in Figure 5.
2.4 alarm unitThe alarm unit consists of a buzzer module and a GSM short message module.
1) Buzzer moduleThe buzzer is an integrated electronic sounder that uses DC power and is widely used in electronic products such as computers, printers, copiers, alarms, electronic toys, automotive electronics, telephones, timers, etc. as sounding devices. The buzzer module has a simple structure and is convenient to use, and the buzzer sounds can be driven by the timing of the main unit I/O port timing flip level.
2) GSM SMS moduleThe GSM SMS module uses the Himto 300 module. The Simcom 300 module is an industrial grade GSM/GPRS module with an industrial standardized interface, small size, low power consumption, single voltage supply, EGSM900/1800/1900 frequency band support, AT command setting, embedded TCP/IP protocol, It can realize the function of sending and receiving Chinese text messages from point to point.
In this design, the GSM short message module and the main control unit are connected by serial communication, as shown in FIG.
The display unit adopts a 2.4-inch color tft liquid crystal display, and the display color is 262 k (260,000 colors). The image is fine, and has the advantages of good display effect and low power consumption. The schematic diagram of the display unit is shown in Figure 4.
Pin description: 1 pin, ground (GND); 2 pin, power pin (Vcc); 4 pin, control register / data register select pin (RS), select control register when low level; 5 pin, write signal Pin (RW), valid at low level; 6 pins, read signal pin (RD), valid at low level; 7 to 14 pins are 8-bit data bus (DB0~DB7); 15 pins are chip select (CS), Active at low level; 16-pin, reset pin (RST), active at low level; 3, 17, and 18 feet are floating. The display unit display effect is shown in Figure 5.
Smoking Accessories,Smoking Accessories For Water Pipe,Smoking Accessories With Ash Catcher,Cuts Smoking Water Pipe Accessories
Shenzhen Essenvape Technology Co., Ltd. , https://www.essenvape.com