Elevator (motor + distance sensor)

I don't think the usual ping sensor will give you that kind of accuracy, never mind that there may be additional issues with reflections off parts of the elevator shaft itself. Other similar implementations have used a magnet at each floor and a hall sensor on the elevator to detect when it is at a particular floor. To simplify the coding, you may prefer to put them the other way round - hall sensors at each floor and a magnet on the elevator.