A dung scraping device includes a safety system, a dung scraper (13) and a driving mechanism (17, 18) adapted to drive the dung scraper along a floor surface (11a) for animals such that the dung scraper pushes dung on the floor surface to a cross channel (14) located at an end portion (11d) of the floor surface). The safety system includes height detecting unit (20-22, 29) arranged to detect the presence of foreign objects having at least a predetermined height (x) above the floor surface and an emergency stop device (19, 26) arranged to receive information from the height detecting unit and to deactivate the driving mechanism when such a foreign object having the predetermined height (x) above the floor surface is detected such that the dung scraper is automatically emergency stopped before the foreign object is pushed into the cross channel.