Abstract: A system for controlling a door of a drum type washing machine is provided. This system allows the door to be opened only if there is no water in the washing tub, or if the water level in the tub is very low, so as to prevent water in the tub from cascading out of the washing machine when the door is opened. A water level in the washing tub is sensed, and the sensed water level is compared to a reference water level. The door is locked or unlocked based on the comparison of the sensed water level and the reference water level.