A-Level Major Project 1995
Note: All diagrams other than figure 9 have been lost as they
were mostly hand drawn into the final document.
Centre: Minehead, West Somerset 63233
Candidate Number: 1032 Name: James Bulpin
Electronics
Major Project 1995
The Situation
The West Somerset Community College carries out many class tests
during every school year. Many of these, particularly in the science
department are multiple choice. At present the students fill in their
responses on a printed grid and the teacher goes through each sheet
typing these responses into a computer which is pre-programmed with the
mark scheme. The computer marks the papers and by looking at which type
of question were answered correctly, produces a list of attainment
targets reached by each pupil. Because of increasing numbers of students
and teachers having very little non-contact time, this way of marking is
becoming impractical. What the college wants is some way of getting the
students' answers into the computer with as little teacher time as
possible. In the past a paper reader was tried which used infra-red
emitters and receivers to read where the mark on the page was. There were
many problems with the system, including problems with small printing
errors, students not marking the grid boxes properly and because of the
number of columns of grid boxes, cross-talk between columns cause about a
90% success rate. Clearly a system with these problems can waste more
time than it saves. It was decided to adopt a paper-less approach.
Brief
Design and prototype a paper-less multiple choice entry system.
Specifications
- Each pupil must have his or her own unit to use during the test so
it must be battery powered.
- The cost of each unit must be as low as possible because the
college has a tight budget.
- The maximum number of options on a test paper is currently 14
(letters A to P excluding I and O). There is unlikely to be an increase
in this number so the unit must be able to handle 14 responses for each
question.
- The current response grids have space for up to 50 questions. The
most questions ever likely to be used in a test at the college would be
around the 100 mark therefore the unit must be able to handle up to 100
responses.
- The units will be used frequently so must be robust. This included
any link to the marking computer.
- The pupils must be able to see what they have entered and change it
as many times as necessary.
Developing ideas
The unit has to store 100 lots of 14 possible responses so it will
need some random access memory. It could be done with latches but the
number of devices would be too great for a battery powered, cost
effective item. The unit will need a way of getting responses in to
itself. Two methods could be used, either a small keypad or a thumbwheel
switch. The thumbwheel switch would be easier to implement but would be
more awkward to use and would slow down the students' entry. A keypad is
more user friendly and will be used. There is also a need of a display to
let the student see what responses he or she has entered. This could take
the form of 14 LED's, one for each response and a dual 7-segment display
to show the question number. An alternative to the 14 LED's would be a
starburst alphanumeric display to directly show the chosen response. The
starburst display would be slightly more expensive but would take up less
room that 14 LED's so may well save money on a case. LCD displays could
be used to conserve battery power but these tend to be expensive and a
single starburst type one seems not to exist. When the test is over and
the data has to fed to the computer, a form of link will be required.
Currently a BBC micro is used to do the marking but this may change in
the future so none of the BBC's specialised ports can be used. The BBC
has an RS423 port which is compatible with the industry standard RS232
port. As most computers have one or other of these ports, it would seem
sensible to have a serial link. A potential difficulty with the link is
the continual plugging and unplugging of cables. If 25 classes have 2
tests in a year in 5 subjects, each unit would be plugged and unplugged
250 times in a year and if each class had 30 pupils, the computer end
would be plugged and unplugged 7500 times. Not only would this soon
damage the connections, it would take up more time than was necessary.
The ideal solution would be a wireless link. If the unit was to be fitted
with a pair of infra-red transceivers and a box plugged into the computer
was to have a similar interface, the unit could send all the responses
quickly and get confirmation of a successful transfer in a fraction of a
second.
Having considered all the transducers the control circuit is the next
stage. The circuit is obviously going to be a digital one. There needs be
a part of the circuit to select the question to be responded to or
edited. There needs to be a part responsible for storing and retrieving
responses. There needs to be a part to drive the displays and keyboard.
There needs to be a part to control the serial infra-red link. A block
diagram of the required system is shown in figure 1.
The question selector section could be made quite easily from an eight
bit up/down binary coded decimal counter. A diagram of such a circuit is
shown in figure 2. The output from this could feed the address inputs of
a RAM IC and the data outputs could feed the displays and the serial link
when activated. Pressing a response key would turn the RAM to write mode
to accept data from the keyboard. There would be a circuit to turn the
output from the keyboard into a form acceptable by the RAM and the
display drivers, such as BCD or ASCII. Turning the correct segments on
and off in the starburst display would need a fairly complex circuit
which could use many logic devices. It would be more cost effective and
space saving if a single chip could do this, unfortunately a starburst
driver chip does not seem to be available. The driving of the numeric
question display would be far easier. Two seven segment decoders could
work off the up/down counter's output. The serial port is another
potential complex circuit. A shift register and a latch would be the bare
minimum. A few discrete components would be required to drive the
infra-red devices.
With so many tasks to perform and so many complex circuits it was
decided to use a microprocessor. This does not completely remove the need
for other ICs but it does reduce the number somewhat. For example, the
keypad could connect directly to the microprocessor without a complex
decoder circuit and the starbusrt could be driven via buffers straight
from the outputs of the processor with the decoding done in the software.
It must be pointed out at this stage that this project is not simply a
programming exercise, there is still a lot of hardware associated with
the processor. A programme will have to be developed and this will be
done with the aid of the minor project, an external RAM board, modified
to act as a ROM emulator.
The basis of all microprocessor circuit are the same and a block
diagram showing the essential parts and the extra circuits required for
this project is shown in figure 3. Construction would be much simplified
if a microcontroller device was used. These include RAM, ROM, parallel
ports and some have a serial port. It was decided to use a 8031 device to
prototype the circuit because I have had experience using it. This device
has 4 8-bit ports, some of which double up for other functions. The 8031
has no internal ROM, using internal ROM would mean that developing the
software would be time consuming and expensive. A new device would need
to be bought and got programmed professionally for each modification to
the software. Another microcontroller, the 8051, is identical to the 8031
in all ways except it has some on-board ROM. This would be the chip used
when the units are made in quantity.
The 7 segment drivers chosen were 4511 devices which can each drive a
common cathode 7-segment display. Two of these fit side by side to accept
the 8-bit BCD question number. The starburst display consists of 16
segments. As the processor will do the decoding, it must be connected
with 16 lines. The keyboard needs 14 response keys, and up and a down
key. The sixteen keys could be used on a 4 X 4 matrix to keep the number
of inputs to the processor to a minimum, this means another 8 lines.
These inputs and outputs need all the controller's output ports but this
means that the on-board serial port cannot be used and an external ROM
could not be used so it was decided to have the display drivers as memory
mapped input/output. The keyboard is still connected to the processor
directly but the remaining 24 lines provide a multiplexed data and
address bus and the relevant control and serial port lines.
The 4511 display drivers have latched inputs so they can work directly
off the data bus with some address decoding. The starburst displays will
be driven by current sinking 8-bit latches which will also work off the
data bus. There is a need for an extra latch to demultiplex the data and
address bus from the controller. The address decoding is simplified by
using only the lower 12 address lines for addressing and the upper four
for device selection. One of the upper four lines selects the BCD
decoders, two select the two starburst latches and the other selects the
ROM. The latch/BCD selectors are only selected when a write operation is
being performed and the ROM selected only when accesses to the programme
memory are performed. This means that if a memory location is addressed
which causes two or more of these lines to be low, two devices would be
activated, this could only happen with the latches because of the
programme memory access control line being separate for the ROM. When
accessing the latches, the state of the lower 12 address lines is
irrelevant.
As previously mentioned, the keypad is arranged as a four by four
matrix. The circuit is shown in figure 4. The keys are scanned by the
processor outputting the following binary sequence repeatedly on lines K3
to K0:
1 1 1 0
1 1 0 1
1 0 1 1
0 1 1 1
If for example key S6 is pressed, the line K5 into the processor will
only go low when the third pattern in the sequence is being outputted so
the software can check a look-up table to see which key the combined
output and input patterns refers to. The combined code is different for
each key. The four resistors are there to keep the inputs to the
processor at a high state unless a logic 0 is switched through from the
outputs. The scanning is done very rapidly so the software will have to
do key debouncing itself.
The ROM socket is designed to accept an 8k X 8-bit 27(C)64 device.
This is compatible with the earlier mention ROM emulator.
The full circuit for the prototype is shown in figure 5. The
components for the clock, reset and address latch are taken from the
manufacturer's data sheet for the 8031.
The method of prototyping chosen was stripboard. The other options
were a custom made PCB which would have been expensive and time consuming
to make, breadboarding which is impractical for such a large circuit with
so many connections and wire wrapping. Despite wire wrapping being a
quick convenient way of constructing circuits, from previous experience I
have found that the time spent repairing broken wires accounted for a lot
of the project time. A rough block design of the board layout was drawn
and from this and the circuit diagram, a full layout was designed. The
block layout is shown in figure 6 and the full layout is shown in figure
7. The crosses at the bottom of a column of holes on the stripboard
layout indicate where space has been saved by editing the layout. These
crossed columns are omitted on the final board.
The layout was thoroughly checked and the construction of the board
began. The positions of cuts, links and ICs were constantly checked with
the diagram and relative to each other. Decoupling capacitors that sit in
the IC sockets were used to reduce the amount of soldering. They are
designed to sit under chips directly soldered to a board but do not seem
to work so well under IC sockets but they fit better between the socket
and the chip. Unfortunately, due to a lack of time the construction could
not be completed. The work will be continued after the project deadline
and any subsequent moderation.
The following steps will be taken to complete the project:
- The construction will be finished.
- Every connection will be check to ensure the right pins are
connected together and no adjacent strips are shorting.
- The software will be developed from the flow-chart (see later) and
tried out on the finished system.
- Once a the prototype unit has been produced, the infra-red link
will be developed. This will consist of a buffered IR LED on the serial
out line and an amplified IR transistor on the serial in line on the
microprocessor and on a unit fitted to the computer. A small subroutine
will have to written to add to the computer marking programme to read
the data from the units, similarly a routine will be needed to output
the data from the keypad. This could be initiated from a signal
received from the IR link.
- A smaller cased unit will be constructed using an 8051 device.
- The cased unit will be tested and costed with a possibility of the
production of a class set.
Software
The software must meet these main criteria:
- The keypad needs to be constantly scanned.
- The infra-red receiver needs to be constantly scanned,
- Question up and down key presses need to step through the
responses.
- The current response should be shown on the display, if the
question has not been answered then a blank should be shown.
- Response key presses should update the display and the memory.
- If a valid code is received from the infra-red receiver, the data
should be transmitted and check with returned data.
The main section of this programme will be similar to the flow chart
of figure 8.
The procedure for developing software will be to create or edit an
assembler file on the BBC which will be assembled to a data file which
can then be exported to the external RAM which can act as the ROM in the
circuit. The enable easier programme writing, I have written a BASIC
programme to allow assembler commands for the 8031 to be arranged and
edited and it will assemble them to a file compatible with the software
developed for the minor project. A listing for this BASIC programme is
shown in figure 9.
The remaining details for the project are shown in figures 10 and 11.
Figure 10 shows the keypad layout and figure 11 show the way the
starburst displays will show the letters for the responses.
Evaluation
Because the project is not completed, a full evaluation can not be
done but the design and theory of the unit can be evaluated against the
brief and specifications.
"The unit should be battery powered". The circuit requires five volts
so could work off a set of batteries adding up to 6 volts with a series
diode to reduce the voltage slightly. The LED's draw a lot of current if
on full brightness which could drain the battery quickly, if they were to
have high value series resistors and possibly be pulsed on very rapidly,
a saving in consumption could be made. The microprocessor draws a lot of
current. When the final units are made an 80C51 device would save some
current because of its CMOS nature.
"The unit should be low cost". The cost of each unit excluding the
case would be roughly £15 based on one-off prices. The battery would be
extra to this. Bought in bulk the cost could be reduced.
"14 different responses should be catered for". The software will
allow for this many responses as will the keypad and display.
"Up to 100 questions should be catered for". The BCD method of coding
allows for 100 questions but they would be numbered 0 to 99. As all test
papers start from question 1, 0 can be ignored so the actual number of
questions will be 99.
"The units should be robust". The degree of strength of the units will
depend on the case used and the method of construction in the final
units. The computer link will not suffer from any plugging in problems.
"The student must be able to view and change responses". The software
enables this.
Overall, the system, when completed, will enable the marking of tests
to be speeded up. It may take a while for students to get used to using
the devices but they are simple to use and should cause no major problems
even with real 'technophobes'! The only real problem I can foresee is a
battery running down, losing all the data before it is transferred to the
computer. There may also be a small chance of a software crash but
hopefully this will not happen if care is taken. I am pleased with the
progress of the project, it is unfortunate that time did not allow it to
be completed. I fully intend to see the project through to its
conclusion.
Acknowledgements
Sources of data used in the design of the system:
- Manufacturer's data sheet and data book for 8031.
- Maplin catalogue.
- RS Data Sheets (IC pin-outs).
|