Improved design of infrared pump based on SPCE061A control

Publisher:tgdddtLatest update time:2011-09-03 Keywords:SPCE061A Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

O Introduction

Infrared pumps are usually used to complete the function of "extending your hand to get water out, retracting your hand to stop the water", and generally provide manual and automatic pumping modes, and have low voltage detection alarm and voice prompts after use. When the infrared pump is working, it generally converts the action of extending your hand to get water out into an electrical signal through a sensor, and emits infrared light through an infrared emitting diode to control the infrared receiving diode in the controlled device, and then uses the intensity of light to change the current in the circuit. When you stretch out your hand, the intensity of the infrared light received by the receiving part decreases, and the intensity of the converted current weakens. When you take your hand away, the infrared directly hits the photosensitive tube, and the output current increases; the second step is to convert the intensity of the current signal into high and low levels that can be recognized by the SPCE06lA microcontroller. Therefore, the circuit needs to have the function of a current-controlled voltage source, with a high level of about 5V and a low level of 0V. To this end, the common emitter connection of a bipolar transistor can be used to achieve this; the third step is to output a control signal by judging the high and low voltage signals, and output the control signal to the motor, and then control the water pump through the motor. This part mainly detects the interrupt of IOB2. When you stretch out your hand, the infrared ray is blocked, the transistor is cut off, and IOB2 gets a high level. That is, the rising edge interrupt application function of IOB2 is used (or the query method is used) to make an interrupt request for draining water to the SPCE061A microcontroller.

Through the above three steps, only the design function can be basically completed. This article has the following three improvements on the above traditional design:

(1) Use the 1*3 keyboard to switch between automatic and manual. In automatic mode, put your hand into the instrument to discharge water, and take your hand away to stop. In manual mode, press key 2 to discharge water, and press key 3 to stop.

(2) The working indicator light circuit module has been improved. When the circuit is in working state, the indicator light is on.

(3) The voice broadcast has been improved. Since the SPCE061A microcontroller integrates two 10-bit DAC (digital-to-analog conversion) modules, this resource can be used to easily realize the conversion of digital to analog signals, making human-computer interaction more friendly, and can also indicate the current working status of the system.

1 Hardware design of infrared pump

The working principle of this system is shown in Figure 1.


This scheme adopts Lingyang SPCE061A single chip microcomputer. GR4010l infrared emitting diode is selected as infrared emitting device. GD1611 silicon PIN photosensitive diode is used as infrared receiving device. QDB-30-3.0 is selected as the driver of the pump. The infrared sensing part can be used to detect whether someone needs to use the pump. It is divided into two parts: infrared emission and infrared reception. The infrared emitting tube adopts GR40101, which mainly controls the emission frequency of the infrared emitting tube by outputting a certain frequency pulse through IOB8. The infrared receiving tube adopts GD1611, which can be detected by using the external interrupt function of IOB2. The voice broadcast part uses the DACl inside SPCE061A to output the signal to the voice circuit, and then uses the A2000 format to play. This system provides 3 buttons, which can be used to set the liquid output, automatic and manual pumping, etc. They occupy 3 I/O lines of IOA0-2 of SPCE061A. The system uses a micro motor as the pump drive, and the motor is controlled by a transistor as an electronic switch. The transistor can be controlled by IOB4 to control the motor. The low voltage detection can be completed by using the LVD unit inside SPCE061A without the need for external components. In addition, the system also provides a light-emitting diode as a working indicator, which can be controlled by IOA5.

Figure 2 shows the control circuit schematic of the system. In the circuit, SPCE061A is the main control chip, and IOA5 controls the working indicator light. When the system is powered on, IOA5 can be controlled to output a high level through the process control, and the working indicator light is always on. The function of the 1*3 keyboard is to set the switching between automatic and manual modes, manual water discharge, and manual water stop, which occupies three ports IOA0-2. When the 1 key is pressed for the first time, the default is automatic mode, that is, when the hand reaches the instrument, the IOB2 port cannot receive the infrared control signal emitted by the IOB8 port, then the single-chip microcomputer controls the IOA4 port and controls the motor to rotate and pump water. When the hand leaves, the IOB2 port receives the infrared signal and controls the motor to stop discharging water. When the 1 key is pressed again, it switches to manual mode. At this time, press the 2 key to start discharging water and press the 3 key to stop discharging water. When the motor changes from rotating to stopping, the single-chip microcomputer controls the DAC1 port to play "Thank you". When the voltage is lower than the voltage value set at the beginning, the system plays a sound alarm.

System control circuit schematic diagram

In Figure 2, the IOB2 port of SPCE061A is used to detect the received signal (the two states of the signal, high and low levels, indicate the action of extending and retracting the hand), the IOB8 port is used to control the infrared emission, the IOA4 controls the micro motor, the IOA5 is the working indicator light, the IOA0-2 can control the 1*3 keyboard, the IOA9 port is for low voltage detection, and the DAC1 port is connected to the voice broadcast. Pins 12 and 13 are the output and input of the oscillator, and pins 16, 17, and 18 are connected to the enable terminal, clock pin, and data pin of the online debugger respectively.

2 Software design of infrared pump

According to the designed functions and hardware circuits, the software part of this system requires the following control programs:

The first is to emit infrared signals. From the infrared emitting diode GR40101, it can be seen that IOB8 of the SPCE061A microcontroller should output a pulse of a fixed frequency to stimulate the device to emit infrared rays, so the program needs to complete this function first. The actual program should generate an 8 kHz pulse through the timing interrupt inside the SPCE061A microcontroller. The specific operation is to calculate how many divisions are required to reduce the frequency to 8 kHz through the crystal oscillator frequency of the SPCE061A microcontroller, thereby obtaining the count value and filling the count value into the counter, and setting the corresponding interrupt register at the same time. Then, in the interrupt service subroutine of the timing interrupt, the statement IOB8=!IOB8 is used to control the IO port to output an 8 kHz square wave.

The second is the reception and processing of infrared signals. As explained in the hardware part, when the hand is extended, IOB2 will have a high level, and in other cases, the pin outputs a low level. Therefore, the high level detection can be realized through the interrupt function of IOB2. When IOB2 has a rising edge, it indicates that the hand is extended at this time, and the system enters the interrupt service program of IOB2, which can complete the function of controlling the water pump and the indicator light.

Then there is the keyboard scanning program. The query method can be used to cyclically detect whether a key is pressed. When a low level is detected at the key port, the corresponding processing program is entered. The keys that manage the automatic and manual modes are implemented in this way, that is, each time a key is pressed, the flag bit changes. If it is 0, it is set, and if it is 1, it is cleared, thereby controlling the selection of manual and automatic. Other keys enter the key processing program for corresponding processing, and voice output is started at the same time.

Figure 3 shows the software flow chart of this system. First, the system is initialized, then each IO port is initialized, and finally the system task is executed. The process of the main task is that IOA0-2 ports are all at a high level. When a key is pressed, which port becomes a low level, and then the level value of the IOA0-2 port is detected. If it is found that a port becomes a low level, the information is sent to the main task side to wait for keyboard information. When the person finishes using it, the system returns to the upper layer and continues to wait for keyboard information; if it is found that all ports of the keyboard are high level and no port becomes a low level, it returns and then continues the keyboard scanning task.

3 Conclusion

This paper presents an improved design method of an infrared pump controlled by the single-chip SPCE061A produced by Lingyang Company. The improved pump has three additional functions: manual and automatic mode conversion, low voltage detection alarm, and voice prompt after use. Actual tests have proved that the device also has the characteristics of strong anti-interference ability, error-free operation, and power saving.

Keywords:SPCE061A Reference address:Improved design of infrared pump based on SPCE061A control

Previous article:Summary of the learning process of C and C++
Next article:Principle and software design of real-time clock device X1226

Recommended ReadingLatest update time:2024-11-16 18:10

A design scheme for an intelligent car robot
There are many technologies to realize the intelligentization of automobiles. This paper uses the currently popular voice control technology to realize the automatic forward, backward, left and right turns of the car. Of course, the designed car is only a micro model of the intelligent car and is still in the simulati
[Microcontroller]
A design scheme for an intelligent car robot
Analysis and processing of the output signal of the RF reader/writer by SPCE061A single chip microcomputer
At present, the application of readers is becoming more and more widespread. In the process of production and sales, people often suffer from the lack of a quick and easy way to intuitively display the output signal of the reader, so that the product often needs to be reworked and the signal output of the product
[Microcontroller]
Intelligent charger based on SPCE061A
With the development of modern science and technology, green and environmentally friendly energy - rechargeable batteries are increasingly widely used in people's lives, but this also raises a question, that is, how to charge batteries efficiently and conveniently . Based on t
[Power Management]
Intelligent anti-theft and fire alarm system based on SPCE061A
With the development of economy and technology, the security methods of rooms are constantly changing. Traditional preventive measures have great drawbacks. For example, when an accident occurs, protective iron doors and iron railings will become the biggest obstacle for the owner to escape. The use of intelligent f
[Microcontroller]
Intelligent anti-theft and fire alarm system based on SPCE061A
Design of hip force tester based on SPCE061A
1 Introduction With the continuous improvement of the scientific level of sports training, the necessity of human body special strength training has been increasingly valued. Through the overall analysis of a large number of actual sports test data, it is found that the backward extension force of all athletes engaged
[Microcontroller]
Design of hip force tester based on SPCE061A
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号