How to use a LS191 as a counter with button

Discussion in 'Homework Help' started by asteroidas, Jan 4, 2015.

  1. asteroidas

    Thread Starter New Member

    Jan 4, 2015
    3
    0
    Hi, i have a task like we have a parking area with 2 sensors and we have a 2 indication boards ( i used seven segment). One shows free spaces in the parking area, other indicator shows used spaces. All we have 10 parking spaces. So, first of all i would like to do it with 9 spaces ( its easier because its need only 1 indication for number 9). Then i push first button, green indicator should count up by one, and red indicator should count down by one. Same is with second button. Then i push it green indicator should count down by one and red indicator should count up by 1. Can you help me with this? I will add picture what i have. I would like to know how to connect inputs of LS191 and how this counter works, because i dont understand anything from datasheet :/ Thanks for your time!

    Here is what i have: http://imgur.com/51f4Fh5
     
    Last edited: Jan 4, 2015
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,393
    497
    There are two modes:
    1) Setting up the counter.
    2) Running the counter.

    Also I don't understand how pushing the same button produces count up first time, then produces count down second time.
     
  3. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    I think he has two counters and two pushbuttons. Let's call the counters the green counter and the red counter.

    The first button increments the green counter and simultaneously decrements the red counter.

    The second button decrements the green counter and increments the red counter.

    I didn't see the same button alternating actions (increment/decrement) between pressed? Asteroidas, do I understand your scenario correctly?
     
  4. asteroidas

    Thread Starter New Member

    Jan 4, 2015
    3
    0
    I did it by myself the first part from 0 to 9..Now the question is how to make to count from 0 to 10 with 2 indicators? Here is what i have now : http://imgur.com/bQGK0Rr
     
  5. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,393
    497
    lol
    I see you are not using 74ls191 anymore.

    To get 10 you can use several approaches.
    - If you had 74ls191, you could have cascaded two 74ls191. 74ls191 has one or two additional outputs. You could have used that additional output as input to the second (cascaded) 74ls191 to generate 1 when first 74ls191 reaches its desired maximum of 9. I am too lazy to look up 4510, but it might have this option too.
    - You can build your own circuit to generate 1 whenever 0-9 counter goes over 9.
     
    Last edited: Jan 4, 2015
  6. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    How does your circuit count down? The pin must be held low for the 'ls191 to count down, and your clock and U/D pin are both driven from the pushbuttons and are both brought high? It also looks like both counter's will increment on a button press. Is this desired action? Or did I miss something. Have you simulated this circuit?
     
  7. asteroidas

    Thread Starter New Member

    Jan 4, 2015
    3
    0
    Now i use 4510BD and everything works right. Yup i simulated this circuit. I tried to make to count to 10 with 2 indicators, but i didint succeed. I will try tomorrow again ;)
     
  8. WBahn

    Moderator

    Mar 31, 2012
    17,751
    4,797
    Another thing you might look at is just using a single counter and having your buttons either increment or decrement it. The output of that can be used to drive the display for the number of spaces taken and then you can use an adder to subtract that value from the total number of spaces to get the value for the other display.
     
Loading...