Mouse Emulator using Arduino

Forum for discussion about the Langstone Microwave Transceiver that shares some features with the Portsdown. Wiki: https://wiki.microwavers.org.uk/Langstone_Project
g4eml
Posts: 673
Joined: Thu Apr 26, 2018 9:36 am

Mouse Emulator using Arduino

Post by g4eml » Sat Oct 24, 2020 4:22 pm

Instead of modifying an existing USB mouse for tuning the Langstone it is also possible to program an Arduino Pro Micro board to emulate a mouse.
One of the advantages of doing this is that it enables a higher quality rotary optical encoder to be used. These usually have a much higher number of pulses per revolution than the lower cost mechanical encoders. They also do not have the click detents and so can enable smoother tuning and a real tuning knob feel.

The higher number of pulses per revolution can be a problem when trying to use existing mouse boards. Either the tuning rate is too high or the mouse board limits the maximum rate. Both are not ideal.

I have just published a working design for an Arduino pro micro on github at https://github.com/g4eml/Langstone-Mouse

This design has been optimised for the Langstone and can be configured to use high resolution encoders. The USB output is scaled to a suitable value for the Langstone code to handle. The Arduino .ino file is very simple and makes use of the standard arduino mouse and encoder libraries.

Hardware required is an Arduino Pro Micro board, a suitable encoder, and two push switches.

The Arduino Pro Micro board is available from Ebay at around £6 (must have the ATmega32U4 processor 5V 16MHz version)
Optical rotary encoders are available from around £10. The one I used is 400 pulses per revolution but this high is not really required.

Colin G4EML

G4FKK
Posts: 135
Joined: Sun May 05, 2019 12:15 pm

Re: Mouse Emulator using Arduino

Post by G4FKK » Sat Oct 24, 2020 4:34 pm

Hi Colin,

I've used pretty much the same hardware for my Arduino mouse impersonator. I added a feature whereby I can make the Langstone step in 12.5kHz steps - useful when bored and using FM on the lower bands :geek: You can also use the Arduino with a Nextion display to show voltages, control relays etc. etc.

73, Martin - G4FKK

G4FKK
Posts: 135
Joined: Sun May 05, 2019 12:15 pm

Re: Mouse Emulator using Arduino

Post by G4FKK » Sat Oct 24, 2020 4:36 pm

Oh, and I was thinking of making the Arduino generate CTCSS and also, perhaps, do the beaconing functions that Radiogareth suggested in another thread. I thought I'd hang on in case you did it on the Pi though ;)

g4eml
Posts: 673
Joined: Thu Apr 26, 2018 9:36 am

Re: Mouse Emulator using Arduino

Post by g4eml » Sat Oct 24, 2020 5:24 pm

Hi Martin,

I have used the Arduino before for mouse emulation but forgot how easy it was to do. The need this time came about because I wanted to use the nice optical encoder I have. I needed a way to divide down the number of steps. The existing mouse board couldn't handle it.

CTCSS and CW beacon are things that might get added. It would be easy enough to do both. I just need time to get around to implementing them!.

CTCSS has always been low on the priority list because the primary reason for the Langstone was always to encourage use of the microwave bands. There are plenty of other radios out there for use on repeaters.

Colin

G4FKK
Posts: 135
Joined: Sun May 05, 2019 12:15 pm

Re: Mouse Emulator using Arduino

Post by G4FKK » Sun Oct 25, 2020 12:04 am

I admire your position on scope creep Colin. I'm afraid I suffer from "Ooo, I Could Make It Do This Too" syndrome whenever I programme anything :|

g4eml
Posts: 673
Joined: Thu Apr 26, 2018 9:36 am

Re: Mouse Emulator using Arduino

Post by g4eml » Sun Oct 25, 2020 5:08 pm

As the new Arduino mouse emulator allows high resolution rotary encoders without detents and potentially flywheel action tuning knobs I have added a Dial Lock function to prevent inadvertent frequency changes.

This makes use of the previously unused middle button on the mouse.

Pressing the middle button will lock and unlock the dial.

LOCK will be displayed in red above the frequency display.

Touching any of the frequency digits will also remove the lock.

Dial lock only affects the tuning. Adjusting settings is still possible.

Colin G4EML

G4FKK
Posts: 135
Joined: Sun May 05, 2019 12:15 pm

Re: Mouse Emulator using Arduino

Post by G4FKK » Mon Oct 26, 2020 1:33 pm

Hi Colin,

I've updated my own Arduino code and Langstone and I'm happy to report that the lock function works as described.

I don't think it's related to this update as I've seen it before but I noticed that, while SSH'd into the Langstone, doing the update and then running Langstone/run works ok until I stop PuTTY, at which point Langstone seems to freeze. After touching the screen a couple of times it switches to Portsdown. It's not a problem as I can then reboot from Portsdown and everything then appears normal. I wonder if anyone else has noticed this or is it just (yet another), FKK anomaly?

73, Martin - G4FKK

g4eml
Posts: 673
Joined: Thu Apr 26, 2018 9:36 am

Re: Mouse Emulator using Arduino

Post by g4eml » Mon Oct 26, 2020 8:32 pm

Hello Martin,

That’s the normal default behaviour for Linux. When you start a program it only continues to run while you are logged in. When you disconnect any programs you started are terminated.

Colin.

G4FKK
Posts: 135
Joined: Sun May 05, 2019 12:15 pm

Re: Mouse Emulator using Arduino

Post by G4FKK » Mon Oct 26, 2020 11:06 pm

Thanks Colin,

Forgive my ignorance; Linux is even more of a black art to me than GNU Radio :?

73, Martin - G4FKK

w0iy
Posts: 27
Joined: Sat Jul 04, 2020 2:38 am

Re: Mouse Emulator using Arduino

Post by w0iy » Wed Oct 28, 2020 4:26 am

As an alternative, I think you could have an optical mouse, with little modification, look at a large washer on a shaft. Turn the shaft and the optical detector sees the rotation. Depending on sensor orientation it will look like x or y movement.

There would be no detent but would be smoother tuning like a VFO.

This would require having to change the code to follow x,y rather than the scroll wheel. This is quite a ways down my list of things to do.

w0iy

Post Reply

Return to “The Langstone Microwave Transceiver”