An automatic cleaning device includes an accelerometer, a sprayer, a driving module and a processing unit. The accelerometer is mounted to a door, measures acceleration of the door, and outputs an acceleration value accordingly. The sprayer is for storing cleaner, and is operable to spray the cleaner. The processing unit is electrically connected to the driving module and the accelerometer, and determines whether the acceleration value is greater than an acceleration threshold, and generates a driving signal and transmits the same to the driving module for enabling the driving module to drive the sprayer to spray the cleaner when determining that the acceleration value is greater than the acceleration threshold.