Microcontrollers are used in washing machines to digitally control operations like timing profiles, motor speed, water temperature and flow rate. They allow for easier control of the machine compared to analog knobs. The microcontroller monitors input states selected by the user and uses analog inputs to compare temperature and output signals to vary motors and water flow accordingly. It efficiently controls torque and water levels for different load sizes.