The invention discloses a camera component with an automatic cleaning function, comprising a sealing box, a
camera module, a cleaning module, a
motor module and a controller, wherein the
camera module, the
motor module and the controller are arranged in the sealing box, a lens observes the outside through a first
small hole, a
sponge ring is arranged on a turntable of the cleaning module, the
sponge ring continuously wipes the surface of the lens when being rotated by the turntable, and through holes with the same size as the first
small hole are formed in the
sponge ring and the turntable inan overlapped mode to prevent the lens from being blocked; and when the
camera module is not in work, the sponge ring covers and protects the lens. According to the scheme of the invention, a removable protective cover, a
liquid storage warehouse, a spray head and an electric
universal joint can also be additionally arranged, the spray head can spray cleaning liquid to clean the lens or the removable protective cover, and the electric
universal joint can increase the observation scope of the camera component. The camera component disclosed by the invention is simple in structure and small in space occupation, can effectively clean the lens and prevent the lens from being contaminated, part of the components can be removed and replaced, the cost can be reduced, and the service life can be prolonged.