The Design of Household Multifunctional Aquarium based on HT66FU50 Microcontroll

时间:2022-07-22 06:43:04

Abstract. Using HT66FU50 as main control chip, along with sensors and associated circuitry, a family multifunction aquarium is designed. It’s a fully automatic aquarium, which can monitor the water’s temperature and oxygen level, can automatic intelligent control feeding, music playing, and oxygen increasing. It also incorporates functions of status displaying, parameter setting, auto-power-off when fault, etc. This design is low cost, easy to use, and has worthy of popularity.

Keywords: HT66FU50; Sensing Technology; Temperature Sensor

Introduction

Fish breeding is a headache in many families. First, the oxygen content can’t be controlled by people. Second, there will be a waste of power supply if oxygenating pump is continuously opened. Third, the anomalous change of the water temperature is easy to result in the deaths of fish. Finally, the master is away from home for a long time, so that the deaths of fish are caused.

According to the above problems, a household multifunctional aquarium of oxygen content and water temperature monitoring/detection, smart control/judgment, automatic oxygen filling, automatic feeding, music playing, oxygen content, temperature, and time display, parameter setting, and automatic power-off in equipment failure is designed, so as to implement smart fish farming.

Working principle

Household multifunctional aquarium consists of temperature detection circuit, timing oxygen supply circuit, stepping motor feeding circuit, lights control circuit, music control circuit, display circuit, and power supply circuit, which are centered at HT66FU50 as main control chip. The complete machine is as shown in figure 1. The circuit function of each part is implemented through the main control chip.

Automatic oxygen filling

Whether the oxygen content is normal in the water of aquarium or not can be automatically detected through the sensor. If it is lower than the limit of fish’s oxygen demand, a signal is transferred to the single chip microcomputer, and then the oxygenating pump is controlled by the single chip microcomputer to fill oxygen. If it is normal, oxygen is regularly filled according to the predetermined oxygenating time. The temperature of the water in the aquarium is monitored by the temperature sensor. If the change range of the water temperature is too big, the oxygen deficit of fish will be caused, and then the oxygenating pump is controlled by the single chip microcomputer to fill oxygen.

Regular feeding

Automatic timing provides food for the fish. The food is put into a container, and then will be regularly and quantitatively provided for the fish through the single-chip microcomputer control.

Music playing

A small MP3 is designed and its sound is amplified with a power amplifier. Under the HT66FU50 infrared remote control, the power switch, song change, and volume adjustment of it are controlled by users.

Ornamental value and display

2 groups of 74HL colored lights are used, and each of them includes 8 lights. They are placed in the two corners of the aquarium respectively. By writing program in HT66FU50, the changes of different colors and the different ways of flashing are controlled. Also, the bubble stones are configured for rendering the whole aquarium to be multi-colored, so that the ornamental value is greatly enhanced.

Hardware

The power supply circuit

In this design, a three-terminal voltage chip LM7805 is used for forming the power supply circuit, as shown in figure 2. For JP1, the power supply of the whole machine is 9V; JP2 supplies +5V voltage by LM7805 to the whole system. C1 and C2 are the input filter capacitances of three-terminal voltage regulator. C1 is the electrolytic capacitor 100UF/16v for filtering the low frequency interference signals of dry battery and making the output direct current smoother. C2 is the monolithic ceramics capacitor 104 for filtering the high frequency interference signals of dry battery. D1 is fly-wheel diode 1N4007 mainly for preventing the reverse positive and negative electrodes of battery 9V, so as to protect LM7805. The role of C3 and C4 is the same to the role of C1 and C2.

Oxygen supply module

The setting of oxygen sensor is read in the single chip microcomputer, and the relationship of the acquired temperature and the current atmospheric pressure with the dissolved oxygen in water is acquired through the temperature sensor. This relational table is also read in the single chip microcomputer, and then the acquired temperature and atmospheric pressure are consulted in contrast; through the look-up table, the content of dissolved oxygen in water is determined in theory. Then, a function relation is solved according to the relationship among the above three sides, as shown in figure 3 after MATLAB simulation.

Stepper motor feeding module

By writing programs in the single chip microcomputer, user can set the automatic feeding time and control the rotation of the stepping motor through HT66FU50 single-chip microcomputer, so as to put food into the aquarium. Specifically, there is a round box to hold food and there is a bar of gap on the round box, while the size of the gap can be set freely.

Temperature detection module

The temperature detection and control are implemented mainly through the connection between DS18B20 temperature sensor and the single chip microcomputer, and the oxygenating pump is started up for filling oxygen when the temperature change is abnormal. A single bus protocol is applied to the digital temperature sensor DS18B20, namely, only one I/O port is necessary for the interface of the single chip microcomputer, and the temperature of the environment can be converted into digital signal without any external components and then is serially output in the way of digital codes, so that the interface between the sensor and the microprocessor is greatly simplified. The cost is lower once there are fewer components to need. The working flow of the temperature sensor DS18B20 is as follows:

(1) Work timing sequence

① Pull the data line to high level 1

② Delayed

③ Pull the data line to low level 0

④ Delayed

⑤Pull the data line to high level 1

⑥ Delay waiting: If the initialization is successful, a low level 0 returned by DS18B20 is produced within 15~60ms, and then its existence is determined according to the state. However, it is noticeable that unlimited waiting is prohibited, and otherwise the program will go into an endless loop. Thus, timeout is necessary to judge.

⑦ If CPU reads the low level 0 in the data line and also there is a time delay necessarily, the period of the delay is at least 480 us from sending a high level.

⑧ End after the data line is pulled to high level 1 again

⑵ Write data time sequence

① preset the data line to low level 0

② Delay for 15us

③ send data from low level to high level

④ the period of delay is 45us

⑤ Repeat steps ①-⑤ until the entire byte is sent completely

⑥ Pull the data bits to high level

⑶ Read data time sequence

① Pull the data line to high level 1

②Delay for 2us

③Pull the data line to low level 0

④Delay for 6us

⑤Pull the data line to high level 1

⑥Delay for 4us

⑦ A state bit is obtained after the state of the data line is read, and also the data is processed

⑧Delay for 30us

⑨Repeat steps ①-⑨ until the entire byte is read completely

Music module

A MP3 music player is designed and its power is amplified through TDA2822M, and then is connected to the central processing unit (CPU); under the infrared remote control, music play switch, volume size, and song changes can be controlled, and the control circuit is as shown in figure 4.

To let the aquarium full of variety, an underwater adjustable lighting system is designed for users in this system, and therefore users can set by themselves to start a light. The underwater lighting system includes two parts and is controlled using M74HC595BL, and its colored lights circuit is as shown in figure 5. The first part is the background light and includes a total of eight LEDs. Users can set by themselves to start any lights. Because there are many lights, 8-bit binary but rather than the computationally trivial hexadecimal is used in this system for indicating whether it is turned on or off. The second part is the bubble stone light, and adjustable lights are added into the bubble stone for users in this system, so as to make the bubbles bright and colorful. In this part of light, there are also a total of eight LEDs, which are the same to the setting of the background light, and the light is turned on and off with binary. For example, the background light is set by users to 10101010, and then the first light among the eight LEDs is turned on, the second is turned off, and so on.

Display module

Using liquid crystal display, time, date, and week, temperature, oxygen content, and preset values can be displayed. In addition, the bubble stones are used to be cooperated with the underwater lighting system, so as to make the lights colorful.

Software

The software is to process all kinds of data and also implement relevant operations using HT66FU50 as the master microcontroller chip, and the work flow of the software is as shown in figure 6. This system includes the oxygen system, feeding system, underwater lighting system, and monitoring and time system and so on. For the oxygen supply system, oxygen supply device is controlled by HT66FU50 single-chip microcomputer, in which users are allowed to set the oxygen supply time and interval.

Timing feeding system is similar to the oxygen supply system, in which users are allowed to set the automatic feeding time interval according to the practical rule (unit: hour; the maximum hours are 9999; the unit can be set according to most feeding), and the system will drive the automatic feeder once time is out. Users are also allowed to set the amount of fish: one or more fishes can be set more appropriately if there is fish with good more appropriate.

To let the aquarium colorful, an underwater adjustable lighting system is added for users. Users can set by themselves to start a light. The underwater lighting system includes two parts. The first part is the background light and includes a total of eight LEDs. Users can set by themselves to start any lights. Because there are many lights, 8-bit binary but rather than the computationally trivial hexadecimal is used in this system for indicating whether it is turned on or off. The second part is the bubble stone light, and adjustable lights are added into the bubble stone for users in this system, so as to make the bubbles bright and colorful. In this part of light, there are also a total of eight LEDs, which are the same to the setting of the background light, and the light is turned on and off with binary.

Testing method

Under the normal condition, all functions of the aquarium are tested. The water parameters such as oxygen content of the aquarium are artificially changed, and the operations of the detection and oxygen supply devices are tested, so as to adjust and set the oxygen supply time interval. Automatic feeding time can be set, and then the system operation and the process of automatic feeding are observed, and then the feeding time interval can be adjusted. The operation way of colored lights is observed and also adjusted, so as to make them more bright and beautiful. The testing environment is as follows: the current room temperature is 23℃, the condition is that tap water is for the aquarium, and fish food and goldfish are bought from the market.

Conclusion

The designed household multifunctional aquarium is a device with comprehensive and easy-to-use features. There are automatic water temperature and oxygen content detection, automatic oxygen supply and feeding, and lighting, music, time display functions, etc. At the current market, most aquariums are used alone with a single function, so users need to buy all kinds of equipment for implementing the above several aspects, and also have to manually turn on or off the aquariums, making money wasted and also troubles appear. This system, however, is completely without these problems, because it is an integral whole for users to economically and affordably use it, and also is easy to use.

References

[1] XIAO Zheng’an. The Blue-tooth Wireless Serial Communication between Train Operation Data Fields and PDA based on C# [J]. Journal of Hubei Second Normal College, 2009: 76~78.

[2] LIY Yingchun. Principle of Sensor Design and Application [M]. Changsha: National University of Defense Technology Press, 1992.

[3] MA Zhongmei. MCU C Language Application Design [M]. Beijing. Beijing University of Aeronautics and Astronautics Press, 2003:345~356.

[4] HU Junkui, ZHENG Shengwen. HOLTEL48 Series Single-chip Microcomputer Principle and Application Design [M]. Wen Kui information co., LTD.

上一篇:牡蛎:电子书包月订阅服务的先锋 下一篇:TD―SCDMA高速下行分组接入技术应用