In 2285, Lieutenant junior grade Heisenberg was assigned to transporter duty at Old City Station, Earth. On his first day, he was locked in a closet by a phaser wielding Commander Nyota Uhura so he couldn't interfere with her unauthorised transport of Admiral James T. Kirk, Doctor Leonard McCoy and Commander Hikaru Sulu. He was trapped inside for two hours.
In 2286, after a chance encounter with her in a corridor at Starfleet Headquarters, he confessed to Uhura that he thought his kidneys were going to give out, and that he was reprimanded by his commanding officer for allowing Uhura to get the better of him. (TOS novelization: Star Trek III: The Search for Spock, ST - The Lost Era novel: Catalyst of Sorrows)
Some time after his closet incarceration, Heisenberg refined Starfleet's sensors to counter the Romulan cloaking device. He single-handedly continued to improve the detection capability after every upgrade of the device until the Romulans entered isolation following the Tomed Incident in 2311.