The invention belongs to the technical field of painting equipment, and in particular relates to an automatic spraying device. The automatic spraying device includes: a storage tank, a mounting plate leg, a mounting plate, an electromagnetic device, a permanent magnet, a handle, a rod A, a rod B, a hinge, and a rod C. Fastening nuts, nozzle covers, nozzles, paint spray tanks, paint spray pipes, controllable valves, control devices and production lines. The paint spraying tube is connected with the controllable valve, the paint spraying tank is fixed on the mounting plate, the nozzle is arranged at the lower end, and the electromagnetic device is fixed on the left side of the mounting plate. On the leg, the permanent magnet is fixed at the end of the handle. The present invention has a simple structure and strong pertinence, and can control the circulation of the paint. At the same time, the self-locking principle of the mechanism is used to realize the sealing or opening of the nozzle, which has wide application prospects. Suitable for promotion and application.