The invention discloses a method and a
system detecting cloth of a
sewing machine. The method includes the steps of: when an
infrared-emitting
diode oppositely projecting to an
infrared photosensitivediode in an
infrared light receiving circuit is started, receiving a first sampling
signal sent by the infrared light receiving circuit; when the infrared-emitting
diode is shut, receiving a second sampling
signal sent by the infrared light receiving circuit; generating first infrared
light energy corresponding to the first sampling
signal and second infrared
light energy corresponding to the second sampling signal, and calculating a difference between the first infrared
light energy and the second infrared light energy; and according to a comparison between the difference and present infrared light energy, determining whether a corresponding position of the infrared photosensitive
diode has the cloth. The method and the
system provided by the invention may effectively remove interferenceof infrared light in an environment on cloth detection, reduce the time for the cloth detection, and are helpful to control a length of a thread chain when the
sewing machine trims a thread; and withthe arrangement of the infrared photosensitive diode, a
light intensity may be sensed more accurately, and thus the accuracy for the cloth detection is improved.