Automatic replacement device for filter cotton of fish tank based on image recognition of arduino

By using Arduino-based image recognition technology and an automatic replacement device, the accuracy and adaptability issues of existing aquarium filter cotton replacement devices have been solved. This enables accurate assessment and remote monitoring of the filter cotton's contamination level, improving the efficiency of aquarium water quality maintenance and enhancing the user experience.

CN119453137BActive Publication Date: 2026-06-26JIYANG COLLEGE OF ZHEJIANG A & F UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIYANG COLLEGE OF ZHEJIANG A & F UNIV
Filing Date
2024-12-23
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing aquarium filter replacement devices cannot accurately determine the degree of filter clogging, resulting in untimely or premature filter replacement, which affects the water quality maintenance effect. Furthermore, they lack adaptability and cannot fully assess the degree of filter clogging, leading to resource waste or water blockage.

Method used

Using Arduino-based image recognition technology, images of the filter cotton are captured by a high-definition camera. Image recognition algorithms are used to analyze the color, texture, and distribution density of impurities. Combined with OpenCV and LBP algorithms, the degree of filter cotton contamination is identified, and automatic replacement is achieved through servo motors and a winding frame.

Benefits of technology

It enables accurate assessment of the degree of filter cotton contamination, avoiding resource waste and water quality deterioration. It is suitable for aquariums of different sizes, provides remote monitoring and convenient aquarium management, and improves the accuracy of filter cotton replacement and the practicality of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119453137B_ABST
    Figure CN119453137B_ABST
Patent Text Reader

Abstract

The application discloses an Arduino-based image recognition fish tank filter cotton automatic replacement device, and relates to the technical field of fish tank filter cotton replacement.The device comprises a filter frame, a fixing mechanism, a replacement mechanism and a detection and feedback mechanism.The fixing mechanism is used for unwinding the filter cotton and compacting the filter cotton during unwinding.The replacement mechanism is installed on the filter frame and is opposite to the fixing mechanism.The detection and feedback mechanism comprises a filter cotton replacement system and is arranged above the filter cotton flat surface and used for detecting the filter cotton flat surface and performing control.The application uses the image recognition technology to analyze the color distribution, texture characteristics, particle size and distribution density of impurities on the filter cotton, can more accurately evaluate the pollution degree of the filter cotton, can more accurately determine the replacement time, can avoid resource waste and water quality deterioration, and can maintain the water quality of the fish tank.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of aquarium filter cotton replacement technology, and in particular to an Arduino-based image recognition automatic aquarium filter cotton replacement device. Background Technology

[0002] When replacing aquarium filter cotton, it is usually done manually by checking and replacing it at regular intervals. However, this method has problems such as inability to accurately determine the need for filter cotton replacement in a timely manner, high labor costs, and cumbersome operation. In order to solve the problems of manual operation, our staff has developed an automatic aquarium filter cotton replacement device based on a water level sensor. It is usually composed of a filter box, a water level sensor, a motor, a transmission mechanism, and filter cotton. The filter box is equipped with a filter cloth filter to intercept impurities in the water. When the filter cotton is clogged, the water level rises, triggering the water level sensor. The water level sensor transmits a signal to the motor control circuit, and the motor drives the filter cotton to replace it through the transmission mechanism.

[0003] However, devices based on water level sensors rely solely on rising water levels to determine filter clogging. This is susceptible to interference from fish activity, water flow fluctuations, and unexpected water additions, leading to misjudgments and potentially causing premature or delayed filter replacement. Consequently, the accuracy of these devices is limited, and the determination of filter clogging is not precise enough, resulting in filter replacement before it reaches the level of true contamination, leading to resource waste. Furthermore, existing replacement devices lack adaptability. The correlation between water level changes and filter clogging levels is not constant for aquariums of different sizes, stocking densities, and filtration system configurations, making it difficult for these devices to flexibly adapt to these variations. In some cases, it may be impossible to replace the filter cotton in a timely and effective manner, affecting the water quality maintenance effect. Moreover, it can only decide whether to replace the filter cotton based on the single indicator of water level change, and cannot comprehensively assess the actual pollution status of the filter cotton. For example, it cannot analyze and judge other important factors reflecting the degree of pollution, such as the type of impurities on the filter cotton, the uniformity of distribution, and color changes. This affects the accurate control of the filter cotton replacement time. Replacing the filter cotton too early will result in waste of filter cotton, while replacing it too late will affect the filtration of water in the aquarium, easily causing blockage of the filter water in the aquarium and even seriously affecting the growth of fish in the aquarium. Summary of the Invention

[0004] The purpose of this invention is to provide an Arduino-based image recognition automatic aquarium filter cotton replacement device to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: an Arduino-based image recognition automatic aquarium filter cotton replacement device, comprising:

[0006] Filter frame;

[0007] A fixing mechanism is installed at one end of the filter frame and is used for unwinding the filter cotton and pressing the filter cotton during unwinding.

[0008] A replacement mechanism is installed on the filter frame and is opposite to the fixing mechanism. The replacement mechanism is used to replace and rewind the flat surface of the filter cotton.

[0009] A detection and feedback mechanism is installed in the middle of the filter frame, and the detection and feedback mechanism includes a filter cotton replacement system. The detection and feedback mechanism is located directly above the filter cotton flat surface and is used for the detection and operation of the filter cotton flat surface.

[0010] Preferably, the filter frame includes:

[0011] A filter frame, which is installed inside the aquarium.

[0012] Guide roller assembly, the guide roller assembly being installed at the end of the inner cavity of the filter frame;

[0013] The discharge port is located on the side wall of the filter frame near the replacement mechanism.

[0014] Preferably, the fixing mechanism includes:

[0015] A double-pole frame, wherein the double-pole frame is disposed at one end of the filter frame;

[0016] A positioning component is disposed at the end of the double-rod frame, and the positioning component is used for movable insertion between the end of the double-rod frame and the filter frame;

[0017] The pull rods are respectively disposed at one end of the positioning component, and the opposite ends of the two pull rods are both bent with internal toothed grooves.

[0018] A clamping assembly is disposed at one end opposite to the two pull rods. The clamping assembly is used to clamp the filter cotton wound on the double rod frame, and the clamping assembly is used for the opposite movement of the two pull rods.

[0019] Preferably, the positioning component includes:

[0020] The clamping post is slidably inserted into the outer wall of the filter frame and slidably inserted into the end of the double rod frame;

[0021] A tension spring, which is sleeved on the outer wall of the locking post;

[0022] A pull block is fixed to one end of a locking post, and a tension spring is fixed between the pull block and the outer wall of the filter frame. The pull block is fixedly connected to one end of a pull rod, and the pull rod is slidably inserted into the outer wall of the filter frame.

[0023] Preferably, the clamping assembly includes:

[0024] A rotating column, the bottom of which is rotatably connected to one end of a filter frame via a bearing;

[0025] A gear, which is fixed to the top of a rotating column, and a pull rod that meshes with the outer wall of the gear;

[0026] A rotating block, which is fixed to the top of the gear;

[0027] A protrusion is provided on the top of the rotating block;

[0028] A pressure block, which is slidably inserted into the inner cavity of the protrusion;

[0029] A compression spring, one end of which is fixed to one end of the inner wall of the pressure block, and the other end of which is fixed to the bottom of the inner wall of the protrusion. The pressure block is supported by the elastic force of the compression spring to press against the filter cotton on the double rod frame.

[0030] Preferably, the replacement mechanism includes:

[0031] A servo motor, which is fixed to the outer wall of the filter frame;

[0032] A winding frame, which rotates within the inner cavity of the filter frame, is fixedly connected to the output rotating end of the servo motor.

[0033] Preferably, the detection and feedback mechanism further includes:

[0034] A support frame is attached to the middle of the filter frame by a locking device, and the filter cotton replacement system is installed on the support frame.

[0035] Preferably, the filter cotton replacement system includes:

[0036] An Arduino microcontroller is mounted in the middle of the support frame;

[0037] A camera is mounted on the bottom of an Arduino microcontroller, and the Arduino microcontroller is used to receive the camera's image data and execute corresponding commands;

[0038] A communication module is connected to an Arduino microcontroller and is also connected to remote monitoring and control software. The communication module is used for remote monitoring and control functions.

[0039] An actuator, comprising a servo motor, an automatic feeder, and a water quality monitor, wherein the actuator is connected to an Arduino microcontroller;

[0040] The power module is connected to the Arduino microcontroller, camera, communication module and actuator via connecting wires. The power module is used to provide power to the filter cotton replacement system.

[0041] Preferably, the replacement method of the filter cotton replacement system includes:

[0042] Capture images by periodically collecting image information of the filter cotton using a camera;

[0043] Image preprocessing converts the acquired RGB image to a grayscale image. A threshold T is set; for grayscale images, pixels with values ​​less than T are considered black impurities. The threshold segmentation is performed using the following formula:

[0044]

[0045] in, The image is in coordinates The grayscale value at that location;

[0046] Image feature extraction and impurity identification utilizes OpenCV's color conversion and color detection functions to detect black impurities on the filter cotton. The LBP algorithm and the gray-level co-occurrence matrix algorithm are used together to identify texture variations on the filter cotton. The calculation formula for the LBP algorithm is as follows:

[0047]

[0048] in, It is the grayscale value of the center pixel. It is the grayscale value of the p-th neighborhood pixel. It is a symbolic function;

[0049] The Canny edge detection algorithm and morphological operations are used to detect particle edges, and the dirt distribution density is calculated by statistically analyzing the number and area of ​​particles. The formula for calculating particle area is:

[0050]

[0051] in This represents the segmented particle region. These are the pixel coordinates within the region, where the dirt distribution density = total particle area / total image area;

[0052] Decision-making: Based on the identification results, determine whether the filter cotton needs to be replaced;

[0053] When the replacement is performed, the Arduino microcontroller identifies and judges the filter cotton through software and sends a control signal to the actuator through the communication module to perform the filter cotton replacement operation.

[0054] Preferably, the replacement method of the filter cotton replacement system further includes:

[0055] Remote monitoring allows you to view real-time image information of the filter cotton through a connection between a camera and a software application.

[0056] The filter cotton can be replaced manually by controlling the switch button on the installed actuator.

[0057] The technical effects and advantages of this invention are as follows:

[0058] (1) The present invention uses a combination of filter frame, replacement mechanism and detection and feedback mechanism to set up an image recognition filter cotton replacement system based on Arduino. It acquires images of filter cotton through a high-definition camera and uses image recognition technology to analyze the color distribution, texture features, particle size and distribution density of impurities on the filter cotton. It can more accurately assess the degree of pollution of the filter cotton, thereby more accurately determining the replacement time, avoiding resource waste and water quality deterioration. It is suitable for use in fish tanks of different sizes, effectively replaces filter cotton and maintains the water quality of fish tanks.

[0059] (2) By connecting the detection and feedback mechanism with the replacement mechanism, the present invention uploads the status information of the filter cotton to the remote monitoring mobile phone via the network, enabling users to remotely monitor the status of the aquarium filter cotton, realize intelligent management of the aquarium, and provide users with a more convenient and efficient fishkeeping experience.

[0060] (3) The present invention facilitates the easy installation and removal of the filter cotton on one end of the filter frame by means of a fixed mechanism and a filter frame, and can press the unrolled filter cotton to prevent the filter cotton from being pulled to a loose state when the replacement mechanism is driven, so that the filter cotton can be stably laid flat in the inner cavity of the filter frame to filter impurities in the aquarium, thereby improving the practical performance of the device. Attached Figure Description

[0061] Figure 1 This is a schematic diagram of the overall structure of the device of the present invention. Figure 1 .

[0062] Figure 2 This is a schematic diagram of the overall structure of the device of the present invention. Figure 2 .

[0063] Figure 3 This is a schematic diagram of the internal front cross-sectional structure of the filter frame of the device of the present invention.

[0064] Figure 4 This is a schematic diagram of the side structure of the card post of the present invention.

[0065] Figure 5 This is a schematic diagram of the front structure of the gear in this invention.

[0066] Figure 6 This is a schematic diagram of the system replacement in this invention.

[0067] Figure 7 This is a flowchart of the filter cotton replacement steps of the present invention.

[0068] In the diagram: 1. Filter frame; 11. Water filter frame; 12. Guide roller assembly; 13. Feed port; 2. Fixing mechanism; 21. Double rod frame; 22. Positioning component; 221. Locking post; 222. Tension spring; 223. Pull block; 23. Pull rod; 24. Pressing component; 241. Rotating column; 242. Gear; 243. Rotating block; 244. Protrusion; 245. Pressing block; 246. Compression spring; 3. Changing mechanism; 31. Servo motor; 32. Rewinding frame; 4. Detection and feedback mechanism; 41. Support frame; 42. Arduino microcontroller; 43. Camera. Detailed Implementation

[0069] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0070] Example 1

[0071] This invention provides, for example Figure 1-5 The image recognition-based aquarium filter cotton automatic replacement device based on Arduino shown includes: a filter frame 1, a fixing mechanism 2, a replacement mechanism 3, and a detection and feedback mechanism 4. The filter frame 1 includes: a water filter frame 11, a guide roller group 12, and a discharge port 13. The water filter frame 11 is installed in the inner cavity of the aquarium. The bottom of the water filter frame 11 has multiple water passage holes connected to the water in the aquarium in a matrix, so that the filtered water can flow steadily from the water filter frame 11 into the aquarium. The guide roller group 12 is installed at the inner end of the water filter frame 11. Two guide roller groups 12 are respectively installed at both ends of the water filter frame 11. The guide roller group 12 is composed of two guide rubber rollers, and the two ends of the guide rubber rollers are respectively rotatably inserted and connected to the inner wall of the water filter frame 11. The discharge port 13 is opened on the side wall of the water filter frame 11 near the replacement mechanism 3. The setting of the discharge port 13 makes it easy to pull and remove the filter cotton wound on the replacement mechanism 3.

[0072] The fixing mechanism 2 is installed at one end of the filter frame 1 and is used for unwinding and pressing the filter cotton during unwinding. The fixing mechanism 2 includes a double rod frame 21, a positioning component 22, a pull rod 23, and a pressing component 24. The double rod frame 21 is set at one end of the filter frame 11, and the positioning component 22 is set at the end of the double rod frame 21. The positioning component 22 is used for the movable insertion between the end of the double rod frame 21 and the filter frame 11. The positioning component 22 makes it easy to assemble and disassemble the double rod frame 21, and it is convenient to install the double rod frame 21 with the filter cotton wound on it at one end of the filter frame 11. The pull rods 23 are respectively set at one end of the positioning component 22, and the opposite ends of the two pull rods 23 are both bent with internal toothed groove structures. The pressing component 24 is set at the opposite ends of the two pull rods 23. The pressing component 24 is used to press the filter cotton wound on the double rod frame 21, and the pressing component 24 is used for the opposite movement of the two pull rods 23.

[0073] Specifically, the positioning component 22 includes: a locking post 221, a tension spring 222, and a pull block 223. The locking post 221 is slidably inserted into the outer wall of the filter frame 11, and is also slidably inserted into the end of the double rod frame 21. Simultaneously, the double rod frame 21 can rotate between the two locking posts 221, facilitating the unwinding of the filter cotton on the double rod frame 21. Under the pull of the filter cotton by the replacement mechanism 3, the filter cotton can be laid flat and moved between the two sets of guide rollers 12, facilitating the removal of dirt from the filter. The filter cotton is wound up on the replacement mechanism 3. The tension spring 222 is sleeved on the outer wall of the locking post 221. The pull block 223 is fixed to one end of the locking post 221. The tension spring 222 is fixed between the pull block 223 and the outer wall of the filter frame 11. The pull block 223 is fixedly connected to one end of the pull rod 23. The pull rod 23 is slidably inserted into the outer wall of the filter frame 11. Through the elasticity of the tension spring 222, the locking post 221 will not move arbitrarily, and the position of the double rod frame 21 inserted between the two locking posts 221 is stable.

[0074] Specifically, the clamping assembly 24 includes: a rotating column 241, a gear 242, a rotating block 243, a protrusion 244, a pressure block 245, and a compression spring 246. The bottom of the rotating column 241 is rotatably connected to one end of the filter frame 11 via a bearing. The gear 242 is fixed to the top of the rotating column 241. The pull rod 23 is meshed with the outer wall of the gear 242. The bent parts at opposite ends of the two pull rods 23 are respectively meshed with the outer wall of the gear 242, so that when one of the pull rods 23 or the pull block 223 is pulled, the other pull rod 23 and the pull block 223 at the other end of the double rod frame 21 move in opposite directions, which facilitates the simultaneous disengagement of the two locking columns 221 from both ends of the double rod frame 21, and facilitates the quick assembly and disassembly of the double rod frame 21. The rotating block 243 is fixed to the top of the gear 242, and the protrusion 244 is located on the top of the rotating block 243. When the pull rod 23 is pulled, the gear 242 rotates, causing the protrusion 244 to move. 4. Rotate the frame away from the double-bar bracket 21 to ensure that the pressure block 245 does not affect the installation of the double-bar bracket 21. Release the pull on the pull rod 23, align the end of the double-bar bracket 21 with the position of the locking post 221. Under the elastic pull of the tension spring 222, the locking post 221 slides and interlocks with the end of the double-bar bracket 21, stabilizing the double-bar bracket 21 at one end of the filter frame 11. The pressure block 245 slides and interlocks with the inner cavity of the protrusion 244. The compression spring 24... One end of the 6 is fixed to one end of the inner wall of the pressure block 245, and the other end of the pressure spring 246 is fixed to the bottom of the inner wall of the protrusion 244. The pressure block 245 is used to press the filter cotton on the double rod frame 21 by the elastic support of the pressure spring 246. By the elasticity of the pressure spring 246, the pressure block 245 is tightly attached to the filter cotton wound on the outer wall of the double rod frame 21, reducing the loosening of the filter cotton due to pulling and improving the stability of the filter cotton wound on the double rod frame 21.

[0075] Furthermore, the replacement mechanism 3 is installed on the filter frame 1 and is in a state opposite to the fixing mechanism 2. The replacement mechanism 3 is used for replacing and winding the filter cotton laid flat. The replacement mechanism 3 includes: a servo motor 31 and a winding frame 32. The servo motor 31 is fixed to the outer wall of the filter frame 11, and the winding frame 32 rotates in the inner cavity of the filter frame 11. The winding frame 32 is fixedly connected to the output rotating end of the servo motor 31. Driven by the servo motor 31, the winding frame 32 can easily wind up the dirty filter cotton. The position of the winding frame 32 corresponds to the discharge port 13, which makes it easy to pull the filter cotton replaced on the winding frame 32 out of the discharge port 13, making it convenient to remove the filter cotton on the winding frame 32.

[0076] Example 2

[0077] This invention provides, for example Figure 1-7The image recognition-based aquarium filter cotton automatic replacement device shown includes: a filter frame 1, a fixing mechanism 2, a replacement mechanism 3, and a detection and feedback mechanism 4. The filter frame 1 and the fixing mechanism 2 are installed at one end of the filter frame 1 and are used for unwinding and pressing the filter cotton during unwinding. The replacement mechanism 3 is installed on the filter frame 1 and is opposite to the fixing mechanism 2. The replacement mechanism 3 includes: a servo motor 31 and a winding frame 32. The replacement mechanism 3 is used for replacing and winding the filter cotton flat surface. The detection and feedback mechanism 4 is installed in the middle of the filter frame 1 and includes a filter cotton replacement system. The detection and feedback mechanism 4 is located directly above the filter cotton flat surface and is used for detecting and controlling the filter cotton flat surface.

[0078] The detection and feedback mechanism 4 also includes a support frame 41, which is fastened to the middle of the filter frame 1 by a locking device, and the filter cotton replacement system is installed on the support frame 41.

[0079] Specifically, the filter replacement system includes: an Arduino microcontroller 42, a camera 43, a communication module, an actuator, and a power module. The Arduino microcontroller 42 is mounted in the middle of the support frame 41. The Arduino microcontroller 42 can be either an Arduino Uno or an Arduino Mega model. The camera 43 is mounted at the bottom of the Arduino microcontroller 42. The camera 43 is compatible with the Arduino microcontroller 42 and connects to the Arduino microcontroller 42 via a serial port or I2C interface for transmitting image data. The Arduino microcontroller 42 receives the image data from the camera 43 and executes corresponding commands. The communication module connects to the Arduino microcontroller 42 via a serial port and is connected to remote monitoring and control software. The communication module is an ESP8266. The WIFI module enables WIFI connectivity and has sufficient processing power. The communication module is used for remote monitoring and control functions. The actuators include a servo motor 31, an automatic feeder, and a water quality monitor. The actuators are connected to the Arduino microcontroller 42. The power module is connected to the Arduino microcontroller 42, camera 43, communication module, and actuators via connecting cables. The power module provides power to the filter cotton replacement system. The power module uses 5V DC power to ensure stable system operation.

[0080] The replacement methods for the filter cotton replacement system include:

[0081] Capture images; use camera 43 to periodically collect image information of the filter cotton.

[0082] Image preprocessing involved writing and uploading code to the Arduino 42 microcontroller board using the Arduino IDE. The acquired RGB images were converted to grayscale using the OpenCV library, and then filtered for noise reduction. A threshold was set to identify regions of black impurities. A threshold T was defined; for grayscale images, pixels with values ​​less than T were considered black impurities. The following formula was used for threshold segmentation:

[0083]

[0084] in, The image is in coordinates The grayscale value at that location;

[0085] Image feature extraction and impurity identification, such as the color, texture, and shape of impurities, are performed using color conversion and color detection functions in OpenCV to detect black impurities on the filter cotton. The LBP algorithm and the Gray-Level Co-occurrence Matrix algorithm are used together to identify texture variations on the filter cotton. The calculation formula for the LBP algorithm is as follows:

[0086]

[0087] in, It is the grayscale value of the center pixel. It is the grayscale value of the p-th neighborhood pixel. It is a sign function. For each pixel, it compares its gray value with the gray values ​​of its surrounding neighboring pixels to generate a binary code. The binary code is converted into a decimal number as the LBP value of that pixel. The distribution of LBP values ​​of all pixels in the image is statistically analyzed to form a texture feature histogram. Based on the analysis results of the texture features of dirt, the location and range of fish feces and fermentation products on the filter cotton are output. It can be used to identify texture changes on the filter cotton, including impurities such as fish feces and fermentation products, to determine whether the filter cotton needs to be replaced.

[0088] The Canny edge detection algorithm and morphological operations are used to detect particle edges, and the dirt distribution density is calculated by counting the number and area of ​​particles. First, image segmentation techniques are used to separate dirt particles from the background; then, morphological operations such as dilation, erosion, opening, and closing operations are used to accurately extract particle boundaries; finally, parameters such as particle area and perimeter are calculated to estimate particle size. The formula for calculating particle area is:

[0089]

[0090] in This represents the segmented particle region. These are the pixel coordinates within the region. By counting the number of pixels within the region, we can obtain the area of ​​the particles. Dirt distribution density = total particle area / total image area.

[0091] The system makes a decision based on the identification results to determine whether the filter cotton needs to be replaced. If the identification results show that there are too many impurities or the preset replacement conditions are met, the system will enter the replacement process.

[0092] To perform the filter replacement, the Arduino microcontroller 42 identifies and judges the filter through software, then sends control signals to the actuator via the communication module to perform the filter replacement operation. The system also sends a successful replacement status feedback to a remote server or mobile device via the communication module. For aquariums of different sizes, stocking densities, and filtration system configurations, the relationship between water level changes and the degree of filter cotton contamination is not fixed. The filter replacement system based on the Arduino microcontroller 42 can determine the replacement timing based on the actual contamination status, adapting more flexibly to various aquarium environments and effectively maintaining water quality. The system records information such as the replacement time and filter cotton usage for subsequent analysis and maintenance. It also performs autonomous learning and optimization based on preset rules, such as automatically adjusting the replacement cycle and judgment threshold according to the contamination patterns of filter cotton under different seasons and stocking conditions, further improving the device's intelligence level.

[0093] The filter replacement system also includes remote monitoring and manual control methods. This is achieved through a connection between camera 43 and a software application. The software application is a monitoring tool that allows real-time viewing of the filter's image information. The remote monitoring and control steps involve: setting up a web server based on Node.js, Python Flask, or PHP; writing an API interface to receive data sent by the Arduino and store it in a database; and providing a web interface to display real-time images, recognition results, and status information of the filter. On the client side: a web front-end page based on HTML5, CSS, and JavaScript is developed to implement real-time data display, alarm prompts, and remote control functions. Users can access the client page through a mobile browser or PC browser. Communication between the client and server is implemented using HTTP or WebSocket protocols to ensure communication security and stability, and SSL / TLS encryption can be used. When a user triggers a remote control operation on the client page, a control command is sent to the server. The server forwards the control command to the Arduino microcontroller 42, which executes the corresponding control operation, driving its servo motor 31 or automatic feeder to perform filter cotton replacement or feeding operations. The Arduino feeds back the operation results to the server, which then updates the status information on the client page. In non-remote mode, the actuator can be manually controlled via its on / off switch to perform filter cotton replacement, enabling intelligent management of the aquarium and providing users with a more convenient and efficient fishkeeping experience.

[0094] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An Arduino-based image recognition automatic fish tank filter cotton replacement device, characterized in that, include: Filter box (1); Fixing mechanism (2), the fixing mechanism (2) is installed at one end of the filter frame (1), and the fixing mechanism (2) is used for unwinding the filter cotton and pressing the filter cotton when unwinding; Replacement mechanism (3), which is installed on filter frame (1) and is opposite to fixing mechanism (2), is used for replacing and rewinding the filter cotton flat surface; The detection and feedback mechanism (4) is installed in the middle of the filter frame (1) and includes a filter cotton replacement system. The detection and feedback mechanism (4) is located directly above the filter cotton flat surface and is used for the detection and operation of the filter cotton flat surface. The fixing mechanism (2) includes: A double-pole frame (21) is provided at one end of the filter frame (11); Positioning component (22), which is disposed at the end of the double rod frame (21), is used for movable insertion between the end of the double rod frame (21) and the filter frame (11); Pull rods (23) are respectively disposed at one end of the positioning component (22), and the opposite ends of the two pull rods (23) are both bent with internal tooth groove structure; A pressing assembly (24) is provided at one end opposite to the two pull rods (23). The pressing assembly (24) is used to press the filter cotton wound on the double rod frame (21) and to allow the two pull rods (23) to move in opposite directions. The clamping assembly (24) includes: Rotating column (241), the bottom of which is rotatably connected to one end of filter frame (11) via bearing; Gear (242), the gear (242) is fixed to the top of the rotating column (241), and the pull rod (23) is meshed with the outer wall of the gear (242); A rotating block (243) is fixed to the top of the gear (242); A protrusion (244) is provided on the top of the rotating block (243); The pressure block (245) is slidably inserted into the inner cavity of the protrusion (244); A compression spring (246) is fixed at one end to one end of the inner wall of the pressure block (245), and the other end of the compression spring (246) is fixed to the bottom of the inner wall of the protrusion (244). The pressure block (245) is used to press the filter cotton on the double rod frame (21) by the elastic support of the compression spring (246).

2. The image recognition-based aquarium filter cotton automatic replacement device based on Arduino according to claim 1, characterized in that, The filter frame (1) includes: A filter frame (11) is installed inside the aquarium. Guide roller assembly (12), the guide roller assembly (12) is installed at the end of the inner cavity of the filter frame (11); The discharge port (13) is located on the side wall of the filter frame (11) near the replacement mechanism (3).

3. The image recognition-based aquarium filter cotton automatic replacement device based on Arduino according to claim 2, characterized in that, The positioning component (22) includes: The clamping post (221) is slidably inserted into the outer wall of the filter frame (11), and the clamping post (221) is slidably inserted into the end of the double rod frame (21); A tension spring (222) is sleeved on the outer wall of the locking post (221); Pull block (223), the pull block (223) is fixed to one end of the locking post (221), the tension spring (222) is fixed between the pull block (223) and the outer wall of the filter frame (11), the pull block (223) is fixedly connected to one end of the pull rod (23), and the pull rod (23) is slidably inserted into the outer wall of the filter frame (11).

4. The image recognition-based aquarium filter cotton automatic replacement device based on Arduino according to claim 3, characterized in that, The replacement mechanism (3) includes: Servo motor (31), said servo motor (31) is fixed to the outer wall of the filter frame (11); The winding frame (32) rotates within the inner cavity of the filter frame (11) and is fixedly connected to the output rotation end of the servo motor (31).

5. The image recognition-based aquarium filter cotton automatic replacement device based on Arduino according to claim 4, characterized in that, The detection and feedback mechanism (4) also includes: The support frame (41) is fastened to the middle of the filter frame (1) by a locking member, and the filter cotton replacement system is installed on the support frame (41).

6. The image recognition-based aquarium filter cotton automatic replacement device based on Arduino according to claim 5, characterized in that, The filter cotton replacement system includes: An Arduino microcontroller (42) is mounted in the middle of a support frame (41); A camera (43) is mounted on the bottom of an Arduino microcontroller (42), and the Arduino microcontroller (42) is used to receive the camera data from the camera (43) and execute corresponding commands; A communication module is connected to an Arduino microcontroller (42) and is connected to remote monitoring and control software. The communication module is used for remote monitoring and control functions. The actuator includes a servo motor (31), an automatic feeder, and a water quality monitor, and is connected to an Arduino microcontroller (42); The power module is connected to the Arduino microcontroller (42), camera (43), communication module and actuator via connecting wires. The power module is used to provide power to the filter cotton replacement system.

7. The image recognition-based aquarium filter cotton automatic replacement device based on Arduino according to claim 6, characterized in that, The replacement method for the filter cotton replacement system includes: Capture images by periodically collecting image information of the filter cotton using a camera (43); Image preprocessing converts the acquired RGB image to a grayscale image. A threshold T is set; for grayscale images, pixels with values ​​less than T are considered black impurities. The threshold segmentation is performed using the following formula: in, The image is in coordinates The grayscale value at that location; Image feature extraction and impurity identification utilizes OpenCV's color conversion and color detection functions to detect black impurities on the filter cotton. The LBP algorithm and the gray-level co-occurrence matrix algorithm are used together to identify texture variations on the filter cotton. The calculation formula for the LBP algorithm is as follows: in, It is the grayscale value of the center pixel. It is the grayscale value of the p-th neighborhood pixel. It is a symbolic function; The Canny edge detection algorithm and morphological operations are used to detect particle edges, and the dirt distribution density is calculated by statistically analyzing the number and area of ​​particles. The formula for calculating particle area is: in This represents the segmented particle region. These are the pixel coordinates within the region, where the dirt distribution density = total particle area / total image area; Decision-making: Based on the identification results, determine whether the filter cotton needs to be replaced; When the replacement is performed, the Arduino microcontroller (42) identifies and judges the filter cotton through software, and then sends a control signal to the actuator through the communication module to perform the filter cotton replacement operation.

8. The image recognition-based aquarium filter cotton automatic replacement device based on Arduino according to claim 7, characterized in that, The replacement method for the filter cotton replacement system also includes: Remote monitoring allows for real-time viewing of image information of the filter cotton via a connection between a camera (43) and a software application; The filter cotton can be replaced manually by controlling the switch button on the installed actuator.