Author Topic: China USB Footswitch: IR to Push button  (Read 6131 times)

0 Members and 1 Guest are viewing this topic.

Offline DOCa ColaTopic starter

  • Contributor
  • Posts: 19
  • Country: de
China USB Footswitch: IR to Push button
« on: May 13, 2013, 02:01:18 pm »
Hi!

This is probably a simple question for you guys.
I have bought a real cheap china USB footswitch from ebay. This is to emulate a keyboard key when you press the footswitch. I ordered it with the intent on modifying it to use a more high quality foot switch and just use the board they use. To my suprise however, they are not using some kind of microswitch but an IR sender and receiver to register the press of the footswitch.
The IR transmitter diode is constantly powered. When the footswitch is pressed, the line of sight to the receiver gets obstructed.
Now, i assume it shouldn't be too hard to modify it to just work with a simple push button switch, but what interests me too, is how the current switching is done. I assume this is a very basic circuit. I am obviously not interested on what the chip under the epoxy does. Just the logic on the board.

Photos:
Front:

Back of the board with the diodes:


Obviously red is 5V, black is ground
The other interesting thing to note is, that they seem to also use this board in the 3-switch version of the footswitch. Hence those 2 unpopulated connectors on the board. Interestingly they can also be programmed in their provided software. It is likely that these can also be utilizied.
Footswitch i got: http://www.pcsensor.com/index.php?_a=product&product_id=2
3 pedal switch: http://www.pcsensor.com/index.php?_a=product&product_id=3

Now what would be great if someone could explain how that current IR receiver registers the switching so i can understand how to modify this board for a simple push button switch.
Again, i do not just want to do the modification. I want to understand how the switching with the IR receiver works and if that is good how they have done it. Just out of curiosity. That is why i am asking here in the eevblog and not somewhere else :)
« Last Edit: May 13, 2013, 02:06:49 pm by DOCa Cola »
 

Offline bilko

  • Frequent Contributor
  • **
  • Posts: 405
  • Country: 00
Re: China USB Footswitch: IR to Push button
« Reply #1 on: May 13, 2013, 02:31:56 pm »
Couldn't you have just stripped the guts from a USB mouse and detected mouse clicks instead ?
 

Online mariush

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: ro
  • .
Re: China USB Footswitch: IR to Push button
« Reply #2 on: May 13, 2013, 02:35:55 pm »
Under the blob you have a simple microcontroller with a usb option (to show the thing as a generic input device like a keyboard or whatever) or a basic keyboard chip with usb. 
5v goes through R8 to the led to light it up, and also goes through R2 to the trace that goes back to the microcontroller and the fotosensor.

When the fotosensor no longer sees the light or when the light touches the sensor (i forget now exactly which one is, basically read as "changing state") you basically get a direct connect to ground (see the other pin of the sensor) so the microcontroller/chip no longer sees 5v on that trace and knows the pedal is pushed down or released. 

 

Offline DOCa ColaTopic starter

  • Contributor
  • Posts: 19
  • Country: de
Re: China USB Footswitch: IR to Push button
« Reply #3 on: May 13, 2013, 02:44:09 pm »
Couldn't you have just stripped the guts from a USB mouse and detected mouse clicks instead ?
no, a simple mouse wouldn't have done it. You can program this footpedal to any keyboard key, mouse clicks/movement you like. Without the use of a software driver. It acts as 'real' usb keyboard and mouse. A mouse (of course) only can do mouse clicks :) I wanted to emulate keyboard keys.

5v goes through R8 to the led to light it up, and also goes through R2 to the trace that goes back to the microcontroller and the fotosensor.

When the fotosensor no longer sees the light or when the light touches the sensor (i forget now exactly which one is, basically read as "changing state") you basically get a direct connect to ground (see the other pin of the sensor) so the microcontroller/chip no longer sees 5v on that trace and knows the pedal is pushed down or released.
Ah, thanks. Much simpler than i thought. What is the purpose of that capacitor c9? It seems to be connected between ground and that 5V line that goes to the receiving diode and microcontroller pin.
« Last Edit: May 13, 2013, 02:45:40 pm by DOCa Cola »
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: China USB Footswitch: IR to Push button
« Reply #4 on: May 13, 2013, 02:48:29 pm »
It just looks like an IR LED shining on a photo transistor with the cathode of the LED and photo transistor emitter grounded.

The photo transistor collector is pulled up to +5v via R2. When the light path is blocked the photo transistor collector voltage will rise close to +5v, when the light path is unblocked the photo transistor will turn on pulling the collector close to ground.

The photo transistor could easily be replaced by a mechanical switch. The switch probably needs to open when the foot switch is pressed because the light beam is probably blocked by pressing the foot switch.

The current in the switch will be low (0.5mA) so for long term reliability the switch needs to have appropriate (gold) contacts or a mechanical self cleaning action. If the switch isn't good for low currents upping the current through it to a few mA by reducing the value of R2 might help.
 

Online mariush

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: ro
  • .
Re: China USB Footswitch: IR to Push button
« Reply #5 on: May 13, 2013, 03:37:32 pm »
 What is the purpose of that capacitor c9? It seems to be connected between ground and that 5V line that goes to the receiving diode and microcontroller pin.

I would guess it has a role of smoothing/filtering out the transition between on and off, so that the microcontroller won't send on off on on etc when you're pressing... just like with push buttons
 

Offline DOCa ColaTopic starter

  • Contributor
  • Posts: 19
  • Country: de
Re: China USB Footswitch: IR to Push button
« Reply #6 on: May 13, 2013, 03:52:39 pm »
Now it makes sense.
Thanks a lot for your help!
 

Offline pickle9000

  • Super Contributor
  • ***
  • Posts: 2439
  • Country: ca
Re: China USB Footswitch: IR to Push button
« Reply #7 on: May 13, 2013, 04:45:35 pm »
You may want to check the shape of the panel (shadowboard) blocking the light, if it's L shaped or has a hole in in the the switch logic will be inverse and you will need an Normally Closed switch instead of an Normally Open switch.
 

Offline DOCa ColaTopic starter

  • Contributor
  • Posts: 19
  • Country: de
Re: China USB Footswitch: IR to Push button
« Reply #8 on: May 13, 2013, 05:40:16 pm »
yes. I have put a normally closed switch in place of the receiving diode and it works just as described  :-+
 

Offline DOCa ColaTopic starter

  • Contributor
  • Posts: 19
  • Country: de
Re: China USB Footswitch: IR to Push button
« Reply #9 on: May 20, 2013, 11:37:47 am »
I wonder, what would be required to modify this circuit to work with a normally open switch?
 

Offline DOCa ColaTopic starter

  • Contributor
  • Posts: 19
  • Country: de
Re: China USB Footswitch: IR to Push button
« Reply #10 on: May 21, 2013, 12:53:49 pm »
sorry for bumping this thread.
i guess i could use a relais or photomos, but can anyone think of a simpler way to change the circuit to use a normally open switch?
i could also post some better photos if required.
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: China USB Footswitch: IR to Push button
« Reply #11 on: May 21, 2013, 12:59:57 pm »
sorry for bumping this thread.
i guess i could use a relais or photomos, but can anyone think of a simpler way to change the circuit to use a normally open switch?

Put the photo transistor back in and short out the LED with the switch.
 

Offline kfitch42

  • Frequent Contributor
  • **
  • Posts: 300
  • Country: us
Re: China USB Footswitch: IR to Push button
« Reply #12 on: May 21, 2013, 07:59:06 pm »
If you end up needing a bit more flexibility, this guy seems like it could do what you need:

http://www.frank-zhao.com/usnoobie/

 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: China USB Footswitch: IR to Push button
« Reply #13 on: May 21, 2013, 08:57:59 pm »
I have to ask, Why would you want to replace an optical switch with a mechanical switch that will have contact bounce, not last as long and is unreliable?

C
 
 

Offline DOCa ColaTopic starter

  • Contributor
  • Posts: 19
  • Country: de
Re: China USB Footswitch: IR to Push button
« Reply #14 on: May 21, 2013, 10:18:32 pm »
yes, i have a separate sustain pedal with a 6,3mm jack. Now, I have bought this cheapo china plastic footswitch to use this pedal on my computer via USB.
Actually i can select between normally open and normally closed on that sustain pedal footswitch. I am more asking out of curiosity how that modification could be accomplished.
 

Offline DOCa ColaTopic starter

  • Contributor
  • Posts: 19
  • Country: de
Re: China USB Footswitch: IR to Push button
« Reply #15 on: October 14, 2013, 02:42:22 pm »
So, i want to revisit that topic :)
As suggested i could easily replace that photo transistor with a normally-closed switch. That works wonderful.

I am however still curious if it would be possible to use a normally-open switch to do the triggering.
I guess i could use a normally-closed optocoupler to achieve that. Are there other viable options when facing such a problem?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf