The present invention relates to a self-moving device, which moves and works in a working area defined by a limit and comprises a shell, a moving module, a task executing module and a control module; the control module controls the moving module to drive the self-moving device to move and controls the task executing module to execute a work task; the self-moving device comprising at least one capacitance sensor, which is mounted in the shell and electrically connected to the control module and detects whether a surface below the self-moving device or in front of a moving direction is a surface to be machined; the capacitance sensor comprises at least one probe, the probe comprises a probing surface located on the outer surface of the probe, and a conductivity of at least part of the probing surface is larger than or equal to 10−;9 s/m; or a distance between the probe and the surface below the self-moving device meets a first preset condition; or an area of the probing surface meets a second preset condition.