ELEVATOR PROBLEM
WHERE'S THE ELEVATOR?
 

Before we can start the design of the main controller, we have to be able to determine two things: (1) which floor is the elevator car approaching and (2) when is it even with the floor (so we can stop it)? To do this, we shall need some kind of switches in the elevator shaft (or, possible, the car itself). Switches fall into many categories, depending how they are actuated. There are mechanical switches, electrical switches (relays), and switches operated optically, magnetically, etc.
 

In a dank, dirty elevator shaft, magnetically operated REED SWITCHES seem like the best choice as may be determined from the above description (go to link). They are enclosed to keep dirt and moisture out. Nothing stops magnetic forces except ferromagnetic substances which are not likely to be cluttering up the shaft.

We need to know which floor the elevator car is approaching soon enough that we will be able to stop it (if needed) by the time it is even with the floor (slowly enough that the passengers don't file law suits). One way to do this is shown below.
An array of (up to) seven reed switches are placed in the shaft at about mid-floor level as shown above. When a magnet nears the group of switches, they will begin to close. Finally, both the top and the bottom switch will close. If they are both closed, the other switches (if present) must also be closed. Hence, the top and bottom switch are wired in series so that when both are closed, the STB(L) strobe signal will go low indicating a valid floor number. The other five switches are or are not installed depending on the floor number. In the above example, only two additional switches are installed so that floor 01101 (13) is indicated. Note that F4 downto F0 and STB are connected in parallel to all floors (and have pull-up resistors at the controller).

Now, we need to know the floor number before we reach it. To accomplish this, we will mount one electromagnet at the very top of the car and one at the very bottom of the car. When the car is going up, we will activate the magnet at the top of the car so it will trip the switches long before it is even with the floor. When going down, we will activate the bottom electromagnet.
 

The sensor to tell us when we are even with the floor is a single reed switch operated by a permanent manget on the car and positioned so it closes when the car is even with the floor. It is not necessary to show this one.