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.

How do you wire LED's with momentary switches?

Status
Not open for further replies.
I've just noticed there's a component missing from the circuit I posted. There should be a pull-down resistor of, say, 10k (its value is not critical; anything from ~10k to 100k will do) between the clock input line and 0V (ground).
Good luck with the project.
 
Ok, so where do I place the resistor on the diagram? I have added them to the schematic, but please double check my updates to the schematic and verify that they are correct. I changed the wordage on the chips and added part numbers to the transistors and diodes. I changed the resistor values for R2 R4 & R6. I was unable to find the values for the LED's that I have on hand, but I used the LED's with 1K resistors when I wired them up with 9 volts in the past, and the 1k's worked great. Will they be ok in the circuit, or do other components require the resistor values to be a "closer match" in value?

Also, I am a little confused about how the switches are wired up? Could you help me to understand the diagram where the switches are? It appears as though the diagram is showing the normally open tab as going to + voltage and the normally closed tab is going to the set pin of the chip, but what goes to the center tab of the switch? Does the negative wire from the battery and all of the commons go to the center tabs of each switch?

Did I mention I am a total NEWB? LOL. Thank you for clearing these things up for me. I just want to get it right the first time and not be scratching my head while trying different combinations or adjustments to figure out why the circuit is not working when I go to put everything together.
 
Last edited:
I've redrawn the circuit to clarify things (I hope!).
LEDswitcher2.gif
The switches SW1-SW3 are now shown in a more conventional way.
The latches are identified as type CD4013.
The D input of each latch is connected directly to 0V (represented by the triangle symbol).
R9 is the pull-down resistor which I mentioned in post #21 (the 4 resistors you added to the schematic were not connected to 0V as I suggested, and only one pull-down is necessary anyway).
R2-R6 are shown as 1k (which is perfectly suitable for 9V use, as you have already found).

Edit: All references to 5V on the schematic should be corrected to 9V. The NC contacts of the switches are unused, and the centre tabs connect to V+.

Let us know how you get on.
 
Last edited:
If you want to use this project outdoors it would be a good idea to use ultra-bright LEDs (particularly as with 1k resistors for R2-R6 the LED current will be only ~ 7mA).
I assume you've downloaded a datasheet for the 4013 ? That will give pin-out data (which is not shown in my schematic).
 
Ok I've got all the parts and trying this as a two button operation and leaving off the 3rd button for simplicity right now. I have the 4013 data sheet and have hooked up the circuit. Thank you for the info on using Ultra brights when using outdoors. It appears as though the reset function is not working correctly.

When I power up the circuit, both LED's are on. If I press switch 1 first, it allows LED 1 to stay lit and turns off LED 2. Then if I press LED 2, It activates LED 2, and LED 1 stays lit.

Now, here is the interesting part.... If I power on and press switch 2 first, it allows LED 2 to stay lit and turns off LED 1.

But, once I press button 1 (which shuts off LED 2 and turns on LED 1 like it is supposed to), and then press button 2, LED 1 always stays on.

Maybe I hooked something up wrong, but it all looks right. It seems as though the reset works the first time around, as long as I press button 2 first, but from there on, LED 1 is always on. I hope this makes sense. It was difficult to put into words.

Would you be willing to take a look and perhaps give me some pointers on where I might double check the circuit? I looked it over and it seems to be connected right, but if you could give me an idea of where to focus my attention, I could better check that area. Thank you for all your help. I am so close to getting this finally worked out, I am beyond excitement.
 
Last edited:
Strange. If LED2 always switches off when it is supposed to but LED1 sometimes does and sometimes doesn't, that suggests the general principle of operation of the circuit is ok, but there is an intermittent problem with either the D input or clock input of LED1's latch, or with the diode connected to the 'preset' input of that latch. I'll play around with the simulation to see if I can reproduce the problem (but it may be a day or two before I can get back to you on that).
Is the circuit set up on a breadboard, or hard-soldered?
 
I will check the areas you have mentioned. I have the circuit on a bread board for tweaks. It's just weird that it works right if I push switch 2 first, but then after I push switch 1, LED 1 will not turn off after that. I'll check it over and if I find something I will let you know, otherwise, I will await your next response. Thank you so much!!
Strange. If LED2 always switches off when it is supposed to but LED1 sometimes does and sometimes doesn't, that suggests the general principle of operation of the circuit is ok, but there is an intermittent problem with either the D input or clock input of LED1's latch, or with the diode connected to the 'preset' input of that latch. I'll play around with the simulation to see if I can reproduce the problem (but it may be a day or two before I can get back to you on that).
Is the circuit set up on a breadboard, or hard-soldered?
 
Ok, you were right I didn't have the D input going to ground on LED 1. It works!! I will add numbers 3 and 4 hopefully in a few days and make sure that works as well, but I think it will be fine. Awesome!! You are a life saver.
I will check the areas you have mentioned. I have the circuit on a bread board for tweaks. It's just weird that it works right if I push switch 2 first, but then after I push switch 1, LED 1 will not turn off after that. I'll check it over and if I find something I will let you know, otherwise, I will await your next response. Thank you so much!!
 
Glad to hear you cured the glitch. Hope the added stages will be ok too.
 
As I am building this on a pc board, I am realizing that in some instances I will need to be able to use an individual button to turn off it's own LED rather than turn off all of the others. Is there a simple solution to this for each stage? Will there be possible syncing issues with the amp to where the LED could be off when the function is on and vice versa?

Glad to hear you cured the glitch. Hope the added stages will be ok too.
 
If you're wanting a single switch to turn on its own LED with one press and turn it off with a second press then that can be done, and the stage could be prevented from turning off the others. But as you say, there will be syncing issues, because each press would turn on or maintain the amp function. I don't see a simple solution; at least not with the circuit I proposed.
BTW, how do you turn off an amp function? Is there a master 'all functions off' button, or can you only cancel one function by selecting another?
 
The amp has four footswitchable functions, and three of them are setup so that when one of the three buttons is pressed, it cancels the current function. I forgot about the one function that is independent of the other 3 that turns on its own function with one press and turns it off with a second press, so I would need it to do the same with the LED.

Also when I first asked about this project, I forgot that some of my previous amp footswitches had four momentary buttons and each button would turn on its own function with one press and turn it off with a second press. There was not a master all off button. Thanks

If you're wanting a single switch to turn on its own LED with one press and turn it off with a second press then that can be done, and the stage could be prevented from turning off the others. But as you say, there will be syncing issues, because each press would turn on or maintain the amp function. I don't see a simple solution; at least not with the circuit I proposed.
BTW, how do you turn off an amp function? Is there a master 'all functions off' button, or can you only cancel one function by selecting another?
 
I'm confused. Which solution are you looking for :- (1) three stages "setup so that when one of the three buttons is pressed, it cancels the current function" (as provided by my present circuit suggestion), and with a fourth stage which independently toggles on/off with successive presses, or (2) "four momentary buttons and each button would turn on its own function with one press and turn it off with a second press" (i.e. four independent stages with no automatic cancellation of other functions) ?? I think you intend solution #1, and that the reference to your 'previous amp' is a red herring. Please confirm.
 
The amp is a Carvin V3 and the footswitch has Channels 1-3 and an Effects button (boost) but no LED's. I want to add the LED's but I do not have a lot of room in the enclosure, so I need a circuit like this to do so. Your circuit suggestion is right on the money for the first 3 stages but in order to be able to have an LED at the 4the stage (the Effects button) I need the fourth stage to be able to independently toggle on/off with successive presses.

As a side note, I was hoping to be able to work out four independent stages that toggle on/off with successive presses with no automatic cancellation of other functions.

As I mentioned in an earlier post, I wanted to be able to adapt the circuit to add or subtract stages for uses with other amps, but at that time I did not take into consideration that other amps require four independent stages that toggle on/off with successive presses with no automatic cancellation of other functions.

I was hoping it would be a simple alteration in which the reset pin for each stage just needed to be ran to each buttons own stage, rather than the way the circuit is set up now.


My understanding of logic circuits is very very limited. I can't get my head around the concepts, but I can follow basic wiring layouts and basic schematics most of the time. That is why I asked for help. If we have gone as far as we can with this project, then that's ok. I will have to deal with it. I am very grateful to have found this board, and I appreciate all of your help.

I'm confused. Which solution are you looking for :- (1) three stages "setup so that when one of the three buttons is pressed, it cancels the current function" (as provided by my present circuit suggestion), and with a fourth stage which independently toggles on/off with successive presses, or (2) "four momentary buttons and each button would turn on its own function with one press and turn it off with a second press" (i.e. four independent stages with no automatic cancellation of other functions) ?? I think you intend solution #1, and that the reference to your 'previous amp' is a red herring. Please confirm.
 
That's clarified things. The circuit below should do what you want :-

Toggler4.gif

The first two stages are as we had before, with each auto-cancelling the function of the other. Just clone the components in the blue rectangle for additional auto-cancelling stages (note that they have a common clock line). The third stage shown is an independent one which turns a function on with one press and off with a second press (note the different clocking arrangement, different 'D' connection and grounding of the 'preset' input). Just clone the components in the green rectangle for additional independent stages. Capacitor C1 and resistor R10 overcome switch contact bounce (which would otherwise cause multiple toggling of the independent stage).

Edit: At power-up the 4013 may be in an indeterminate state, so a random LED may light.
Also, if two switches are pressed at the same time two LEDs may light.
Just press the appropriate switch (again) to resolve the uncertainty.
 
Last edited:
I believe you have captured what I am looking for. Just to be sure, if I build a circuit with stage one and 3 other green rectangle stages, then stage one will independently toggle it's LED on/off with successive presses just like the other 3 stages, correct?

That's clarified things. The circuit below should do what you want :-


The first two stages are as we had before, with each auto-cancelling the function of the other. Just clone the components in the blue rectangle for additional auto-cancelling stages (note that they have a common clock line). The third stage shown is an independent one which turns a function on with one press and off with a second press (note the different clocking arrangement, different 'D' connection and grounding of the 'preset' input). Just clone the components in the green rectangle for additional independent stages. Capacitor C1 and resistor R10 overcome switch contact bounce (which would otherwise cause multiple toggling of the independent stage).

Edit: At power-up the 4013 may be in an indeterminate state, so a random LED may light.
Also, if two switches are pressed at the same time two LEDs may light.
Just press the appropriate switch (again) to resolve the uncertainty.
 
Last edited:
No; stages 1 and 2 are both of the auto-cancelling type, not independent. If you want all four toggles to be independent you need to omit stages 1 and 2 and instead make all four stages as per the green rectangle.

I've been thinking about the sync problem. If the Amp is one which doesn't have auto-cancelling of functions, but needs successive presses of the same switch to toggle a given function (i.e. each channel is independent), then unless we can extract a signal from the Amp which indicates its currently selected channel I can't see how to guarantee the LEDs are synced with the channel selection. I think the best we can do is to ensure all LEDs are reset to 'off' at power-up, or by manual action if the sync is obviously wrong. To that end I've added the components shown in the red rectangle in the circuit below, to provide a power-on reset plus a manual reset switch. Note that this circuit mod requires the 'CLR' inputs of all the stages to be connected to the reset circuit instead of to ground.

Toggler5.gif

Edit: It might even be necessary to provide separate reset circuits for each independent stage.
 
Last edited:
I guess I would have to know what the default setting is for each amp I plan to use the circuit with. At power up, I would need to know if the amp has memory as to which functions were active at shut down or if it has a Power up default for each function. I may just have to cross that bridge when I get there. Having a reset for each independent stage is probably not something feasible for live performance.
 
Yes, I think such info might help.
I agree multi-resets are probably unsuitable for live performance, though if the sync is set up pre-performance and the power is kept on then the sync should be maintained. Note, I said 'should' !
If a commercial amp has independent press-on-press-off channels how do you tell visually which channel(s) is/are 'on' during a performance?. Don't amps have channel lights built in? Or is it digital displays these days?
 
If you are not using a footswitch, or the footswitch does not have LED's you have to either "know your sound" and have a keen sense of what functions are active to make up that sound, or physically look back at the LED indicators on the amp.
 
Status
Not open for further replies.

Latest threads

Back
Top