Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Counter to 15 with a switch (push button)

Status
Not open for further replies.

Antrop

Newbie level 5
Joined
Jan 2, 2014
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
69
The project that was given to me is: Build a digital circuit that shows the numbers from 1 to 15 (and number 0 too ofcourse) on 4 LED diodes. With a switch change the numbers.

Basically the truth table 8421.

I was thinking of using a 74LS193 counter and with pressing a switch the numbers were to change. How do I go about implementing the push button so that by pressing it I change the number and that is shown on 4 LED diodes?

I saw people using 555 timer clocks for changing the counter number output but I haven't seen them using a switch. I'm also having a trouble figuring out whether I should use 555 timer too and how would I go about implementing the push button for switching the numbers.

Nowhere did it say I have to use a counter I'm aware of that but I figured that the counter was the easiest way to go (It might not be easiest way to go but that's what I think right at this moment).
 

You can certainly use a 74LS193, but the switch becomes a problem because of 'bounce'. Mechanical switches don't close (or open) ideally; every time you actuate them they bounce between open and closed states until they finally settle down. There are several solutions I can thing of: You could use the the switch to trigger a 555 (as a monostable) and use the output of the 555 to drive the clock input of your counter. Or, you could use the switch to drive the enable input of the counter and drive the clock input of the counter with a slow clock (slower than the bounce time of the switch) derived from a 555 (as an astable). There are many other solutions.
 
You can certainly use a 74LS193, but the switch becomes a problem because of 'bounce'. Mechanical switches don't close (or open) ideally; every time you actuate them they bounce between open and closed states until they finally settle down. There are several solutions I can thing of: You could use the the switch to trigger a 555 (as a monostable) and use the output of the 555 to drive the clock input of your counter. Or, you could use the switch to drive the enable input of the counter and drive the clock input of the counter with a slow clock (slower than the bounce time of the switch) derived from a 555 (as an astable). There are many other solutions.

Thank you very much for your suggestion. I will post when I make the schematic how it works.
 

I have managed to make the schematic and it works in MultiSim. I know I know I know I know that MultiSim and Reality are two separate things so what I ask is that if you see some problems in my schematic please point it
out. For example if you think something will burn out because I didn't put a resistor tell me :D. The push button simbol is the only one I managed so I connected it just for it to work. I used VCC on that pushbutton because it will be only tested on a protoboard.

Capacitors values bug me little. Do you have any suggestions about value of the capacitor I should put?

Schematic.png
 

Several comments:

1) The way it's shown, S2 will either connect ground to ground or trigger to VCC, I don't think that's what you want. The 555 triggers on a NEGATIVE-going transition. You want a pullup resistor on the TRI input, with the switch pulling it to ground to generate a pulse.
2) The CLR input on the 193 is floating; add a pull-down resistor to ground.
3) You'll want a MUCH longer time delay than you have on your 555 (you've got less than 100-microseconds). You'll want something greater than 10mS at the very least.
 
  • Like
Reactions: Antrop

    Antrop

    Points: 2
    Helpful Answer Positive Rating
Several comments:

1) The way it's shown, S2 will either connect ground to ground or trigger to VCC, I don't think that's what you want. The 555 triggers on a NEGATIVE-going transition. You want a pullup resistor on the TRI input, with the switch pulling it to ground to generate a pulse.
2) The CLR input on the 193 is floating; add a pull-down resistor to ground.
3) You'll want a MUCH longer time delay than you have on your 555 (you've got less than 100-microseconds). You'll want something greater than 10mS at the very least.

I have added the pullup and and pulldown resistor and as for time delay it's a little over 1s (I hope that is sufficient). I changed the value of R6 to 10M Ohm and C1 to 0.1 uF.
Is this how you suggested:

Reworked schematic.png
 

That looks ok. I'm not sure if that 10M resistor is too high; look at the data sheet. Also, you need to make sure you release the pushbutton before the pulse times out, or you'll generate another trigger when the switch bounces on release. Another approach is to use a capacitively coupled trigger input (there's info on the data sheet, I believe)
 
  • Like
Reactions: Antrop

    Antrop

    Points: 2
    Helpful Answer Positive Rating
That looks ok. I'm not sure if that 10M resistor is too high; look at the data sheet. Also, you need to make sure you release the pushbutton before the pulse times out, or you'll generate another trigger when the switch bounces on release. Another approach is to use a capacitively coupled trigger input (there's info on the data sheet, I believe)

I took a look at the graph and saw that using resistor of a value of 10M and a capacitor of 0.1 uF makes time delay around 1.2 sec. I have never even heard of the capacitevly coupled trigger before but I will take a look at what it is.

Thank you very much for your help :)
 
Last edited:

I bought all the the components for the schematic except two electrolyt capacitors. I switched them with two ordinary capacitors of same value and 0.01uF capacitor can store up to 65 Volts.

I have a battery of 4.5V. I have connected everything on schematic and triple checked. It doesn't work I do not know for which reason. It can be that the slightest deviation from the 5V and it wont work or that It is not possible to just switch electrolyt capacitors with ordinary ones or I haven't connected it correctly and I can't see my own mistake(It can be a completely stupid mistake and obviously I wouldn't notice).

In the picture of the connected componets along with the schematic all the wires are separated enough so there is no mistake in that. This is my first project so it is quite possible that I have even connected push buttons wrong.

Could you please point out the mistakes I made if you can see them so I can correct?
Pink wire is GND or - and Red wire is VCC or + (Battery of 4.5V is my power source)


Protoboard.JPGReworked schematic.png
 

I don't even think there is such a thing as a 0.01uF electrolytic cap, so no problems there. Without some measurements of points in the circuit it's impossible to tell what the problem is. Do you have an oscilloscope? That would be a BIG help.

But first of all, your main problem is your power supply. 4.5V is the absolute minimum the 555 will work at. The LS193 needs a minimum of 4.75 volts. You might want to replace your 4.5 volts with a 9V battery and regulator.
 

I'm not that rich I'm a student xD. At faculty they have an osciloscope and an DC power source regulator (I do not know how to call it) but it can give 5V/DC easily can i try that?

Can I also try connecting my battery with annother battery 4.5V+1.5 with 6V?
 

I'd try the power supply first. 6V is not ideal, either. 74LS logic wants to run between 4.75 and 5.25 volts. It will probably run at 6V, but that's outside the recommended operating range. The 555 is good up to 18V.
 
  • Like
Reactions: Antrop

    Antrop

    Points: 2
    Helpful Answer Positive Rating
I was impatient because I'm going to college on Monday and it did not work with 6V either and I checked the components again and they are all correctly connected. I will try with on college the 5V.

When I was putting wires in protoboard I wasn't careful at first and It caused protoboard to (not puncutre) but bassicly I could see the bottom side marks of putting the wires in it. I know that was opposite of careful (I can't remember the word). The bottom is still "attached" to the protoboard so I think it Its alright.
 

If the wires are too thick (which it looks like they might be) you can ruin the contacts in the protoboard so that you are not making good contact.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top