School project REALLY need help!!

Thread Starter

kakabunny

Joined Apr 17, 2009
6
Hi, i'm building an electronic quiz for my school project but i'm a little confused as to what to do.

I'm going to be making a quiz where there are questions displayed, and you have 2 levers for true and false. If you answer correct, green lights will flash (i'll be using 555 timers for that) and if you answer wrong red lights will flash. However I don't know how the machine will be able to know which questions are right and whitch ones are false (there are 10 questions that are going to be in order and they are labelled numerically so you have to do them in order). When you answer a question, you just remove it from the machine and go to the next one. How do i get the machine to recognize the answer to the question and display the correct lights? Is this anything related to programming chips or something? I'm confused
. I know someone could memorise the questions but i just need to show that I can make this quiz for a good mark on my coursework


here is a pic of what i'm trying to do and a circuit diagram would be very very helpful, even if it's not detailed.


http://img218.imageshack.us/my.php?image=helpppp.png

thxx again
 

thingmaker3

Joined May 16, 2005
5,083
This could be done with some type of microcontroller, Arduino, PicAxe, or some such. It could also be done with punched holes in the edges of cards upon which the questions have been typed.
 

Thread Starter

kakabunny

Joined Apr 17, 2009
6
This could be done with some type of microcontroller, Arduino, PicAxe, or some such. It could also be done with punched holes in the edges of cards upon which the questions have been typed.

Could you pls explain how i could do it with punched holes :p?

thankss
 

Wendy

Joined Mar 24, 2008
23,421
Shining an LED on one side, and a phototransistor on the other. If it is in the open you can use room lights, and a phottransistor.
 

PRS

Joined Aug 24, 2008
989
There are many ways to accomplish this assignment. But your teacher wants you to do it with digital logic.

To start with you need a truth table: Let 1 = true and 0 = false

question True?
1 1
2 0
3 0
4 1

... and so on. You make the questions true or false. The right hand column is what you program into a 10-bit parallel in to serial out register. To impress your teacher don't use an IC that does this, but build your own from flip flops.

Now pulse the register manually -- a pushbutton. This will shift out the answer to the first question. Let the 1s light up the green light and the 0s light up the red light.

It's probably a bit more complicated. Let us know if you run into a snag. Good luck! :)
 

Thread Starter

kakabunny

Joined Apr 17, 2009
6
There are many ways to accomplish this assignment. But your teacher wants you to do it with digital logic.

To start with you need a truth table: Let 1 = true and 0 = false

question True?
1 1
2 0
3 0
4 1

... and so on. You make the questions true or false. The right hand column is what you program into a 10-bit parallel in to serial out register. To impress your teacher don't use an IC that does this, but build your own from flip flops.

Now pulse the register manually -- a pushbutton. This will shift out the answer to the first question. Let the 1s light up the green light and the 0s light up the red light.

It's probably a bit more complicated. Let us know if you run into a snag. Good luck! :)

hey thanks man, i have no clue about programming:(

have u got any alternative ways? dip switches or something?
 

beenthere

Joined Apr 20, 2004
15,819
For the history of this, look up a history of IBM and the Hollerith card.

If you use index cards, the sensing can be done with optointerrupters and the holes made with a regular hole punch. If you can make the card 80 columns long, you should get 1000 points extra credit.
 

PRS

Joined Aug 24, 2008
989
The output of the shift register can be united with the true/false input from the quiz taker using AND gates.

As I understand it, you're not building the actual machine, but, rather simulating it with a breadboard and some switches. If this is the case get a small piece of plexiglass and mount 4 pushbuttons. Make standoffs with long machine screws and nuts. Let this rig sit beside your breadboard.

One pushbutton is for true, another for false. Include labels.

The third pushbutton is pressed to make the shift register shift. Its output is compared to the quiztaker's response via an small combinational logic circuit whose output is 1 if it corresponds to true or 0 if false.

The fourth button is a reset. It turns off the lights.

Something to think about. Let me know if you have problems.
 

Thread Starter

kakabunny

Joined Apr 17, 2009
6
The output of the shift register can be united with the true/false input from the quiz taker using AND gates.

As I understand it, you're not building the actual machine, but, rather simulating it with a breadboard and some switches. If this is the case get a small piece of plexiglass and mount 4 pushbuttons. Make standoffs with long machine screws and nuts. Let this rig sit beside your breadboard.

One pushbutton is for true, another for false. Include labels.

The third pushbutton is pressed to make the shift register shift. Its output is compared to the quiztaker's response via an small combinational logic circuit whose output is 1 if it corresponds to true or 0 if false.

The fourth button is a reset. It turns off the lights.

Something to think about. Let me know if you have problems.

thanks for all this help man. but yeah i am actually making the machine. I have to have the plan and circuit diagram for monday then i have 4 weks to make it :p. we havent been told about digital electronics yet but the teacher said its something we can research ourselves and use:rolleyes:
 
The problem can be solved using a PIC or 8051 like micro controller. All switches would connect to inputs and LEDs to output pins. Once wired up the problem can then be solved in software. This works and is how these sort of problems are almost always solved these days but it is more fun (and educational) to use logic gates. You say you haven't yet covered logic gates so I'll try to give you a quick tour!

A possible solution to your problem may look like the attached png.

The switches on the left are the answer levers. There are a few bits missing from this diagram. Firstly at the top is where you would connect the 555 based flasher circuit that you have mentioned. At the bottom is the wire where you must connect up the circuit that gives the correct answer to each question. Ill say more on this later.

There are quite a number of different logic gates in this circuit so I'll talk you through what they all do. For the sake of discussion I'll assume you are running this at 5v

The first thing we need to decide is if either of the levers have been pulled. This is the job of logic gate “A” it is an XOR gate. An XOR gate has two inputs. If both inputs are the same then it will give out 0v on its output if the two inputs are different it will give 5v at its output. We are dealing with digital logic so all voltages are either 0v or 5v in this example.

So if the NO button is pressed then pin 1 of the XOR gate will be shorted to ground (0v) pin 2 will be pulled to 5v by the resistor. So point “A” will be at 5v. The same will be true if just the YES button is pressed. If no buttons are pressed then our output will be 0v and importantly is someone cheats by pressing both we get 0v. So if we have a valid answer we have 5v at point “A”

Gate B is an AND gate. It will only give 5v if both of its inputs are at 5v. In all other cases it gives 0v. By wiring your 555 timer into this gate and the answer from point “A” then point “B” will give 0v if no (or both) lever is pressed and will pulse between 5v and 0v (speed set by 555) if an answer has been chosen.

Now lets look at gate “C”. I should say that the card reader should put 5v into this gate it the correct answer is YES. The logic is thus as follows (as this is another XOR gate, remember if the inputs are different it gives 5v).

Correct answer is YES
Contestant chose NO : Output = 0v
Contestant chose YES : Output = 5v

Correct answer is NO
Contestant chose NO : Output = 5v
Contestant chose YES : Output = 0v

Actually this is not quite the whole truth. If a contestant presses more than one button point “C” will be giving the wrong answer. Lets fix that...

So we now have a wire that goes to 5v for a correct answer (providing only one button is pressed) and another that pulses up and down if only one button is pressed but is 0v otherwise.

So at point “F” we bring these together in another AND gate. Remember an AND gate only gives 5v if both inputs are at 5v. In our case this is only true if only one button is pressed AND it was the correct answer. BINGO.....

The triangle gate is an inverter. If we put in 5v it gives out 0v and if we put in 0v it gives out 5v. In this case this is handy as we want an opposite sort of behaviour for our red LEDs. Gate “E” combines our "the answer was wrong" signal (output of the inverter) with the one button is pressed signal.

The resistors and transistors at the end boos the signal to be powerful enough to drive LEDs as logic gates on there own can struggle with this.

As an aside, logic gates generally come in groups (often 4 in one chip) so B E & F will be one chip and A & C another. D is another. But if you get really clever there is a way of using a spare XOR gate as an inverter thus reducing the number of chips you require by using a left over XOR gate instead of an inverter chip. Can you figure it out!


So finally how to read the card! A number of options have been described so far and all seem good to me. But you could keep it really simple by using a micro switch that is pressed down by the edge of the card being inserted. A notch in the card at that point would thus stop the switch being pressed. So any card that should be answered NO would say press the switch and the YES's wouldn't. To hide this from being noticed then you could make all the cards have many notches along their edge at random. Only you would know which one really counted.

The wiring would be the switch shorts the input of "C" to ground and a resistor would pull it up to 5v just like the other switches in the diagram.

Hope this helps, best of luck.
 

Attachments

Top