Alexander Graham Bell invented the metal detector in 1881 in a crude attempt to find the bullet lodged in President James Garfield 's body . Alexander Graham Bell used such a device to attempt to locate a bullet lodged in the chest of American President James Garfield in 1881 ; the attempt was unsuccessful because the metal coil spring bed Garfield was lying on confused the detector .