Hi Tom,
I belive it is old an “Alarm mine” or trip wire device. They are used to deter poachers or to warn of their presence around release pens, rearing woods and commercial fisheries.
It is set by fixing the housing to a post or tree and setting a trip wire across the area to be protected. It is vey simple to use, the mechanism is sprung when the trip wire is snagged and sets of the blank with bang.