Rapidly connect and disconnect a signal? - Page 1
Forum section: electronics / beginners

author: iamdarkyoshi
author_rank: Frequent Contributor
timestamp: August 22, 2015, 12:49:00 am
content: 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.

author: Psi
author_rank: Super Contributor
timestamp: August 22, 2015, 12:54:47 am
content: 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 isolatedYou 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

author: iamdarkyoshi
author_rank: Frequent Contributor
timestamp: August 22, 2015, 12:57:19 am
content: Quote from: Psi on August 22, 2015, 12:54:47 amThats a good idea! Do optoisolators have a voltage drop on the optical sensor side?

author: Psi
author_rank: Super Contributor
timestamp: August 22, 2015, 01:00:59 am
content: The optical sensor side is literally an IR ledUsually the forward voltage drop is 1.1v and the max current is 80ma or so.Should work fine with a typical 30ma flowingSo for 5v you need to get rid of 3.9v @30ma so try a 220ohm resister555 can handle more current if needed to pull the opto on harder, but the current flowing through the mouse buttons is probably very tinyIf it's a wireless mouse you'll want to minimise current drawIf it's corded it doesn't matter

author: rs20
author_rank: Super Contributor
timestamp: August 22, 2015, 01:29:58 am
content: Quote from: Psi on August 22, 2015, 01:00:59 amYou 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.Quote from: Psi on August 22, 2015, 01:00:59 amA 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).

author: iamdarkyoshi
author_rank: Frequent Contributor
timestamp: August 22, 2015, 01:59:10 am
content: 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.

author: rs20
author_rank: Super Contributor
timestamp: August 22, 2015, 04:10:03 am
content: Quote from: iamdarkyoshi on August 22, 2015, 01:59:10 amI'd still make a point of not burning up 10 times more than I need to, but that's just me.Quote from: iamdarkyoshi on August 22, 2015, 01:59:10 amEbay?Quote from: iamdarkyoshi on August 22, 2015, 01:59:10 amI'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 (whicharejust a piece of wire, by the way).

author: iamdarkyoshi
author_rank: Frequent Contributor
timestamp: August 22, 2015, 04:32:31 am
content: Quote from: rs20 on August 22, 2015, 04:10:03 amI 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.

author: SeanB
author_rank: Super Contributor
timestamp: August 22, 2015, 01:01:45 pm
content: 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.