In the 1998 film Armageddon a group of oil rig workers lead by Bruce Willis are tasked with preventing a large asteroid from colliding with the Earth and wiping out civilization. They succeed by drilling into the centre of the asteroid and detonating a nuclear bomb, shattering it and causing it to divert from its collision course.

Ignoring the problem of landing on the asteroid and the lack of any formal NASA training received by the oil rig workers, would the approach of detonating the bomb actually work? Do we have a nuclear device powerful enough, and how far away would it have to be detonated to avoid a collision with the Earth?