• Travis

Digital Systems: Elevator


For my digital systems fundamentals class, a class I took freshman year, we had to build a circuit to control an elevator using basic ICs such as logic gates, encoders, decoders, comparators, multiplexers, and registers. It's been awhile since I worked on this project, so I don't remember all the details.

The goal of the project was to have buttons that represent floor numbers and when someone pushed a button, the elevator box would go to that floor. We also weren't guaranteed the starting position of the elevator (could be on any floor - even between floors).

This problem isn't as trivial as it sounds because of the chips we were limited to. We needed a way to store the last floor we passed because if it was going from floor four to floor five, the elevator had to have a way of knowing where it was in between floors since the output of the floor labels would be floating. We also had to have a way of storing which floor the user wanted the elevator to go to because the user only presses the button for a short period of time and it takes awhile for the elevator to get to the desired floor.

Also, we had to create a simulation in Logisim so we could verify our design before building it.

Elevator to Control



My Solution:

Finite State Machine

I created a simple finite state machine. It would normally be in state zero where the motors would be disengaged. If a button is pressed and the buttons is higher or lower than the current floor, either COMPUP or COMPDOWN would be true and it would go into the states one or two where it would stay until the elevator reaches the desired floor. Once the elevator reaches the desired floor, COMPUP and COMPDOWN would both be false, so it would go into a break state for one clock pulse and then back to the disengaged state.

Truth Table

This truth table summarizes the logic behind the elevator. P2 and P1 are internal bits that represent each state (ie. (0,0) is S0, (0, 1) is S1, etc).

Boolean Logic For P2 and P1

Using that truth table, I created two equations that summarized the logic behind the bits P2 and P1. In these equations, A is P2, B is P1, C is COMPUP, and D is COMPDOWN.

Logisim Simulation of Elevator Logic

Here's what those equations look like represented as circuit components and logic gates. All of that work just to light up two LEDs that represent UP and DOWN.

I also implemented simple debouncing circuits for the switches because mechanical switches vibrate when pressed and may oscillate between open and closed for a very small time period.

Each button had to have its own capacitor and resistor so that the voltage remains the same across the switch for at least one millisecond.

Time Constant = R * C = 100nF * 10KOhms = 1ms

This means that any oscillations shorter than 1ms cannot change the output voltage enough for it to change its logical representation.

Full Elevator Circuit

The button's signals go to encoders. Ideally, because there's 16 floors, we would encode them into a four-bit number and store it in a register. Unfortunately, we weren't allowed to use 4-bit encoders because all we had were 3-bit encoders, so I used two of those with an AND gate. The register had to hold the values because the user only briefly presses the floor button. If floor four was pressed, it needs to go to floor four (represented by 0101) and not floor zero (represented by 0000) when the button is unpressed or when the clock cycles back up.

Button Encoding Schematic

This schematic above shows how the circuit converts 16 floors into a four bit representation with a priority flag. It goes through the HC148 chips which are 3-bit encoders and then into the HC08 which is a quadruple 2-input AND gate.

Registers to Hold The Floor Values

I also used a register so that the circuit could store the value of the current floor and the target floor so that the elevator wouldn't get lost between floors (ie. the input would be floating between floors).

Circuit for Floor Logic

So far, I've shown the circuits used to encode and store the button and floor data. However, the circuit also needs logic gates to do the actual logic behind the finite state machine. That is what these ICs are for.

Full Elevator Circuit

This is the full circuit! You have no idea how long this took to debug. Luckily enough, I tend to be neat while breadboarding, so debugging was a bit easier.