circuit to emulate a double click

KMoffett

Joined Dec 19, 2007
2,918
The currents in that circuit should be too low to affect the supply voltage to the rest of the mouse circuit. What's the value of the transistor's base resistor? Are you absolutely sure that you are not moving the wheel when you press the switch? Can you emulate the switch closure, without pressing the wheel, by shorting the switche's pads on the back side of the PCB.?

Ken
 

Thread Starter

Johnnz

Joined Dec 31, 2008
55
Base transistor value is 10k ohm. Yes, I am certain that wheel is not moving since I can easily remove it completely and then press the microswitch with a small stick. Then when I press that, the page moves up or down one line every other time I press the button.
 

Thread Starter

Johnnz

Joined Dec 31, 2008
55
Well, thanks for your help so far anyway.
If anyone else can shed light on this glitch I would be interested to hear from you.

The only other bit of info I have to share is that the unwanted scrolling behaviour occurs upon the press in of the button (ie when SW1 in the circuit is pressed). No unusual behaviour occurs upon release of this button.

A-ha, I have further info:cool:! I looked at another circuit using CD4011 and saw they were using much higher value of pull-up (although in my case a pull-down is required) resistor and so I thought "I wonder if the strange behaviour of 'ghost scrolling' will occur if I remove the CD4011 from the circuit altogether (so the only action occuring upon pressing SW1 is the implementation of R1 between Vcc and ground, and the charging of the two capacitors (one through R2)). Turns out this behaviour still occurs. Therefore, I deduce that the cause of this issue is not related to the 4011 IC signal outputed via the transistor. So... I will soon try using a much higher value resistor for R1 and see if there is any improvement. Stay tuned for results:p!...
 
Last edited:

Thread Starter

Johnnz

Joined Dec 31, 2008
55
I brought home some different value resistors tonight and found that 1.2M ohm for R1 and R2 stops the unwanted scrolling effect. However, I didn't have any smaller valued electrolytic capacitors to experiment with and the ceramic ones I did try were unsuccessful. In short, I was unable to get the double click output from the circuit. Would you say Ken that a 0.1uF electrolytic would be the ideal value to use (based on change by a factor of ten?). I am also wondering why electrolytics need to be used? (its hard to find them less than 1uF in value)? In fact,to be honest, the function of the capacitors and resistors is a mystery to me besides the resisitors use to pull down-down the logic gate. An explaination would be welcome of R1, R2, as well as the use of the two electrolytics :)
 

KMoffett

Joined Dec 19, 2007
2,918
The concept of the XOR edge detector is that the output is high, if and only, if one of the inputs is high. The truth table:
I1 I2 O
1 L L L
2 H L H
3 H H L
4 L H H
5 L L L

Ignore R1 and C1 for now. With the switch open both inputs are low and the output is low. That gives you line 1 in the truth table. When the switch is closed the upper input goes high immediately, but because R2 slows the charge on C2, the lower input is low for a while. That's line 2 in the truth table. C2 eventually charges to the point that the lower input is high. With both inputs high the output goes low. That's line 3 of the truth table. R2-C2 determines the width of the output pulse. When the switch is opened input 1 immediately goes low, but input 2 is held high until for a while. The output goes high. That gives you line 4 in the truth table. C2 eventually discharges, so input 2 is low and the output goes low. That gives you line 5 in the truth table.

R1-C1 is meant to de-bounce the input. Switches often bounce open and closed one or more times when they are closed. This would cause one or more high-low pulses on the upper input while the lower input was still low. You would then have output pulses for each of the bounces. Closing the switch immediately charges C1, but during the bounce open" R1 will only let the C1 slowly discharge, so input 1 doesn't see a low.

This is all a matter if selection RC time constants that will provide the proper timing.

As for electrolytic capacitors, that is not a requirement. They're usually used when you need cheap, high capacitance capacitors in low frequency circuits. For this circuit 0.1uF of any type would work fine.

Ken
 

Thread Starter

Johnnz

Joined Dec 31, 2008
55
Thanks for that, I just put a couple of 0.1uf Ceramic caps in (with the two 1.2M ohm resistors) and things are working again. However, the ghost scrolling is still occuring. Albeit noticably less often. How far can I push things with changing values of resistor and capacitor? Although I have now changed by a factor of ten, the unwanted scrolling behaviour has not changed as much (perhaps it has halved in frequency). If I change things by a factor of ten again (10M resistors with 0.01uF caps) would you expect the circuit to function properly still?
 

KMoffett

Joined Dec 19, 2007
2,918
I'm still puzzled. I wonder if the roller switch and the roller's rotation detection circuit are not totally independent. Have you tried to see if anyone has hacked one of these and drawn up a schematic?

Ken
 

CDRIVE

Joined Jul 1, 2008
2,219
I'm still puzzled. I wonder if the roller switch and the roller's rotation detection circuit are not totally independent. Have you tried to see if anyone has hacked one of these and drawn up a schematic?

Ken
Yes, it would appear that most functions in a mouse are apparently not totally independent. IE, there is no separate output lines for each function. The mouse sends binary packets defining which function is currently in use. I found quite a bit of info by Googling "PS2 Pin out"
http://www.allpinouts.org/index.php/Mouse/Keyboard_(PS/2)
 
Last edited:

CDRIVE

Joined Jul 1, 2008
2,219
Would a software interface like this suffice for you? I can design it to respond to a single click. Of course, the titles in the list will be of your own liking. ;)
 

Attachments

Thread Starter

Johnnz

Joined Dec 31, 2008
55
Thanks for the offer, but I am quite happy now with Foobar2000 auto-run from an Autohotkey script which blocks superfluous title bars etc. (I'm trying to get the feel of my audio player as removed as possible from that of using a normal computer - hence the desire to use single click to select songs). Here's a pic of what my screen looks like except I have now removed the upper tabs too, since they are only stating the obvious;).

 

Thread Starter

Johnnz

Joined Dec 31, 2008
55
I have gotten hold of another mouse which has a rotary encoder for the scroll wheel instead of the IR sensor that the microsoft mouse has. Apparently, others who have hacked scroll wheels have found it far easier to use rotary encoders so that will be an advantage anyway. I will connect the auxillary "double click" circuit to the new mouse tomorrow and see if the problem disappears with the ghost scrolling.
 

Thread Starter

Johnnz

Joined Dec 31, 2008
55
Thanks for that. Yep, thats exactly the same board and IC as what I've got here. Still, I can't figure out what could cause the ghost scrolling. But I'll shortly be having a go wiring up my alternative mouse which uses a different chip (which requires shorting to Vcc to activate mouse clicks).
Datasheet here for new mouse: http://datasheet.digchip.com/485/485-265-0-TP8472.pdf
 

Thread Starter

Johnnz

Joined Dec 31, 2008
55
Just wired up the new mouse and that annoying ghost scrolling problem is completely gone now. I did however notice a slight oversight in my intended interface with my music library - Since I was planning to have the mouse pointer stationary in the middle of the screen and a large scroll wheel to scroll with and press-in action to select the song (activating the "double click" circuit), I just realized that, of course, the very top and bottom few songs (all alphabetically arranged by artist) will not be able to scroll underneath the pointer:rolleyes:

Guess I could make some gap fillers/blank files to go under AAA and ZZZ titles to solve this...
 

Thread Starter

Johnnz

Joined Dec 31, 2008
55
Have just finished the scroll wheel/selector knob/page up/down dial.
Having been away from this project for a while, I forgot I had connected up to a new mouse that uses a positive input to the mouse IC to execute a click. I still had the NPN transistor in position and wired up the circuit to the original set up and had no auto double click until I remembered to work straight off the (high) IC output!

That ought to teach me not to forget to leave myself notes for future reference again...
 

Attachments

Top