Author Topic: Rapidly connect and disconnect a signal?  (Read 4267 times)

0 Members and 1 Guest are viewing this topic.

Offline iamdarkyoshiTopic starter

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: us
Rapidly connect and disconnect a signal?
« on: August 22, 2015, 12:49:00 am »
Quite a long time ago I had a USB mouse that I had fitted a DPST switch on the ground for the left and right buttons, and the DPST switch switched the switch's ground between PCB ground and the output of a 555 timer (YAY 555 timer!) This made it so when I pressed the added switch, the left and right click would become an autofire. Attached is a very crude schematic:


 I now have a much less obsolete mouse and unfortunately, the buttons are grouped together with resistors and have one wire going to the chip. This means I cannot oscilate between ground and 5V on the switch ground to make them autofire, I now have connect and disconnect the singular wire from the chip. How can I do this using the smallest part count? Can I use an op amp somehow? All I really need to do is take the analog signal from the buttons and disconnect and reconnect at about 25hz.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9954
  • Country: nz
Re: Rapidly connect and disconnect a signal?
« Reply #1 on: August 22, 2015, 12:54:47 am »
Use a optoisolator to close the button contacts.
The 555 then drives the opto led.
This way other parts of the circuit are irrelevant since its isolated

You do have to get the opto transistor around the correct way thought, for the current flowing from the mcu through the button.
Unless you use a solid state relay
« Last Edit: August 22, 2015, 12:57:26 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline iamdarkyoshiTopic starter

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: us
Re: Rapidly connect and disconnect a signal?
« Reply #2 on: August 22, 2015, 12:57:19 am »
Use a optoisolator to close the button contacts.
The 555 then drives the opto led.
This way other parts of the circuit are irrelevant since its isolated


Thats a good idea! Do optoisolators have a voltage drop on the optical sensor side?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9954
  • Country: nz
Re: Rapidly connect and disconnect a signal?
« Reply #3 on: August 22, 2015, 01:00:59 am »
The optical sensor side is literally an IR led
Usually the forward voltage drop is 1.1v and the max current is 80ma or so.
Should work fine with a typical 30ma flowing
So for 5v you need to get rid of 3.9v @30ma so try a 220ohm resister

555 can handle more current if needed to pull the opto on harder, but the current flowing through the mouse buttons is probably very tiny

If it's a wireless mouse you'll want to minimise current draw
If it's corded it doesn't matter
« Last Edit: August 22, 2015, 01:03:37 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Rapidly connect and disconnect a signal?
« Reply #4 on: August 22, 2015, 01:29:58 am »
The optical sensor side is literally an IR led

You mean the transmitter? The sensor side can be a phototransistor, a darlington phototransistor pair, sometime just a photodiode, but not a LED. OP, the datasheet for the particular optoisolate that you get will tell you which of these it is, feel free to share that datasheet here.

Usually the forward voltage drop is 1.1v and the max current is 80ma or so.
Should work fine with a typical 30ma flowing
So for 5v you need to get rid of 3.9v @30ma so try a 220ohm resister

555 can handle more current if needed to pull the opto on harder, but the current flowing through the mouse buttons is probably very tiny

If it's a wireless mouse you'll want to minimise current draw
If it's corded it doesn't matter

A phototransistor will allow current to flow on the output/detector side in proportion to the amount of current flowing on the input/LED side. So, for an example optoisolator with a CTR (current transfer ratio) of 20%, if you put 30mA through the LED, 6mA will be allowed to flow through the output side. As indicated above, you might only need to pull 1mA or less to bring the button voltage down, in which case you'd be fine with 5mA on the LED. Point is, you may well get away with putting less current through the LED (you can just experiment to find out). If battery consumption is a concern, you may wish to look into darlington optoisolators, they require even less input current (due to a CTR of 350% or more).
 

Offline iamdarkyoshiTopic starter

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: us
Re: Rapidly connect and disconnect a signal?
« Reply #5 on: August 22, 2015, 01:59:10 am »
Thanks for all of the replies! I have a corded mouse (I hate wireless) so power is not a concern. I have no clue where any electronics stores are here (RIP Radioshack) so I will likely find one in an old PC power supply. I will try to post updates here if I have any. I do have images of the PCB if anyone is interested. Also, why are the jumpers on this PCB 0 ohm resistors? It seems to me like a piece of wire would be cheaper.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Rapidly connect and disconnect a signal?
« Reply #6 on: August 22, 2015, 04:10:03 am »
Thanks for all of the replies! I have a corded mouse (I hate wireless) so power is not a concern.
I'd still make a point of not burning up 10 times more than I need to, but that's just me.

I have no clue where any electronics stores are here (RIP Radioshack) so I will likely find one in an old PC power supply.
Ebay?

I will try to post updates here if I have any. I do have images of the PCB if anyone is interested. Also, why are the jumpers on this PCB 0 ohm resistors? It seems to me like a piece of wire would be cheaper.

I'm not sure what the setup is at the factory, but if you've already got the tooling available to dress (i.e., bend the leads at the right place) and insert axial resistors, and those machines like having a body to hold on to, you're going to save money overall by just buying 0 ohm resistors (which are just a piece of wire, by the way).
 

Offline iamdarkyoshiTopic starter

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: us
Re: Rapidly connect and disconnect a signal?
« Reply #7 on: August 22, 2015, 04:32:31 am »
Thanks for all of the replies! I have a corded mouse (I hate wireless) so power is not a concern.
I'd still make a point of not burning up 10 times more than I need to, but that's just me.

I have no clue where any electronics stores are here (RIP Radioshack) so I will likely find one in an old PC power supply.
Ebay?

I will try to post updates here if I have any. I do have images of the PCB if anyone is interested. Also, why are the jumpers on this PCB 0 ohm resistors? It seems to me like a piece of wire would be cheaper.

I'm not sure what the setup is at the factory, but if you've already got the tooling available to dress (i.e., bend the leads at the right place) and insert axial resistors, and those machines like having a body to hold on to, you're going to save money overall by just buying 0 ohm resistors (which are just a piece of wire, by the way).

I know I can get them from ebay or mouser, but ordering is difficult for me. See, my parents have control of the ~$5K in my bank. This money is not linked to paypal or a credit card or anything. If I want to make a purchase, I need to get them to transfer money, ect and it is just a huge hassle whereas just taking some cash with me and driving a couple miles is easy as pie.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16284
  • Country: za
Re: Rapidly connect and disconnect a signal?
« Reply #8 on: August 22, 2015, 01:01:45 pm »
Old PC power supply will have the optocoupler in a 4 pin DIP package on it, and it will work there. Will also have the resistors as well to set the current somewhere on the board, around 1k will do, exact value is not too critical, anything from 680R to 3k3 will do in most cases with the average optocoupler in this case.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf