Every time I wanted to go to sleep, I would put some music on my desktop PC and tune the volume to a convenient level. After lying in bed, somehow environmental noise seems to faint and all of a sudden the music is too loud to sleep. So I used to get up, lower the volume and go to bed again. Until I decided to take action.

I was, at the time, studying IR communication protocols hence I decided to build an IR system to control the volume of my PC remotely. The idea is simple. A remote control will send IR signals to an arduino equipped with an IR receiver, the arduino will interpret the signals and send, via serial communication, specific instructions to a PC application which will, in turn, do the respective action. It’s worth mentioning that after implementing this initial functionality, it was pretty easy to add more capabilities to the system even ones not related to any PC actions.

Features

  • Supported actions (PC-related):
    • toggle monitor on/off
    • system volume up
    • system volume down
    • mute
    • hibernate
  • Supported actions (non PC-related):
    • embedded light toggle on/off

Technical Notes

The circuit

An arduino nano was used as a microcontroller since it has built-in serial to usb capability. The hardware components connected to it are a VS1838B IR receiving module, a buzzer for audible feedback (more on that later), a N.O. momentary switch and a led.

IRM schematic

The software for the micro was written in C and it uses Ken Shirriff’s IRremote library which provides an easy way for recognizing IR signals. The specific remote control used, follows the NEC IR protocol, supports holding down a button (e.g. for changing the volume) and provides audible feedback for receiving unsupported IR signals.

Every time it has to forward a specific command to PC, it prints to its serial output a specific string:

String to be sent Action to be triggered
__CMD_MONOFF turn monitor on/off
__CMD_HBRN hibernate
__CMD_VOLINC increase volume
__CMD_VOLDEC decrease volume
__CMD_MUTE mute

PC Client

The PC client is written in Java (obviously not the wisest choice for native calls… ) and its task is pretty much straightforward. Connect to a serial port, listen for incoming messages and interpret them accordingly. For serial ports’ access, rxtx library was initially utilized but it was subsequently replaced with JSSC library, which seemed much more stable and easier to use. As for the necessary native calls, like changing system volume, turning monitor on/off etc, the easiest (but not so elegant) solution was given by an excellent little program called nircmd which allows you to do some useful tasks without displaying any user interface just by running it with simple command-line options.

Besides this core functionality, the PC client also has some convenience features:

  • Graphical user interface
  • COM ports scan feature
  • minimize to system tray support
  • support for automatically connecting to a specific COM port and starting minimized (convenient when declared to run at windows startup)

schematic as eagleCAD sch file

arduino source

PC java client source

A windows tool offering efficient move-to-other-monitor functionality for dual monitor users.

As a multi-monitor configuration user for at least the last decade, I ‘ve been using mutli-monitor utilities and more specifically UltraMon for taking advantage of the overall productivity enhancement a dual monitor configuration can offer. This utility provides some very useful features like a much more functional task bar behavior, easy background setup, common tasks’ shortcuts etc.

UltraMon was since windows 2000 in my list of the programs I would install immediately after a clean installation of windows but as time was passing, windows were integrating more and more of “multi-monitor functionality” to the point that after the release of Windows 10, I came to realize that the only remaining, essential for me, UltraMon feature that windows have still not built-in is the move-to-other-monitor button, a little button added on every window that allows the user to perform this very common task with a single mouse click.

I wondered how I could get similar functionality in a different way and do away with the installation of the whole UltraMon utility, mainly because of some compatibility issues it had at the moment with Windows 10.

After little googling, I found out about windows’ keyboard shortcut for the exact task I was looking for:

Windows Key + Shift + Left/Right Arrow

shortcut moves focused window to the other monitor which means that the core of the sought functionality is already implemented in windows, therefore it is much easier to just map this key combination to a mouse-only action using Autohotkey. Double clicking of middle mouse button was chosen as it is generally not used in any way plus we get for free the “works even for not in focus windows” as the first click sets the focus on the desired window.

source file

32bit binary

64bit binary