0
\$\begingroup\$

I have an old mouse side switch which seems to produce a constant 3.28 volts which acts as the off state. Then when I push the button the voltage drops to 0. What is the easiest way to inverse these actions? I am wanting to apply 3.28 volts in order for the button state to be perceived as on but I am not sure how that could be done.

This is needed because I am running a program that takes in a mouse button as the action so instead of clicking the button I need to be able to apply a voltage across the pins in order to simulate a click. I could use a different device instead of a mouse to do this but I am trying to complete my project without buying anything new.

\$\endgroup\$
6
  • \$\begingroup\$ You could use a 3.3V powered NOT gate. However, wouldn't a mechanical rework to replace the switch from normally-open to normally-closed (or the other way around) be easier? \$\endgroup\$
    – nanofarad
    Dec 29, 2021 at 19:51
  • \$\begingroup\$ yes you are correct however I am using the switch while its still attached to the mouse. The reason is I am trying to reconfigure that button so that I can "click" it unconventionally while still having my program I made recognize it has a native mouse click. This just seems like the easiest way of doing it without buying a whole bunch of new stuff for a rather simple project. \$\endgroup\$
    – UnSure
    Dec 29, 2021 at 20:06
  • \$\begingroup\$ You should edit that information into your question along with details of the operating system (Windows?). \$\endgroup\$
    – Transistor
    Dec 29, 2021 at 20:24
  • \$\begingroup\$ what does this mean? ... "click" it unconventionally \$\endgroup\$
    – jsotola
    Dec 29, 2021 at 20:27
  • 1
    \$\begingroup\$ You can add a second mouse (assuming USB) and parallel whatever switch inside that with circuitry (dependent on the schematic, but could include a MOS SSR, a relay or maybe just a transistor (the latter requiring more knowledge of the internals etc.) \$\endgroup\$ Dec 29, 2021 at 21:04

2 Answers 2

0
\$\begingroup\$

... I am wanting to apply 3.28 volts in order for the button state to be perceived as on ...

It means I want to wire the button up to something so that when a voltage is applied the computer will think I was pressing that button. So really I am not clicking it but I am simulating a click by applying voltage.

Applying a voltage is not the way to do it. The switch is "ACTIVE LOW". You want to apply a short-circuit to pull the line low in the same way the switch does to simulate a button press.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Two options.

If your control circuit shares a common ground with the mouse and computer then you can use the circuit of Figure 1a. When the μC (microcontroller) output goes high Q1 will switch on and pull the OUT line low in the same way the button does.

If your control circuit cannot share a common ground then the opto-isolator circuit shown in Figure 1b does the same job while maintaining isolation between the two circuits.

\$\endgroup\$
0
\$\begingroup\$

First off, switches don't produce voltage, what you are most likely seeing is that you are measuring a voltage potential across the switch. The switch is in an 'open' state, and that voltage would be there whether the switch was there or not.

When you press the button, you are closing the switch and grounding the two points across it, thus the voltage goes to zero.

The safest thing to do, to avoid destroying your mouse, is to wire these two points to the N.O. contacts of a relay. If you use a relay board made for a microcontroller such as an arduino or raspberry pi, then you can control the state of the relay programatically.

\$\endgroup\$
2
  • \$\begingroup\$ I am know how voltage works I am just assuming everyone else does as well which is why I did not feel the need to over explain. Anyways do you know of any switches which I can attach to my current switch to bypass it? Since grounding it seems to signal to the mouse that a switch is being pressed I need a switch which I can use to apply an external voltage across a set of pins in order to create a short circuit. \$\endgroup\$
    – UnSure
    Jan 2 at 7:16
  • \$\begingroup\$ No, you don't understand how voltage works, if you did you, you wouldn't be asking to apply an external voltage across your switch. "Transistor" and I have both given you solutions to how to achieve what you want. Neither of which involve applying a voltage across your switch, which most likely would result in destroying your mouse. \$\endgroup\$
    – Glen Yates
    Jan 3 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.