Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Tactile Switch Used As Push On/Off Issue

Status
Not open for further replies.

Psychopathetica

New Member
Hi there. Im new to the forums and have a question. Im building a circuit that uses the momentary tactile switch I have as a push on push off button to light up an LED. However the only solution to this I found on Google through just one site found HERE was to use a J-K Flip Flop IC. Now I managed to score some off of RadioShack.com, only the ICs I purchased are NTE74H76, which are 5v J-K Flip Flop IC with Preset/Clear. I also managed to download the PDF to what each of the pins do off the IC chip. I followed the instructions the site gave, but the only difference was I have my 9v battery running through a 7805 voltage regulator to drop the voltage down to 5v, run it all through the breadboard, and....the LED just stays on no matter what, even if I output it from Q or /Q. Heres how I wired it:

The LED Im using is Blue with a Vf of 3.7, at 20 mA, and 2600 mcd.
The momentary tactile switch I have has 4 legs, with 2 (+) on top and 2 (-) on the bottom

- I have the (+) of the 9v battery hooked to the 7805 voltage regulators left pin for input.
- The middle pin of the 7805 is ground, and is hooked into the (-) of the 9v battery.
- The right pin of the 7805 is outputing 5v and being fed into the bread board.
- The ground is also connected to the bread board as well as the (-) of the 9v battery.

- I wired the bread board so power and ground is fed through both the top and bottom of the bread board.
- 5v DC is being fed into the NTE74H76 IC chip where it says VCC.
- The IC chip is also grounded where it says GND.
- 5v is also being put into one of the two (+) of the 4 legged momentary tactile switch.
- The (-) end of the momentary tactile switch is connected to the CLK of the IC.
- A 10k ohm resistor has been placed at J of the IC and is connected to 5v so it is High.
- A 10k ohm resistor has been placed at K of the IC and is connected to 5v so it is High.
- A wire has been placed on PR (Preset) of the IC and is connected to ground.
- A wire has been placed on CLR (Clear) of the IC and is connected to ground.
- A wire has been placed on Q and is connected to a 65 Ohm resistor. This is the output of the chip.
- The 65 Ohm resistor has been connected to the (+) of the blue LED.
- The (-) of the LED is connected to ground.

Power it up and it stays on no matter what. After repeatedly pushing the button, it still stayed on. No flicker or anything. And like I said I even tried wiring it to /Q as the output but same thing happened. Here is a pic of the chip Im using. What could I be doing wrong? Thanks in advance and let me know if you need more details or pics.
 

Attachments

  • NTE74H76 Chip.png
    NTE74H76 Chip.png
    19.7 KB · Views: 235
My eyes glazed over reading this. It would be much better to see a schematic....
Attached is a simple on/off circuit. Add a transitor to it to drive loads or use th 74HC4049 (maybe several gates in parallel on the output) to drive the LED. E
 

Attachments

  • PushOn-PushOff.pdf
    292.4 KB · Views: 384
Unless I've misread your setup what you don't have is a pull-down resistor from the CLK input to ground. But it would be better instead if your switch was connected between CLK and ground (not to 5V), because TTL circuits have an internal pull-up. You may also have problems because of switch contact bounce, requiring additional debounce components.
 
Last edited:
Here a previous thread on this topic. I posted a sim of the suggested circuit.

Here is an alternative using a 555 chip. Read the section "Relay Toggle Circuit Using a 555 Timer.

Using an edge triggered flip flop is bad news because of all of the switch debounce you will have to do between the switch and the clock input of the flip-flop.
 
Last edited:
Hey guys, thanks for the feed back...and the mod that finally approved my first thread o_O

I would have gotten to this days earlier, but work and real life caught up with me. I managed to kinda get it working by putting J, K, PR, and CLR on High according to a website I found. They said this puts the chip on toggle mode. I also wired the tactile switch wrong like alec_t said. Turns out after hooking it up to a potentiometer and messing around, I had to put the (-) of the button to ground, and connect the (+) of the button to the CLK of the chip, not feed in 5V. When I had the 10kΩ pot down to 0Ω, the light stayed on. When I added a little resistance turning the knob, It started doing what I wanted it to do. So I replaced the pot with a 2.2kΩ resistor since anything about higher caused the light to stay off. Only problem is, it did what I wanted it to just 60-75% of the time, not fully 100%. Pushing it for on, and pushing it for off caused it to sometimes momentarily turn on and off, but once in awhile. Another thing is, is that I think the IC chip itself has a little bit of resistance cause the LED wasn't fully bright when compared to directly wiring it to 5V DC. Would use a multimeter but the Radio Shack one didnt even last me 2 weeks and I couldnt return it. I might resort to Mikes alternatives, but I feel Im so close with the circuit I currently have. I think a 2n4401 transistor might help if I output Q to it, so it makes the LED bright again, but I don't know how much power or current that transistor is truely gonna make it become. Anyways I never went to school for electronics as Im just a hobbyist, although I can understand some but not all schematics. So here is a rough sketch how I wired everything in the breadboard. Resort to the pinout of the chip in the first post if you have to:

**broken link removed**
 
Only problem is, it did what I wanted it to just 60-75% of the time, not fully 100%. Pushing it for on, and pushing it for off caused it to sometimes momentarily turn on and off, but once in awhile.
That's because of switch contact bounce. You have no debounce capacitor on the breadboard. Connect 10uF between the switch+ and ground (with the -ve leg of the cap at ground).
If you use a transistor to boost the LED current you should use a resistor in series with the LED to keep its current below the rated maximum (normally ~30mA).
 
A couple questions. How much resistance do 16 pin ICs have? And without a multimeter, how can i mathematically calculate how much current a 2n4401 transistor increases? Is it current or voltage i need to boost?
 
How much resistance do 16 pin ICs have?
It depends on the technology and whether an input or an output is under consideration. The 74H46 outputs can each sink ~ 20mA, (so output resistance when sinking current is < 250Ω) but can only source ~0.5mA (so output resistance is then ~10kΩ).
how can i mathematically calculate how much current a 2n4401 transistor increases?
You look for the hfe value in its datasheet. However, you shouldn't need a transistor in your application. Just connect the LED differently: LED + to the 5V line and LED - to a 100Ω (instead of the 65Ω) series resistor that connects to the ICoutput pin.
 
Holy cow you are right! I put a 10uF capacitors (+) leg at the switches (+) leg, grounded the capacitors other leg, fed 5VDC into the resistor, which is connected to the LED, and grounded the LED at Q of the IC chip. Powered it up and bam! It works! Problem resolved. Thanks alec :D
 
Good to know it's now working.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top