The invention discloses an oil separator. The oil separator comprises a box body, a
solid-liquid separation chamber, a water-
oil separation chamber and a
water discharge chamber are arranged in the box body, an oil collection trough and an oil-water separation device are arranged in the oil-water separation chamber, the oil-water separation device comprises an oil adsorbing plate, an oil scrapingplate, a vertical driving
assembly and a horizontal driving
assembly, the lower surface of the oil adsorbing plate is provided with an oil adsorbing
sponge layer, the oil-water separation device further comprises an oil guiding tube, one end of the oil guiding tube is connected with the oil scraping plate, the other end of the oil guiding tube extends to the oil collection trough, and the oil guiding tube receives oil scraped off by the oil scraping plate and guides the oil into the oil collecting trough. The vertical driving
assembly drives the oil adsorbing plate to contact the liquid surface in the oil-water separation chamber, the oil adsorbing
sponge layer adsorbs the oil, the vertical driving assembly drives the oil adsorbing plate to rise, the horizontal driving assembly drives theoil scraping plate to abut against the oil absorbing
sponge layer, and the oil adsorbed by the oil adsorbing sponge layer is scraped by the oil scraping plate, goes through the oil guiding tube, and is collected into the oil collecting trough, so the water doped in the separated oil is reduced, and the trouble of secondary oil-water separation is reduced.