Agricultural machine (11) with at least its own rotation member (40) that rotates during functioning and with a safety device comprises a mechanical sensor (25) disposed in the front part of the agricultural machine (11), and able to be actuated also by a possible obstacle present in its path. The device also comprises a stopping mechanism (37) connected to the mechanical sensor (25) and able to stop the rotation member (40) when the mechanical sensor (25) is actuated by the possible obstacle.