Author Topic: Recognize Tap and Tap-Hold With Discrete Components To Control A Relay  (Read 689 times)

0 Members and 1 Guest are viewing this topic.

Offline avih7531Topic starter

  • Newbie
  • Posts: 4
  • Country: us
Hi all,

I want to mod a guitar pedal to have both regular bypass but also momentary bypass by pressing and holding on the footswitch

I'd like to have SOMETHING control a relay and recognize the two types of input - tap and tap-hold.

I know how to do this on an ATTINY, but that's annoying. Any ideas on how to do this with discrete components? I have a hunch it'll involve charging a capacitor etc. but I don't know how to do all of that! I think a tap can be under 300ms and a tap/hold would be anything longer than that, and while it's help, the effect would stay on. I think it's also important to keep debouncing in mind...maybe?  :icon_neutral:

At the end of the day, I don't need help with the realy implementation, just a 9v source that can be controlled by these two methods of input.

Thanks!
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3036
  • Country: us
I'm not familiar with how guitar pedals work or are used -- can you fill in some specifics?

For instance, does the relay have state? I.e. short press -> relay is latched on; another short press -> relay is latched off.

If the relay has state does the long press simply momentarily toggle the state while the pedal is pressed?

I.e. long press when relay is latched on -> relay is turned off for the duration of the press and then resumes being latched on?
 

Offline avih7531Topic starter

  • Newbie
  • Posts: 4
  • Country: us
Ah yes, good point.

Essentially the footswitched is pressed the pedal will turn on which means the relay will turn on.

Like I mentioned before, I want the pedal to have two modes - on/off and tap-hold.

If there is a short tap, the relay will turn on until another short tap is performed
If there is a hold, the realy will turn on as long as the switch is depressed at which point the relay will turn off
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4530
  • Country: au
    • send complaints here
People use tiny little micros for things like this for good reasons:
easier/quicker/cheaper to design
usually cheaper to build!

So why not use a micro?
I know how to do this on an ATTINY, but that's annoying.
Annoying compared to something you have no idea how to do, so can not actually compare to?
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3036
  • Country: us
If there is a hold, the realy will turn on as long as the switch is depressed at which point the relay will turn off

What if the relay is already on and there is a long press?
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3717
  • Country: us
You can distinguish between short and long press by having a RC time constant and a comparator.  Make sure to add hysteresis to the comparator for noise immunity.  You probably want a diode to give fast discharge when the pedal is released.  Then you can implement whatever you want with discrete logic using both the fast and slow inputs.

A tiny micro will be easier and cheaper, but possibly less fun depending on your interests.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3036
  • Country: us
Here's something that will behave as follows:

- a short press will toggle the output once
- a long press will toggle the output for the duration of the press

Not shown in the debouncing circuitry for the switch signal SW.
« Last Edit: May 20, 2022, 10:26:27 pm by ledtester »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf