How to allow only a short pulse of current to flow when a switch is closed?

Started by paulbuzz, February 16, 2025, 02:46:26 PM

Previous topic - Next topic

paulbuzz

I have a pedal which accepts a tap tempo switch which works (mostly) similarly to many others:

 - the tap-input socket on the pedal provides a voltage (3.3v) which is then shorted to ground by two brief presses of a normally-open momentary switch. The length of time between the first and second 'taps' on the switch tells the pedal what tempo to set.

Such pedals usually take the timing information from the two 'closings' of the momentary switch - ie when you press your foot DOWN on the switch for the first and second times, shorting the control voltage to ground.

However, this particular pedal takes its timing information from the two 'openings' of the switch - ie when you lift your foot OFF the switch, breaking the short from the control voltage to ground.

This is most inconvenient, as unless you make the taps of your foot on the pedal very consistent and short, the timing comes out wrong.

So my idea is to add a small circuit to the tap switch, powered by the 3.3v coming from the pedal, which, as soon as it detects the voltage being shorted by the pressing of the switch, very rapidly shuts off the current flow, allowing only a very short pulse, as if you had lifted your foot from the switch extremely quickly.

This seems to my electronically untutored brain as though it should be pretty simple to implement (a transistor acting as a switch to shut off the current...?) but sadly my electronics knowledge is far too feeble to know how.

So - any advice on how to do this would be gratefully received!

PS My problem is not caused by the pedal in question requiring a normally-closed momentary switch rather than a normally-open one, as eg some Boss pedals do. I'm familiar with this distinction, and have experimented with a normally-closed switch. This doesn't work at all.

Thanks in advance, Paul 

GibsonGM

Hi, can you post a schematic of the actual tap tempo circuit?  I think that would help generate ideas, seeing what there is to work with.   :icon_lol:
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

ElectricDruid

The solution to this problem is to take the firmware programmer outside and give them a good kicking until they promise to use their brain and not do it again. :icon_evil:

Tap tempo on switch *release*?!? Jeez.... :icon_eek:

PRR

  • SUPPORTER

ThePracticalPeasant

I'm far from any kind of expert, but can't you get a 555 timer to do this?
  • SUPPORTER

GibsonGM

Quote from: ThePracticalPeasant on February 16, 2025, 07:41:19 PMI'm far from any kind of expert, but can't you get a 555 timer to do this?

That's on the line of what I was thinking. Or some way to invert the operation of the tap!
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

paulbuzz

Quote from: ElectricDruid on February 16, 2025, 06:30:33 PMThe solution to this problem is to take the firmware programmer outside and give them a good kicking until they promise to use their brain and not do it again. :icon_evil:

Tap tempo on switch *release*?!? Jeez.... :icon_eek:

This seems a sound suggestion; a more benign and relaxed attitude towards the annoying pedal would surely result.

I name Digitech as the guilty party. Fetch the pitchforks!

R.G.

I would use a CMOS hex inverter and a transistor. The CMOS would square up whatever the switch did and provide a single pulse to drive an NPN transistor base or 2N7000 mosfet gate for a short pull-to-ground-and-release.l

Tom, I agree. Kicking is appropriate, flogging may need to be brought back. The right way to do an off-board switch is to make it a momentary contact to ground.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

paulbuzz

Quote from: GibsonGM on February 16, 2025, 05:42:23 PMHi, can you post a schematic of the actual tap tempo circuit?  I think that would help generate ideas, seeing what there is to work with.  :icon_lol:

Sadly I have no schematics, and tracing or any modding would likely be very tricky as it's all made out out of Digitech's finest teeny tiny components...

So really all there is to work with is what I've already described - a tap input jack with 3.3v on the tip and 0v on the sleeve. And a normally-open momentary SPST footswitch that gives the pedal timing information... when you take your foot OFF it...

So yes, walk of shame for Digitech's programmers, but I'd still like to find a solution!

paulbuzz

Very grateful for the pointers so far (as well as the general agreement that it's an infuriatingly foolish arrangement) but I'm afraid my electronics knowledge is so scanty that I will need fairly detailed guidance, if possible.  :icon_redface:

Clearly (and unsurprisingly) the solution is not quite as simple as I had initially hoped!
R.G.'s suggestion of a CMOS hex inverter and an NPN or mosfet transistor seems the most fleshed-out suggestion so far.
Anyone willing and able to elaborate on the details?
Would such an arrangement be able to be powered from the 3.3v coming from the pedal's tap input, and so not require an additional power supply to the tap switch?
 

ElectricDruid

I've been trying stuff like this, but I haven't got it yet:

https://tinyurl.com/27foc5bz

The idea here was the cap would charge through the 10K, then when you close the switch, it discharges through the 100R, turning the transistor on briefly. The 10K on the collector represents the internal pull-up on the tap tempo input.
But it doesn't work because when the switch is closed, the transistor base is connected to Vdd by the 100K. You could use a SPDT to get around that, but it seems like it should be possible with a SPST.
It's basically a very simple monostable we need - you press the trigger, it fires a short pulse, turning a transistor on which shorts the input to ground briefly. The logic won't be inverted exactly, but if the pulse is a fixed length and very short (few msecs) then the problem goes away.

Edit: This might work:

https://tinyurl.com/22ew7omn

Like this, the base voltage is too low to switch the transistor on as soon as the cap discharges, so you get a brief drop in the collector voltage, but only very brief. You then have to wait a little while (50msecs) before the cap recharges and you can tap again.
It probably needs the values juggling, but I think it's getting nearer!

merlinb

Have you tried the old DPDT-as-a-momentary-switch trick? Using a *latching* footswitch, when you press the switch there is a moment where the wiper has not made contact yet, so it is like opening a switch and closing it very quickly. Admittedly, the click is not such a nice 'feeling' on your foot as a soft momentary switch.

paulbuzz

Quote from: ElectricDruid on February 17, 2025, 05:46:07 AMI've been trying stuff like this, but I haven't got it yet:

https://tinyurl.com/27foc5bz

The idea here was the cap would charge through the 10K, then when you close the switch, it discharges through the 100R, turning the transistor on briefly. The 10K on the collector represents the internal pull-up on the tap tempo input.
But it doesn't work because when the switch is closed, the transistor base is connected to Vdd by the 100K. You could use a SPDT to get around that, but it seems like it should be possible with a SPST.
It's basically a very simple monostable we need - you press the trigger, it fires a short pulse, turning a transistor on which shorts the input to ground briefly. The logic won't be inverted exactly, but if the pulse is a fixed length and very short (few msecs) then the problem goes away.

Edit: This might work:

https://tinyurl.com/22ew7omn

Like this, the base voltage is too low to switch the transistor on as soon as the cap discharges, so you get a brief drop in the collector voltage, but only very brief. You then have to wait a little while (50msecs) before the cap recharges and you can tap again.
It probably needs the values juggling, but I think it's getting nearer!


Thanks very much for your reply and work on this!
I think I could have a go at actually implementing this to see if it'll fly.

Couple of questions though:

1) If I'm understanding you correctly, inside the Digitech pedal I would need to identify the point you've marked as the 10K resistor representing the internal pull-up resistor on the tap input, and make a connection to the 'inward' side of it to connect to the new 100K resistor. Have I understood this right? This could be tricky, but I could give it a go!

This has also made me rethink the way I should try to put this into practice:

My original aim was to modify a specific external tap-switch pedal for dedicated use with the Digitech pedal.

But because of the need for an extra connection to the far side of the pullup resistor (if I've got it right!), this idea would be far easier to implement inside the Digitech pedal, at the tap-input socket.

This has made me realise that (obviously!) modifying the tap-input of the Digitech pedal itself so that it works properly with any standard tap-switch would be a much better solution anyway, so I'd like to try to do that. 

2) Due to my ignorance, I would need some guidance as to what kind of transistor is needed here. Would this be a standard NPN BJT like 2N3904 or similar?

paulbuzz

Quote from: merlinb on February 17, 2025, 09:16:15 AMHave you tried the old DPDT-as-a-momentary-switch trick? Using a *latching* footswitch, when you press the switch there is a moment where the wiper has not made contact yet, so it is like opening a switch and closing it very quickly. Admittedly, the click is not such a nice 'feeling' on your foot as a soft momentary switch.


I had not, but have just tried it - didn't work for me.

I guess this would be causing the DPDT to act like a briefly-pulsing normally-closed momentary SPST, whereas what I need is a briefly-pulsing normally-open momentary SPST. So close!

Cunning idea though!  :)

R.G.

Quote from: paulbuzz on February 17, 2025, 11:11:07 AMI had not, but have just tried it - didn't work for me.

I guess this would be causing the DPDT to act like a briefly-pulsing normally-closed momentary SPST, whereas what I need is a briefly-pulsing normally-open momentary SPST. So close!

Cunning idea though!  :)
If this scheme works for what you want, just use the briefly-pulsing normally closed switch to shunt a pullup resistor to ground, and tie the pulled-up point to the gate of an N-channel MOSFET. The MOSFET gate goes up briefly, and this turns on the MOSFET briefly, and the MOSFET drain goes down to the MOSFET source voltage briefly.
Does that fix the issue?
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

paulbuzz

Quote from: R.G. on February 17, 2025, 07:59:52 PM
Quote from: paulbuzz on February 17, 2025, 11:11:07 AMI had not, but have just tried it - didn't work for me.

I guess this would be causing the DPDT to act like a briefly-pulsing normally-closed momentary SPST, whereas what I need is a briefly-pulsing normally-open momentary SPST. So close!

Cunning idea though!  :)
If this scheme works for what you want, just use the briefly-pulsing normally closed switch to shunt a pullup resistor to ground, and tie the pulled-up point to the gate of an N-channel MOSFET. The MOSFET gate goes up briefly, and this turns on the MOSFET briefly, and the MOSFET drain goes down to the MOSFET source voltage briefly.
Does that fix the issue?


Thanks for the suggestion R.G. - definitely sounds potentially promising!

As Merlin points out though, a DPDT switch is much less satisfactory as a tap-tempo switch than a momentary SPST, because of the 'CLUNK CLUNK' factor.

I'm hopeful that I may be able to get Electric Druid's proposed solution using a momentary SPST to work, though identifying the correct pullup point on the Digitech pedal pcb to attach the 100K resistor may be a challenge/stumbling-block. (This is assuming I have even interpreted his proposal correctly!) I'll get in there and see what I can discover!

So this other approach combining Merlin's and your suggestions of using a DPDT and an N-channel MOSFET definitely sounds worth investigating as well. I think I broadly understand the idea, though I'm rather sketchy on the concept of the pullup resistor - will need to do some Googling to figure out where this would go!

Bed is calling now as tomorrow's work looms, but after that I'll try to draw myself a diagram or two to see whether I can follow this scheme well enough for some practical tests.

Any hints on suitable MOSFETS and pullup resistor values?  ;)

As another alternative, I'm also still very interested in your original suggestion of using a CMOS hex inverter and a transistor, but I'm afraid I would need some more detailed guidance to have any chance of getting this together! ;)

Paul

amptramp

Many years ago, Motorola brought out the MC14490, a hex switch debouncer.  It had an internal clock that  clocked the input through a 4-bit serial shift register and didn't change the output until all of the bits in the register were the same.  The problem with this IC was you couldn't initialize it - the output was in an indeterminate state until the bounce period was over.  The clock timing was set by one external capacitor, so you could set any denounce period you wanted.

Other designers have used counters that had "all zero" and "all one" outputs and did the same thing.  If you have a number of identical switches with identical debounce specs, this is an idea that has been used before.

ElectricDruid

Quote from: paulbuzz on February 17, 2025, 10:30:11 AMCouple of questions though:

1) The actual pull-up in the pedal is probably internal to some processor or other, so you can't connect to that specific point. But any 3.3V supply inside the pedal would do, so find some chip you recognize, get the pinout, and find where the 3.3V goes in.

2) Yes, any standard NPN BJT would be fine. 2N3904 or similar is perfect.

What we don't know is what the software does about debouncing. Incidentally, that's one explanation for the "unusual" tap behaviour: My experience is switches bounce a lot less when softy released to "off" than when you firmly stamp them "on". It's very difficult to "unstamp" a switch with the same kind of force you can stamp it with!!
Anyway, debouncing time (if any) might affect the time that the negative pulse needs to be negative. It'll either work or it won't, so it needs to be adjusted until it does.


paulbuzz

Quote from: ElectricDruid on February 18, 2025, 03:57:51 PM1) The actual pull-up in the pedal is probably internal to some processor or other, so you can't connect to that specific point. But any 3.3V supply inside the pedal would do, so find some chip you recognize, get the pinout, and find where the 3.3V goes in.

2) Yes, any standard NPN BJT would be fine. 2N3904 or similar is perfect.

What we don't know is what the software does about debouncing. Incidentally, that's one explanation for the "unusual" tap behaviour: My experience is switches bounce a lot less when softy released to "off" than when you firmly stamp them "on". It's very difficult to "unstamp" a switch with the same kind of force you can stamp it with!!
Anyway, debouncing time (if any) might affect the time that the negative pulse needs to be negative. It'll either work or it won't, so it needs to be adjusted until it does.


Fantastic, thanks! I had started to wonder whether that might be the answer to my question 1, so it's great to have that confirmed.

I had also just about managed to come to the right conclusion about my question 2 after spending some time playing with your suggested circuit in the simulator. It took me a while to realise that the whole thing was dynamic and tweakable on the fly... (doh! slaps forehead!) It looks absolutely perfect in the simulation at least, with various elements adjustable if necessary, as you say.

I will dig in with the soldering iron and breadboard and see what happens. I'm feeling uncharacteristically optimistic about the outcome ;D  Thanks again for your work on this!

paulbuzz

I have now breadboarded the circuit suggested by Druid, and hooked it into the tap tempo circuit of the Digitech pedal.

Frustratingly, after my previous wild optimism, I can't get it to work.

I'm fairly sure my actual implementation is ok, unless I reveal anything foolish below:

 - I found a spot for an extra hookup into the 3.3v supply. As Druid suggested, I used the Vcc pin of an identifiable IC: specifically pin 20 of an 74HC574D octal flip-flop. I assume this is suitable - it certainly has 3.3v on it.

 - All the rest of it is exactly as per Druid's simulation. I hope I'm right in thinking that the new circuit's output to the pedal's existing tap input should be coming from the collector of the 2N3904 transistor, and ground...?

I think the circuit is operating at least vaguely as it should, as far as I can tell:
 
 - With the tap switch open I get 3.3v between the pedal ground and the 2N3904's collector.

 - If I connect my ancient analog meter between these points and press the momentary tap switch, I can see just a tiny flicker of movement in the needle - it twitches downwards and then back up, even if I keep holding the tap switch down. This seems right to me - presumably the needle has too much inertia to keep up with the switching of the voltage by the transistor.

But the tempo of the pedal stubbornly refuses to respond.

I have tried playing with the component values, both in the simulation and in reality - I wondered whether the 'close and open' pulse of the switch was too rapid for the pedal to recognise, so I tried tweaking the values (mainly with a larger capacitor to lengthen the pulse due to the longer recharge time if I drained it by holding the tap switch down)

These tweaks looked in the simulation as though they should behave as I intended, but had no effect on the pedal's lack of response to my wild tapping.

I've learned one or two things about the pedal along the way, but am not sure that any of it is helpful information:

 - the pedal's tap tempo input has a threshold at 1.65v (as I suppose you would expect from the 3.3v control voltage).
 
 - This corresponds to putting a resistance of 10k across the pedal's existing tap input.   

 - If there is a minimum pulse time required for the pedal to identify and respond to the tap pulses, it's quicker than any method of tapping I have tried.

So I'm a bit stumped - any further suggestions, or alternatively recognition that I've screwed up in some very dumb way?  ;D

Paul