Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 958 https://internationalpubls.com Optimizing Washing Machine Efficiency with a Fuzzy Logic Control System using Python 1Dr. A. Arokiamary, 2Dr. K. Raja, 3Dr. L. Jethruth Emelda Mary, Assistant professor of Mathematics, 1Assistant professor of Mathematics, St. Joseph's College of Arts and Science (Autonomous), Cuddalore arokia68@gmail.com 2Associate Professor, Department of Mathematics, i Manakula Vinayagar Engineering College, Puducherry, India. raja.rajth@gmail.com 3St. Joseph's College of Arts and science (Autonomous), Cuddalore. jethruth15@gmail.com Article History: Received: 12-01-2025 Revised: 15-02-2025 Accepted: 01-03-2025 Abstract: Washing clothes is an essential part of our daily routines. Traditionally, clothes were cleaned by hand, but with technological advancements, machines have taken over these manual tasks, making life more convenient. Among these innovations is the washing machine, designed to save water, energy, and time. To enhance efficiency, a Fuzzy Logic Control System was developed to optimize washing processes based on user needs.Fuzzy logic, a type of reasoning that handles approximate information rather than binary true or false values, is widely utilized today, especially in Artificial Intelligence to mimic human-like decision-making in automated systems. Applications of fuzzy logic span various domains such as air conditioners, unmanned aerial vehicles, satellites, traffic control systems, transmission systems, and anti-lock braking systems (ABS).In the context of washing machines, Python provides a streamlined approach to implementing fuzzy logic, addressing some of the limitations encountered with MATLAB. In this Python-based system, inputs like fabric type, dirt level, and load size determine outputs such as wash time, spin speed (RPM), drying time, and water temperature. The goal is to minimize the time, power consumption, and water usage while ensuring optimal wash quality. Simulation results demonstrate that this approach significantly enhances wash efficiency and performance. Keywords: Python; Fuzzy logic system; Artificial Intelligence; Rule Viewer; MATLAB. I. INTRODUCTION Python was first designed in 1980 and it was a high-level interpreted programming language. Python was released in the year 1991 by Guido Van Rossum at Centrum Wiskunde and Informatica (CWI) in Netherland. For his continuous efforts in the development and central role in deciding the correct direction, he was given the title, “Benevolent Dictator for Life” (BDFL) by the Python community. mailto:raja.rajth@gmail.com Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 959 https://internationalpubls.com Python is an easy and powerful programming language. It is helpful for the beginners. It can perform complex mathematics and handle large data and files. It increases the reduction of memory usage and time complexity. Python was first implemented using C language hence it was called C Python initially. The main advantage of Python is that, it does not use many symbols such as semi colon and curly braces in looping statements. Python uses indentation to indicate a block of code and hence it is easy to read and understand. Python has the major features relating to Object-Oriented Programming concepts. Python 2.0 was first released on 16th October, 2000 with innovative features and developments like Garbage collector for cycle detecting for memory management and also supports Unicode. Python 3.0 was released on 3rd December, 2008 after conducting several tests. But many of its feature have been back ported. Python 2.7 was reported by the Python community for Sunset date that is End of Life (EOL) date, but was postponed to 2020 because of many people concern that it cannot be easily forward-ported to Python 3 within the stipulated time periods. Python finds its application over several domain such as Artificial Intelligence, Machine Learning, Deep Learning, Web Development, installers, security systems, etc. In this paper, we use Fuzzy Logic Controller for liquid level maintaining and control. Previous approaches for Fuzzy Logic Control was designed in MATLAB. But here we have programmed Fuzzy Logic Control using Python for easy, precise and compact structure of program. II. FUZZY LOGIC SYSTEM Fuzzy logic control is a concept which helps the computers to make decision like human. It works on the basis of conditional statement. Most of the people do not know how much time is required for washing clothes in order to overcome these issues, Fuzzy logic controller (FLC) based washing machines are designed in such a way it offers better performance and low cost. The Fuzzy logic controller for liquid level monitoring in washing machine was designed using the Fuzzy logic concept in Python. Washing machine developed based on Fuzzy logic rules will be helpful in washing procedures by sensing the amount of dirt, type of dirt etc. The Fuzzy logic system used in washing time will not only reduces the energy consumption (including electricity and water) but also helps the users to save finances in commercial boundary. The application of Fuzzy logic controllers has more dynamic range when compared to the conventional PID controller. The conditions inside the machine are monitored by sensors. The fuzzy logic also has a feature of ‘one touch control’. The fuzzy logic also checks the amount of dirt and grease direction of the spinning, the detergent and water to be added and so on. The reloading takes place to correct the direction of spin. Neuro fuzzy logic system has inbuilt optical sensors which detect the type of fabric used by the user. The washing machines incorporate optical sensors to find light permeability of water in washer tank, a device that converts light rays to electrical signal. The optical sensors detect change in light beams. A point at which there is no change of color in the water is known as saturation point. There is no Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 960 https://internationalpubls.com logic or formula to determine the relationship between volumes of clothes and dirt and also the time needed to wash. The structure of washing machine controller has not let itself to ancient methods as the input and output are not clear. The principle of sensor is that the light is transmitted through a water sample and the amount of light passed through it is proportional to the amount of soil. The increase in soil levels leads to decrease in amount of light transmitted is measured by the turbidity sensor to find out the turbidity. The decisions on how long to wash in all cycles are given to the dishwasher controller based on turbidity measurements. These decisions are carried out on the basis of the comparison of clean water and wash water turbidity. Using this strategy to make decisions, we can conserve energy on lightly soiled loads by washing as long as necessary. III. PROPOSED DESIGN The main work of washing machine is to clean the dirty clothes and other fabrics without any damage. For that, we give a particular input according to the properties of the cloth to produce output such as heavy wash or soft wash, time of washing and so on. In relation to that, 27 principles for washing time and 27 principles for water temperature are proposed and used to design this Fuzzy Logic Control System using Python. To achieve these advantages in an economical way, this washing machine uses fuzzy logic system with some of these three major input parameters: 1. Weight of Fabrics 2. Stains category 3. Type of Fabric Fig 1. Fuzzy logic Inputs and Outputs System The FLC processes the input information and produces five outputs which are: 1. Wash Duration 2. Temperature 3. RPM 4. Dry Time 5. Wash quality Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 961 https://internationalpubls.com A. Algorithm for our Fuzzy logic system: BEGIN < FUZZY LOGIC > (FAB_TYPE, DIRT_TYPE, WEIGHT) IF FAB_TYPE=SILK AND DIRT_TYPE= LIGHTLY_SOILED AND WEIGHT = BELOW_10KG THEN PRINT WASH STASTICS ELSE IF FAB_TYPE = SILK AND DIRT_TYPE=LIGHTLY_SOILED AND WEIGHT=10_TO_15KG THEN PRINT WASH STATISTICS ELSE IF FAB_TYPE = SILK AND DIRT_TYPE=LIGHTLY_SOILED AND WEIGHT=ABOVE_15 KG THEN PRINT WASH STATISTICS ELSE IF FAB_TYPE = SILK AND DIRT_TYPE=NORMALLY_SOILED AND WEIGHT=BELOW_10KG THEN PRINT WASH STATISTICS ELSE IF FAB_TYPE = SILK AND DIRT_TYPE=NORMALLY_SOILED AND WEIGHT=10_TO_ 15 KG THEN PRINT WASH STATISTICS ----------------------------------------------------------------------------------------------------- ---- ------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------- ELSE IF FAB_TYPE = COTTON AND DIRT_TYPE=NORMALLY_SOILED AND WEIGHT=10_TO_15KG THEN PRINT WASH STATISTICS ELSE IF FAB_TYPE = COTTON AND DIRT_TYPE=NORMALLY_SOILED AND WEIGHT=ABOVE_15KG THEN PRINT WASH STATISTICS ELSE IF FAB_TYPE = COTTON AND DIRT_TYPE=HEAVILY_SOILED AND WEIGHT=BELOW_10KG THEN PRINT WASH STATISTICS ELSE IF FAB_TYPE = COTTON AND DIRT_TYPE=HEAVILY_SOILED AND WEIGHT=10_TO_15KG THEN PRINT WASH STATISTICS Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 962 https://internationalpubls.com ELSE IF FAB_TYPE = COTTON AND DIRT_TYPE=HEAVILY_SOILED AND WEIGHT=ABOVE_ 15KG THEN PRINT WASH STATISTICS B. Python code for our Fuzzy logic system: Fuzzy rules have been involved in the modeling of washing machines. The whole system which we have made is developed by using Python. The code for our FLC system is as follows: list1=[] def result(): #Silk print("------") print("OUTPUT") print("------") Rule 1: if((list1[0]=="silk")and(list1[1]=="lightly soiled")and(list1[2]=="below_10kg")):#1 print("Wash Duration - 0.35 h") print("Temperature - 30c") print("RPM - 400") print("Dry Time - Quick") print("Quality - Good") input("Press Enter key to exit...") Rule 2: elif((list1[0]=="silk")and(list1[1]=="lightly soiled")and(list1[2]=="10_to_15kg")):#2 print("Wash Duration - 0.47 h") print("Temperature - 30c") print("RPM - 600") print("Dry Time - Intermediate") print("Quality - Good") input("Press Enter key to exit...") Rule 3: elif((list1[0]=="silk")and(list1[1]=="lightly soiled")and(list1[2]=="above_15kg")):#3 print("Wash Duration - 0.50 h") print("Temperature - 40c") print("RPM - 600") print("Dry Time - Intermediate") Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 963 https://internationalpubls.com print("Quality - Best") input("Press Enter key to exit...") -------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------- Rule 25: elif((list1[0]=="cottan")and(list1[1]=="heavily soiled")and(list1[2]=="below_10kg")):#25 print("Wash Duration - Long") print("Temperature - 60c") print("RPM - 1000") print("Dry Time - Intermediate") print("Quality - Good") input("Press Enter key to exit...") Rule 26: elif((list1[0]=="cottan")and(list1[1]=="heavily soiled")and(list1[2]=="10_to_15kg")):#26 print("Wash Duration - 1.18") print("Temperature - 60c") print("RPM - 1200") print("Dry Time - Long") print("Quality - Best") input("Press Enter key to exit...") Rule 27: elif((list1[0]=="cottan")and(list1[1]=="heavily soiled")and(list1[2]=="above_15kg")):#27 print("Wash Duration - 2.10 h") print("Temperature - 60c") print("RPM - 1200") print("Dry Time - Long") print("Quality - Good") input("Press Enter key to exit...") def fun(): list1.append(str(input("Enter the Fabric_type:").lower())) list1.append(str(input("Enter the Stain_category:").lower())) list1.append(str(input("Enter the Fabric_Weight:").lower())) Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 964 https://internationalpubls.com print(list1) if(((list1[0]=="cottan")or(list1[0]=="silk")or(list1[0]=="woolen"))and ((list1[1]=="lightly soiled")or(list1[1]=="normally soiled")or(list1[1]=="heavily soiled"))and ((list1[2]=="below_10kg")or(list1[2]=="10_to_15kg")or(list1[2]=="above_15kg"))): settings=str(input("Do you want to Change the Settings (YES OR NO):").lower()) if(settings=="yes"): list1.clear() fun() elif(settings=="no"): result() else: print("Given input is wrong try again") list1.clear() fun() fun() C. Resultant values of our washing machine’s FLC python code: The decision of the fuzzy logic controller is made using previously stored data in the database. The principles which we use in this paper is derived from the logical thinking, data taken from daily usage, and experimentation of the system in a controlled environment. The set of principles used here to derive the output are based on the Fuzzy logic system using python code are given below: Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 965 https://internationalpubls.com -------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------- Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 966 https://internationalpubls.com The above input and output can be represented in a table for an easy understanding of how it works: TABLE I R. N o Linguistic Inputs Linguistic Outputs Type of Cloth es Degree of Dirtiness Mass of Cloth Load Wash Time Tempera ture RPM Dry Time Wash Quality 1 Silk lightly soiled Below_1 0kg 0.35 h 30 c 400 Quick Good 2 Silk lightly soiled 10_to_15 kg 0.47 h 30 c 600 Intermediate Good 3 Silk lightly soiled Above_1 5kg 0.50 h 40 c 600 Intermediate Best 4 Silk normally Below_1 0.50 h 30 c 400 Long Medium Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 967 https://internationalpubls.com soiled 0kg 5 Silk normally soiled 10_to_15 kg 1.18 h 30 c 800 Quick Good 6 Silk normally soiled Above_1 5kg 1.18 h 40 c 600 Long Medium 7 Silk heavily soiled Below_1 0kg 0.50 h 30 c 800 Intermediate Good 8 Silk heavily soiled 10_to_15 kg 1.18 h 40 c 800 Quick Best 9 Silk heavily soiled Above_1 5kg 2.10 h 40 c 800 Quick Best 1 0 Wooll en lightly soiled Below_1 0kg 0.47 h 40 c 600 Long Medium 1 1 Wooll en lightly soiled 10_to_15 kg 0.50 h 40 c 800 Intermediate Good 1 2 Wooll en lightly soiled Above_1 5kg 1.18 h 40 c 800 Quick Good 1 3 Wooll en normally soiled Below_1 0kg 0.50 h 40 c 600 Intermediate Medium 1 4 Wooll en normally soiled 10_to_15 kg 1.18 h 40 c 600 Intermediate Medium 1 5 Wooll en normally soiled Above_1 5kg 1.18 h 60 c 800 Quick Best 1 6 Wooll en heavily soiled Below_1 0kg 1.18 h 60 c 800 Quick Best 1 7 Wooll en heavily soiled 10_to_15 kg 1.18 h 60 c 1000 Quick Good 1 8 Wooll en heavily soiled Above_1 5kg 2.10 h 60 c 1200 Quick Good 1 9 Cotto n lightly soiled Below_1 0kg 0.47 h 40 c 400 Intermediate Good 2 Cotto lightly 10_to_15 0.50 h 40 c 600 Intermediate Good Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 968 https://internationalpubls.com 0 n soiled kg 2 1 Cotto n lightly soiled Above_1 5kg 1.18h 40 c 800 Quick Best 2 2 Cotto n normally soiled Below_1 0kg 0.50 h 40 c 600 Intermediate Best 2 3 Cotto n normally soiled 10_to_15 kg 1.18h 40 c 800 Quick Best 2 4 Cotto n normally soiled Above_1 5kg 2.10 h 40 c 1000 Quick Good 2 5 Cotto n heavily soiled Below_1 0kg 1.18h 60 c 1000 Quick Good 2 6 Cotto n heavily soiled 10_to_15 kg 1.18h 60 c 1200 Quick Best 2 7 Cotto n heavily soiled Above_1 5kg 2.10 h 60 c 1200 Quick Good Here in this table, three types of clothes are taken into consideration. They are silk, woollen and cotton. They have the weight of 10 to 15 kg from lightly soiled to heavily soiled. Using these three parameters, the output such as the temperature ranging from 30 to 60 degree Celsius, RPM ranging from 400 to 1200, washing time differing from quick to long and washing quality ranging from medium to best. These outputs produced from inputs are calculated on the basis of fuzzy logic controller system which is programmed on python for use of a greater number of criteria and also to reduce the power consumption. Thus, the best fit of output is produced by the FLC system for the given input and to reduce the water consumption and power consumption. IV. RESULTANT AND SIMULATION Consider any type of material or cloth to be used for washing. The mass of the cloth and the degree of dirtiness comes into consideration. When these things are given as an input to the system, that is the washing machine, the fuzzy logic system working in it measures how much temperature it should be maintained while washing, what is the RPM which it has to run, the time of washing and the quality of wash using sensors are calculated and produced as the output. These can be visualized using graph simulation as given below: Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 969 https://internationalpubls.com Fig 2. Degree of dirtiness vs Types of clothes based on Washing time Fig 3. Mass of cloth load vs Types of clothes based on Washing time Fig 4. RPM vs types of clothes based on degree of dirtiness Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 970 https://internationalpubls.com Fig 5. Mass of cloth load vs Degree of dirtiness based on RPM Fig 6. Mass of cloth load vs Degree of dirtiness based on Dry time Fig 7. Count of Wash quality vs types of clothes based on degree of dirtiness Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 971 https://internationalpubls.com Fig 8. Wash quality vs Degree of dirtiness based on Mass of cloth load V. CONCLUSION By using Fuzzy Logic, we have designed an automatic washing machine controller to assess the quality of wash based on parameters namely dry/rinse time and drum rotation speed / RPM. The wash quality index is a performance measure to accurately determine the working efficiency of a washing machine at given load. The use of Fuzzy Logic Controller using Python automatically detects the necessary RPM for given input load and accordingly presumes the average rinse time of the load, thereby calculating the wash quality index. This system manages the time, saves water consumption and electricity consumption. This automatic control systems depicts the advantages of Fuzzy Logic Controller over traditional washing machine. Thus, Fuzzy logic control systems in Python provides great advantages and provides more solutions for problems that cannot be solved by MATLAB environment by reducing the disadvantages such as time management, processing speed and restricted number of input values and etc. So, Python would be the best solution to solve these problems. REFERENCES [1]. L.A. Zadeh, Fuzzy Sets, Information and Control, 338–353, (1965). [2]. Van Rossum Guido. A Brief Timeline of Python. The History of Python. Google, 2009. Retrieved 20 January 2009. [3] Guttag John V. (2016-08-12). Introduction to Computation and Programming Using Python: With Application to Understanding Data. MIT Press. ISBN 978-0-262-52962 [4] Workman, M. Hardware requirement for Fuzzy Logic Control Systems.Lubbock,TX: Texas Tech University, (1996) [5]. Daily Ned. Python 3.6.4 is now available. Python Insider. The Python Core Developers, 2017. Retrieved 27 December 2017. [6]. More Control Flow Tools. Python 3 documentation Python Software Foundation. 2015. [7]. George J. Kilr and Bo Yuan, Fuzzy Sets and Fuzzy Logic (India: PHI, 1995) Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 7s (2025) 972 https://internationalpubls.com [8]. Zhen. A. and Feng R. G., “The design of neural network Fuzzy controller in washing Machine,” in Proc. 2012 International Conference on Computing, Measurement,Control And Sensor Network (CMCSN), Shanxi,China, 136-139, 2012. [9]. Peterson Benjamin. Python 2.7.14 released. Python Insider. The Python Core Developers, 2017. Retrieved 17 September 2017. [10].Python legal statements. Python Software Foundation 2012. Retrieved January 28 Kuhlman Dave. A Python Book: Beginning Python, Advanced Python, and Python Exercises, 2012. On 23 June. [11] Raja, K., and Dr. S. Ramathilagam., (2021), Automation on washing machine using fuzzy logic controller provided with three inputs and two outputs for setting the temperature of water, Proceedings of the IEEE, ISBN: 978-1-6654-1570-5 Page 1753-1759 (2021). ISSN NO: 0018- 9219. [12].Raja, K., and Dr. S. Ramathilagam., (2019), Paddy growth analysis and disease Prediction using fuzzy logic controller system, Turkish journal of computer and mathematics education, Vol. 10(02) 573-595 (2019). ISSN NO: 1309-4653. [13]. Raja, K., and Dr. S. Ramathilagam., (2021), Smart air conditioning system using fuzzy logic system and simulation using Matlab, Malaya journal of Matematik, Issue 1, 331-333 (2021). ISSN NO: 2321 – 5666. [14].Raja, K., and Dr. S. Ramathilagam., (2021), Washing machine using fuzzy logic controller to provide wash quality, Soft computing, Vol. 24 issue 15, 9957-9965 (2021). ISSN NO: 1433-7479. [15].Raja, K., (2023), Python-based fuzzy logic in Automatic Washer control system, Soft computing, Vol. 27,6159-6185 (2023). ISSN NO: 1433-7479.