Electronics college project

Thread Starter

sdonke002

Joined Oct 12, 2010
18
The project is to design a "seat belt safety circuit" that will comply with the following specs:
The car can only be started if:
1)The driver is seated (switch 1).
2)the drivers side door is closed(switch 2)
3)Key is in the ignition(switch 3)
4)The seat belt is buckled(switch 4)
5) The ignition key is turned on to start the engine(switch 5)

If the proper sequence of switches is not completed and switch 5 is activated, the car should not start. In this case, one should be able to return all switches to their inactive state, reset the circuit and start a new sequence.

I know that in order to do this I must use flip flops with the correct inputs, but I am not sure how to go about designing this.I might be wrong, but I believe I will need 5 flip flops in order to complete the project(one for each switch.) I must design it on multisim as well as physically build it. Any help or thoughts are appreciated!!
 

Georacer

Joined Nov 25, 2009
5,182
Aaaah! Your friendly neighbourhood Finite State Machine...
You actually need only 3 Flip Flops, but with 5 inputs that could be tricky. 5 Flip Flops is still a viable option.

Read here: http://en.wikipedia.org/wiki/Finite-state_machine ,
and here: http://www.cs.princeton.edu/courses/archive/spr06/cos116/FSM_Tutorial.pdf
M. Mano's "Digital Design" is a good read too.

Come back with your questions. I suggest you dowload this free software, http://qfsm.sourceforge.net/download.html and use it to post the diagram of your solution.
 
Last edited:

hobbyist

Joined Aug 10, 2008
892
Assuming you understand logic gating, and data storage (flip flops),

Think it through, draw a diagram, as you read the sequence of events,
read your first line of data, "driver is seated," what kind of device would you put in that area to detect that event.

Now picture the ocupant sitting in the seat, what does the next line of datra say, "door must be shut", so what device would you use to detect that event,

Now given the discipline, that each event must happen in a sequential manner, then you now have 2 devices that are in active mode, what type of electronic circuit would be needed, to first detect that 2 inputs have been placed in motion, and now to take that 2 input signal and demultiplex it and transfer that as a new signal to another set of logic circuits keeping the sequential order all the way through.

Then once this is all drawn up, you then need to put a data storage device in areas where 2 inputs must be simultaneously active to have further transfer of the signal, the storage device must be in the input with highest priority, so when 2 inputs are present, the one first in the sequence must have a data storage device, while the other can be a transient device...


Hope this helps in some way.

Harder to explain than it is to actually logically think it through.

Drawing a diagram taking each event in step makes it easier to understand.
 

Markd77

Joined Sep 7, 2009
2,806
Have you been told that the order matters? In real life I imagine some people buckle up, then put the key in the ignition, or put the key in and then shut the door.
 

Thread Starter

sdonke002

Joined Oct 12, 2010
18
I looked over the stuff you sent me and I I attatched what I have so far as a pdf. Please give me any feedback that you can. Yes, sequence does matter. It must go from first on the list to last. I do know about logic gates and flip flops which is all I should need to do this project. Thank you!
 

Attachments

Georacer

Joined Nov 25, 2009
5,182
You mention 5 switches, yet you depict only 4.
Also, you haven't taken into concideration the order of at least J1 and J2.
Furthermore, keep in mind that the JK FF switches on on both 10 and 11 for the JK pair.

I designed the circuit because I found it challenging. Do you want to try once more to design it before I post a solution?
 

Thread Starter

sdonke002

Joined Oct 12, 2010
18
Ok So I tried to go through and do as much as I can think of right now. I know that there are a few different ways in order to get a high output out of a jk(adding inverters,etc.) By producing a high to J and a low to K the output will be a high, which is why I added the 3 inverters. I also added a switch to the clear in order to reset the cycle when there is a wrong sequence. The probe is simulating the engine being started. Feel free to post the circuit you built so I can see what I am and am not doing correct. Thank you
 

Attachments

Georacer

Joined Nov 25, 2009
5,182
Let us examine the effectiveness of your circuit:
J1 closes - U3A goes HIGH, U2A goes HIGH, U1A goes HIGH and the lamp is lit.

So, you started the car just by sitting behind the wheel... Did you even test your circuit mentally?

Here is my view of your circuit. It incorporates automatic RESET, but it doesn't have a failsafe in case of a switch is depressed while the motor is on. Make your mods at will.

Buckle Up.png
 

Attachments

Thread Starter

sdonke002

Joined Oct 12, 2010
18
Thank you for showing me what you had. I am in my second year in an associates EET program so this is a little tough for me. I see how you got your circuit to work, but what purpose do the resistors serve in this circuit? You also said that the circuit could be made with less flip flops? I am really trying to grasp the whole concept so I can go through and design it myself.Also, we are not allowed to use a 3 state quad bus buffer. Could I remove this and stick in a normal inverter? Thanks
 

Georacer

Joined Nov 25, 2009
5,182
*Important Note: The FF's I used reset on HIGH. If your FF model resets on LOW you will need to make appropriate modifications.

I said that it can be done with 3 FFs but it would require solving an 8 variable carnot map, for which I don't look forward to make the truth table.

The resistors are "pull-up resistors". If you open a switch, its contact doesn't go to low, just because you disconnected it from the power. You need to actively drive the pin to ground. The resistor connects the pin with a "week" ground, with enough current to be detected by the input of the FF. When the switch is closed, the resistor prevents a short-circuit between Power and Ground.

If you could just use a NOT, I wouldn't have used a 3-state buffer, would I? Your alternative is use a 2-to-1 Multiplexer. You will use input 0 as the input of the buffer and Ground (or raise to Power, depending on the Reset condition) the other pin. The select pin will be used as the activation pin of the buffer.
 

Thread Starter

sdonke002

Joined Oct 12, 2010
18
Thank you for helping me understand better. Like I said before I am going for electrical engineering technology, so a lot of our time spent in class is doing labs and learning about new components. We rarely take the time to put things together and build these types of things so I am not that good at it. We have never used or gone over the buffer before, which is why I asked about it. Thank you for everything!
 

hobbyist

Joined Aug 10, 2008
892
*Important Note: The FF's I used reset on HIGH. If your FF model resets on LOW you will need to make appropriate modifications.

I said that it can be done with 3 FFs but it would require solving an 8 variable carnot map, for which I don't look forward to make the truth table.

The resistors are "pull-up resistors". If you open a switch, its contact doesn't go to low, just because you disconnected it from the power. You need to actively drive the pin to ground. The resistor connects the pin with a "week" ground, with enough current to be detected by the input of the FF. When the switch is closed, the resistor prevents a short-circuit between Power and Ground.

If you could just use a NOT, I wouldn't have used a 3-state buffer, would I? Your alternative is use a 2-to-1 Multiplexer. You will use input 0 as the input of the buffer and Ground (or raise to Power, depending on the Reset condition) the other pin. The select pin will be used as the activation pin of the buffer.
First excellent job, on your design.

Question, about your statement using the 3 FF.

I drew up a quick diagram, using 3 "RS" flip flops and 3 "AND" gates,
where the Door closed, ignition key, and seatbelt, are seperate manual switches.

And the driver seated, switch is on the input to the first "RS" ff.

From there each output of the "AND" gates was fed to the input of another ff, whose output fed one input of the next "AND" gate where one of the manual switches fed the other input to this same "AND" gate,
and so on right down the line until you reached the last action, which is turning the key in the ignition.

Wouldn't this work also, without having to draw up a karnaugh map?

Just wondering...

The more I look at it it can be done with one "RS" ff, and three "AND" gates.
I think it can be done with all "AND" gates, and no flip flops at all.
Unless using Flip Flops are a requirement...

Sorry for interupting you guys in the middele of this thread.

Thanks.
 
Last edited:

Georacer

Joined Nov 25, 2009
5,182
I had forgotten about RS FFs, as I don't come across them often.

However, your suggestion doesn't solve any of our problems:

  • It doesn't manage all 5 switches with 3 FFs
  • It doesn't need a correct order of input for activation
  • It doesn't freeze or reset the circuit upon false order of input
If you think I 'm wrong, please post a schematic, in case I misunderstood what you are saying.
 

hobbyist

Joined Aug 10, 2008
892
Hi, I am not saying your wrong,
just wondering if this would work too.

If FF's are not required then it can be done with gating only.

electronics colledge proj..jpg
 

Thread Starter

sdonke002

Joined Oct 12, 2010
18
Flip flops are required. I have the choice of using either D or JK flip flops, inverters, and gates. I cannot use 3 bus buffers or multiplexers though which is why I was asking about replacing them in the circuit.
 

Thread Starter

sdonke002

Joined Oct 12, 2010
18
No need to be sorry. I appreciate all the help I can get as I am still trying to figure it out as to where I can do it myself by getting help from others.
 

Thread Starter

sdonke002

Joined Oct 12, 2010
18
Ok so I tried to do it myself using D Flip Flops this time. I don't have a problem getting it to get a high output, but I still dont understand what to do in order to make things need to occur in a sequence.
 

Attachments

hobbyist

Joined Aug 10, 2008
892
When you simulate this circuit, does it work in sequence, or does the output come on out of sequence, of switch inputs.

If it is working properly, are you asking how to understand the logic in making it work in sequence?

Because it looks like the circuit is wired properly.
 

hobbyist

Joined Aug 10, 2008
892
Because each gate needs to have both inputs present, befor an output from the gate occurs, so every key after the first gate is useless untill the first gate is activated, and then that gate can only be activated when both of it's inputs are present at the same time, and so on down the line.
 
Top