The Keys of Marinus
The travellers alnd on an island on the planet Marinus, where the sand is glass and the sea is acid. The TARDIS is captured by Arbitan, Keeper of the Conscience of Marinus, a machine that controls the island absolutely fairly. But four of the five keys that make it function is lost.
The Doctor and his companions go to serach for them. On their return with the keys they find Arbitan dead, murdered by Yartek, leader of the Voords, who now control the island. Ian is forced to hand over the four hard won keys, but one is a fake – which causes the machine to explode, blowing itself and the Voord to pieces and freeing the inhabitants of Marinus from its domination.
The Keys of Marinus was the fifth episode of season 1