Electronics Quiz 1
Electronics Quiz 1
Introduction
You are designing the electronics that operate a gate into an apartment complex. The gate can be opened either
manually by someone push a button from the inside, or if a car pulls up to the gate an in-ground magnetic
sensor is tripped. There is an electric eye that is tripped when either a car or person passes through the gate. The
gate then closes automatically. The only output from the state machine is an "on" signal to the motor.
Operation
Here is the operation of the gate:
1) The gate starts closed.
2) If either the button is pushed (BTN=1) or the magnetic sensor is tripped (MAG=1), start the motor that opens
the gate.
3) When the gate opens all the way, it trips a sensor (OPN=1) and the motor is stopped.
4) The gate remains open until the electric eye is tripped (EYE=1). When that happens, the motor is started
again.
5) If the button is pushed or the magnetic sensor is tripped, stop the motor, wait one cycle, restart the motor, and
go back to step 3.
6) When the gate is completely closed, it trips a sensor (CLO=1). Go back to step 1.
Assignment
Design a one-hot state machine that performs the function above. The states in your machine might not exactly
conform to steps 1-6 above. You might have more or fewer than six states (dflops) in your machine.
You can assume that the control signals (outputs of the state machine) to the motor are the outputs of the
appropriate state. That is, if the machine is waiting for the gate to completely open or close, assume that the
output of the storage device is the "on" control for the motor.
Be sure to preset (PRE) and clear (CLR) the dflops in your design such that the state starts at step 1.
1. Draw the state diagram on paper. You don't need to turn this in unless you want to.
2. Enter a schematic in LTspice that performs the correct sequence. Include voltage supplies as follows:
V1 CLK 0 PULSE(0 1 10 0.05 0.05 9.9 20)
V2 PRE 0 PULSE(0 1 5 0.05 0.05 9.9 20 1)
V3 MAG 0 PULSE(0 1 285 0.05 0.05 9.9 20 1)
V4 CLR 0 PULSE(0 1 5 0.05 0.05 9.9 20 1)
V5 CLO 0 PULSE(0 1 145 0.05 0.05 9.9 310 2)
V6 OPN 0 PULSE(0 1 105 0.05 0.05 9.9 240 2)
V7 BTN 0 PULSE(0 1 65 0.05 0.05 9.9 160 2)
V8 EYE 0 PULSE(0 1 85 0.05 0.05 9.9 160 3)
NAME: ______________________________________ DATE: _________________________________
You can also download the file QUIZ10.asc from the link in the Schoology Lab 26 page. Open this file in
LTspice and you should see the voltage supplies and .tran statement.
Run a transient simulation for 250 seconds (include .tran 500 in your schematic).
When you are convinced that your design is operating properly, save the schematic as follows:
QUIZ10<your last name>.asc
For example, if my last name is Jones my schematic file name would be QUIZ10Jones.asc
Email your schematic file to me as an attachment or upload it on Schoology.
APPENDIX: Right click on the dflop to bring up the Component Attribute Editor (see below). Enter trise 0.05
for SpiceLine and tfall 0.05 for SpiceLine2, then click on OK. Now
copy that dflop two times (don't add a new one from the library) and
complete the schematic below.