Need help on traffic light project!

Discussion in 'Homework Help' started by koshi, Sep 25, 2014.

  1. koshi

    Thread Starter New Member

    Sep 25, 2014
    21
    0
    Hi,

    I just started learning logic gates and I have a project on a traffic light system. I don't know how to start since this project is tasked to us even without learning much into the lectures. Hence, I need some assistance on how to start this project. I am trying to use 74191 up/down sync counter in this project as well.

    Below is the project guideline on what I am suppose to come out with. Good tips and diagrams will be appreciated.

    A traffic light controller produces five output signals. Three output signals named Veh_Red,
    Veh_Amber, Veh_Green control the flow of vehicles while the other two signals named Man_Red,
    Man_Green control the flow of pedestrians. Veh_Red and Man_Green are always asserted at the
    same time. Similarly, it applied on Veh_Green and Man_Red. Each traffic light indicator will last for
    seven seconds in the following steps:
    1) 7 seconds for Veh_Red and Man_Green
    2) 7 seconds for Veh_Green and Man_Red
    3) 7 seconds for Veh_Amber
    The process is repeated. A push button is used for pedestrians to cross the road. Three seconds after
    pressing the push button, the traffic light controller will trigger to the step (3), 7 seconds for
    Veh_Amber. So the pedestrians can cross the road after ten seconds pressing the button. A seven
    segment display is used to show the remaining time for pedestrians to cross the road. It only works
    in Step (1). It is noted that push button should not work during Step (1) and the 3-second waiting
    time.
    D1 Project Guideline:
    D1A: Implement the push button and a three second counter
    D1B: Implement the main controller part
    D1C: Implement the seven segment display
     
  2. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello koshi

    I guess you're just starting with this assignment and you have nothing done.

    But what you have in mind, do you know how to develop a counter with 74191 ?.
    Have you a simulator for electronic circuits where you develop your projects ?.

    I guess this system for traffic lights will be located at an intersection.
    The circulation of vehicles, on a street, it would be:
    North <---> South.
    And on the other will be:
    East <---> West.
    And will have lights for pedestrians. As you describe in your original message.

    I could help you develop this system for traffic lights but I need to know how much you know about it.

    You have developed similar projects or is this the first ?.
     
    absf likes this.
  3. koshi

    Thread Starter New Member

    Sep 25, 2014
    21
    0
    Hi,

    MrCarlos! Thanks for your input. With regards to your questions, this is actually my first. The 74191 chip was given to me during the project handout so I suppose this will be the easier way out I assume?

    What I know is that I need to make a MOD 7 and MOD 3 counter to represent the 7s flashing and 3s for the push button.

    But in terms of putting together a logical circuit that fulfill all the questions asked in the project, I am kinda confuse. Perhaps, you can guide me through with any form of schematic?

    Any input is very much appreciated.
     
  4. absf

    Senior Member

    Dec 29, 2010
    1,493
    372
    How many 74191 are you given?
    Are you given a 555 chip?
    Where are you supposed to get your basic "one-second" clock for your counter?

    Make a block diagram first showing your idea how to tackle this project.

    Allen
     
  5. koshi

    Thread Starter New Member

    Sep 25, 2014
    21
    0
    I am using a 7805 regulator to provide a 5V supply for my circuit and yes, I do have a 555 timer connected up. I am given 1 74191 chip, but to be honest, I am not really restricted to the 74191 chip. It's just somehow given. But I can always use other logic gates if I know how to implement them.

    Sorry, I don't understand what you mean by one-sec clock?

    I don't have a diagram at the moment but idea is as follow:

    5V->555 timer->Mod7/Mod3 counter to represent the flashing with push button. Of course, I need to know how to make the LEDs to flash at the various stage and that is the part where I am confuse. Also from pressing the button to switch the green light to amber. Can someone help me on this part?
     
  6. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello koshi

    one-sec clock means: An oscillator that generates a clock pulse every one second.

    (From now on I will attach type files PDF and/or ZIP only.
    The image file type, they are distorted, if you expand -Zoom-.
    Only when absolutely necessary, I will attach image files type).

    Take a look the one I attached.

    To the names you gave them I added two acronyms, eg
    Yours: Veh_Red, Veh_Amber, Veh_Green
    I added:
    Mine: WE or EW. NS, SN. According to the flow direction.

    Is there something missing in this preliminary outline?
    O excess. of course.

    I asked you a question in my previous post:
    You've got a simulator for electronic circuits, where you develop your projects ?

    You can get started designing your pulse generator with IC 555.
    Also counters: MOD 7 and MOD 3.

    Do not expect my reply, surprise me making them and upload a picture or PDF in your next message here.
     
  7. koshi

    Thread Starter New Member

    Sep 25, 2014
    21
    0
    Hi sir,

    I don't have a simulator at the moment.

    My tutor didn't really introduce any software to us.

    What would be a good free simulator to use?
     
  8. absf

    Senior Member

    Dec 29, 2010
    1,493
    372
    "Proteus" and "multisim" are not free. Most members here use "LTSPICE IV" and it is free.

    Mr Carlos and myself are using proteus ISIS.

    Allen
     
  9. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello koshi

    If you do not have any simulator; How or what are you going to develop your current project ??
    How We will communicate between both ?. . .
    Assuming You did the 1 second Pulse Generator and It does not work.
    So you probably ask here: Why do not work My pulse generator ?. I did It this way and this other way but does not run.
    would be very difficult to answer, because words alone would not show Me really how it is made your 1 second Pulse Generator.
    A picture says a thousand words.
    Anyway. We'll find the way to understand each other.

    A good and free simulator I think it does not exist.
    There are some who will lend them for a month (Demo):
    > The Multisim, National Instruments.
    > Proteus, Lab Center
    > CircuitMaker, Protel International Limited.
    > LiveWire, New Wave Concepts.
    > LT Spice, is seen that widely used by AAC users here. I believe this is free.

    What can you tell Me about the document that I have attached to you ?.
     
  10. koshi

    Thread Starter New Member

    Sep 25, 2014
    21
    0
    Hi,

    From your diagram, I can see that it includes directional and flow of traffic. But for my project, I think I should be focusing more on the traffic light, which means focusing on the 3 LEDs which represent the green/red/amber for the vehicle traffic and 2 LEDs to show red/green which represent whether to cross or not for pedestrian. Since the question only ask for 5 output signals, which I assume is 5 LEDs.

    Actually, I am confused too. Because my tutor didn't even explain anything and expect us to build something w/o providing ways to build the circuit. It is expected to build the circuit physically and test it which I think is stupid, since probably some parts will be wrong and debugging is rather impossible since I can't test it at home.

    Physically on a breadboard, I already have the 7805 volt regulator and 555 timer connected up. I just need to know how to build up that MOD7 & MOD 3 counter probably using the 74191 chip. I also have some JK flip flops hanging around but pertaining to the marking scheme, the lesser components the better. I assume if I use the JK flip flops to build the MOD counters, I would end up using more chips? Such as AND, NAND or whatever that will be required. I read a little and the 74191 can be built to be a MOD counter up to 16? Problem here is, I am unsure how to connect the chip to make it into a MOD 7/3 counter that I require.

    Sorry for the wordiness.
     
  11. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello koshi

    Ok, ok I get it.

    In my time there were very few school students. there was an opportunity to explain, almost everyone, but now there are lots of students per classroom. so the only tutor says, to the whole group: Do this or that. without further explanation.
    Students must now looking how to do the job.
    That’s what you're doing now.

    Give me some time to see if I have something on my PC.

    By the way, studying the data sheets of the IC's 555 and 94191.
    You could find more data sheets from here:
    http://www.alldatasheet.com/
     
    absf likes this.
  12. absf

    Senior Member

    Dec 29, 2010
    1,493
    372
    OK, you can start by designing the push button and the 3 second timer.

    Since MrCarlos has given you the datasheets of 555 and 74191.
    Do you know how to set up the 555 to generate 1 second clock in astable mode?
    Feed this clock to the 74191 in count-up mode and set PLOAD to zero. The counter would reset when the output is 3 or (bin 0011). you can use 2 input NAND to do this.

    The push button has to be latched. So connect it to a JKFF or transparent latch. The output of the latch is connected to the /ENABLE of 74191. This would enable the counter to count to the amout of seconds without holding the button. The latch should also be reset when the counter is reset.

    Allen
     
  13. koshi

    Thread Starter New Member

    Sep 25, 2014
    21
    0
    Hi,

    Before I even start trying to connect some of the circuit up, I hope to know if my individual components are connected at the right way you are describing.

    Can you take a look at the picture I attached? The left shows the connection of the 555 timer and the right shows the way I connect my push button with a D flip flop.

    @absf, is my push button connected the right way you mention that the button has to be latched and connect to a JKFF?(I used a D flip flop as some introduction lab I did this), will it be the same as compared to a JKFF?

    If all these are correct, I will then proceed with handling the 3sec timer.

    ee2020 project.png
     
  14. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello kashis

    As stated in Your post #10 I see that are only 5 lights.
    Therefore it is easier to develop this Traffics light system.

    I recommend building the counters: MOD 7 and MOD 3 As down counters.
    Anyway, I attached some Circuits that will help You in the development of this.

    The MOD 7 counter will generate a pulse (Clock V) every 7 seconds that will change the lights for vehicles.
    While,
    The MOD 3 counter will generate a pulse (Clock P) every 3 seconds that will change the lights for pedestrians.

    You will need other counters and other IC's named: Decoder/Demultiplexer 74LS139, which handled the lights.
    I have some progress in this regard. check them out and give me your opinion. Please.
     
    absf likes this.
  15. koshi

    Thread Starter New Member

    Sep 25, 2014
    21
    0
    Hi,

    I try to bold the questions I am trying to ask.

    What's the difference between your 555's connection and mine?

    And the clock pulse V and P are they suppose to be the from the same source of the 555 timer?


    Also, mind explaining some of the logic of your circuit regarding the Mod counters? I am a little confused.

    Is the circuit you provided just showing the connection on how the Mod counters should be done or are they the full circuit for the Mod counters?

    I need:

    1) 7 seconds for Veh_Red and Man_Green
    2) 7 seconds for Veh_Green and Man_Red
    3) 7 seconds for Veh_Amber

    Just to see if the circuit logic is going in tune with your diagram,

    According to the flow of the project, so first, I need 2 LEDs, a veh_red and man_green to light up for 7 seconds. According to your recommendation be done in count down so it will light up as it count from 7 to 0.

    Next, the LEDs in part 1 will be off and part 2, veh_green and man_red will light up for 7 seconds instead.

    Finally, the last LED, veh_amber will light for 7s while the rest are off.

    A push button is needed to turn the traffic light at any stage to stage 3 after 3seconds, which is why the mod 3 is needed. (How do I implement the button into the circuit connection-wise? I am trying to use a push button connected to a DFF to achieve the change, is this right?)

    From your diagram, there are 2 Mod 7 and Mod 3 in up/down counters may I know why there are 2 different ways?

    For each stage 1-3 above, do each LED require a separate Mod counter or can they share 1?

    Cause I have 5 LEDs ouputs that require counting and the diagram only provide 4 counters so I am just curious how the Mods are connected.

    Lastly!! If I were to remove the hex displays from the MOD counters, where will the output of the mod counters be connected to? The LEDs? Cause my project only requires to count when there are movement like people walking or maybe when the car is moving(green light).
     
  16. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello koshi

    You Asked:
    What's the Difference between your 555's connection and mine?
    A)-
    Basically no difference. But notes the value of the components and the diode.

    You Asked:
    And the clock pulse V and P are they suppose to be the from the same source of the 555 timer?
    B)-
    Not exactly. The Clock V is for timing lights for vehicles. And it is Generated by the counter U6 that you can see in the document MOD 7 MOD 3 Counter's.PDF
    While the Clock P is for timing lights for pedestrians. and it is generated by counter U4, in the same document.
    Discard counters U2 and U7; They are examples on how to configure Count Up 0-7 and How to configure Count Up 0-3, respectively.

    You Asked:
    Is the circuit you provided just showing the connection on how the Mod counters should be done or are they the full circuit for the Mod counters?
    C)-
    The document that I attached you (MOD 7 MOD 3 Counter's.PDF) only shows how 74LS191 is connected in MOD 7 Up and Dn. Also for MOD 3 Up and Dn.

    The next part of the project is not finished yet. (It is the reason that it is in blue)
    I need:
    1) 7 seconds for Veh_Red and Man_Green
    2) 7 seconds for Veh_Green and Man_Red
    3) 7 seconds for Veh_Amber
    Just to see if the circuit logic is going in tune with your diagram,
    According to the flow of the project, so first, I need 2 LEDs, a veh_red and man_green to light up for 7 seconds. According to your recommendation be done in count down so it will light up as it count from 7 to 0.
    Next, the LEDs in part 1 will be off and part 2, veh_green and man_red will light up for 7 seconds instead.
    Finally, the last LED, veh_amber will light for 7s while the rest are off.
    A push button is needed to turn the traffic light at any stage to stage 3 after 3seconds, which is why the mod 3 is needed.


    You Asked:
    (How do I implement the button into the circuit connection-wise? I am trying to use a push button connected to a DFF to achieve the change, is this right?)
    D)-
    Take it easy; you already understood perfectly well how to wire the 74LS191 for any MOD ???
    But yes, you could use a D-type Flip-Flop (DFF) for this part of the system.

    You Say:
    From your diagram, there are 2 Mod 7 and Mod 3 in up/down counters may I know why there are 2 different ways?
    See My answer B)-, The last line.

    You Asked:
    For each stage 1-3 above, do each LED require a separate Mod counter or can they share 1?
    E)-
    No, No; You'll have in your design only 4 74LS191 counters.
    1- For timing the lights of the vehicles.
    2- For each of the vehicles lights: Red, Amber and Green.
    3- For timing the lights of the pedestrian.
    4- For each of the pedestrian lights: Red and Green.
    You Say:
    Cause I have 5 LEDs ouputs that require counting and the diagram only provide 4 counters so I am just curious how the Mods are connected.
    F)-
    I repeat: reread my answers B)- and E)-

    You Asked:
    Lastly!! If I were to remove the hex displays from the MOD counters, where will the output of the mod counters be connected to? The LEDs? Cause my project only requires to count when there are movement like people walking or maybe when the car is moving(green light).
    G)-
    The HEX's Display you can look at the document that I have attached DO NOT EXIST in the market.

    How much you've been done so far ??
     
    Senior Shimhanda, absf and koshi like this.
  17. koshi

    Thread Starter New Member

    Sep 25, 2014
    21
    0
    Thanks for the explanation.

    I think I will go slow, at the moment I have the 555 connected up physically and tested, so I will probably start working on the mod counters. Since, I will not be using the hex displays, will the NAND gates and inverters still be connected to the Q1,Q2 and so forth as follow in your diagram? I would like to test out if the mod 7/3 works physically.
     
  18. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello koshi
    All you need to build appears in the attached document.
    In this first stage.

    Try to follow me:
    I'm having trouble about the matter: Button to cross the street.
    I made some assumptions:
    If the red light for vehicles is on, someone presses the button.
    The green light to cross the street should turn on.
    The red light, on the lights for the vehicles, must remain on and continue their cycle when the time to cross the street ends.

    But when other than red light is on, on the lights for the vehicles, someone presses the button.
    I think the cycle, for lights for vehicles, must end.
    As soon complete its cycle lights for cars, lights for the cycle for the pedestrian should start with the green light. And the system continue normally

    Take a look at this part of the system.
    It is not finished, this is the first attempt.
    The Five Lights.DSN, in the ZIP file is attached.
    also the PDF for the same circuits.

    Maybe absf could help a little, or Yourself.
     
    Last edited: Sep 29, 2014
    absf likes this.
  19. absf

    Senior Member

    Dec 29, 2010
    1,493
    372
    @MrCarlos,
    I just re-read the first post.

    Though there are 5 LED, but they are actually only 3 condition for the LED. It seems to me that the Veh_RED is parallel with Man_Green and the Veh_Green is parallel
    with Man_RED.

    But in your simulation, the 3 LED for Veh are connected to one decoder while the 2 LED for Man are connected to another decoder.
    When Veh_Green is ON, and I press the button, the Man_Green would light after 3 seconds while the Veh_Green is still ON. I think that's not correct.

    According to the quotes above, it should be
    1. If Veh_Green is ON, and the button is pressed.
    2. After 3-seconds count-down, Veh_Green should turn to Veh_Amber.
    3 After another 7-seconds count-down, Veh_Amber would change to Veh_Red.
    4 The pedestrian has to wait 10 seconds after pressing the button to be able to cross the road.
    5 He has 7 seconds to cross the road and that's when the count-down timer display begins.

    But I think it's enough for the OP to study and understand how the two circuits work. Let him chew on a while and see if he can came out with any solution before
    offering him more help. My circuit didn't work properly and I am using 4017 as the decoder.

    I think the 5 LED part was well designed and I would continue to improve on that.

    Allen
     
  20. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    Hello absf, thank you very much for your answer.
    It seems reasonable.
    And yes, as you say, wait while the OP says something.

    Nice to read you again.
     
    absf likes this.
Loading...