USB port power switching

Ok so I have an idea for my HTPC. I know I can simply go out and buy a controlled USB hub that uses a program that controls the power going to each USB port, essentially turning the USB port off. However, I like to tinker, solder, build and dabble into light scripting. I also know that Arduino coding is kind of like scripting but quite honestly, I do not have the time to dedicate to learning how to code from scratch. So I'm looking to commission someone to write some code according to a project I found online How to Create a Programmatically Switchable USB Hub | TestDevLab Blog
I plan to use this in project conjunction with AutoHotKey while launching games through LaunchBox.

I have a multitude of wireless retro controllers and I want to keep the dongles/receivers plugged in at all times but I do not want my PC to recognize them being plugged in unless I launch a game. If I leave them all plugged in, it messes with controller configurations as the USB id changes. So, to test out my concept, I bought a USB hub with toggle switches on them and that works, however my HTPC is meant to be completely noob and user friendly, so having someone that's never used my computer before they to start a game and use it's corresponding controller and not know they have to turn on a USB port, just isn't going to work. I need to control them programmatically.

A bit more info on how it's supposed to work:

So, say I want to play Super Mario World, I will use LaunchBox to select and launch the game and it will use AutoHotKey to launch the game. With this project implemented into my HTPC, AutoHotKey would send a command that the Arduino is listening for and turn on the required USB port, and then when I'm through playing the game, it will switch off the port upon exit, listening for another command sent by AutoHotKey (after pressing escape).

All USB ports will be turned off at any given time unless a game is launched that requires a specific port to be turned on. Once I have a base code, I can use that to learn more and add additional USB hubs to control later (I plan to control approx 20 ports). It's not necessary right now to have all of those controllable, I just need a base that will communicate with my PC.

More info:

I found an AHK library that interfaces with Arduino boards, so that's not something that I need anybody's help with, I just need the Arduino to be able to receive commands (I believe) via com ports. I'm not sure how this actually works but I know that the Arduino needs to know what is being told to do so a base set of commands needs to be established. I have no idea how to do any of this, so if anybody is willing to take this job, pm me and let's chat as I'm sure I need to clarify more information on my desired results or whatever.

A link to AHK Arduino lib you intend to use would be great.

1 Like

Hi, I apologize for taking so long to get back, time is a luxury I don't get much joy in having lol. So here's the library, (I found the original link in the Arduino forums)
AHK link:
https://www.autohotkey.com/board/topic/64696-some-code-arduinoahk-beta-01/://www.autohotkey.com/board/topic/64696-some-code-arduinoahk-beta-01/?&st=0

Original Arduino link:

Again, I am sorry for the delayed response. My children's mother passed away after getting struck by a car. THings have been very hard on us. I didn't want to leave you hanging or thinking I abandoned this thread. Just life takes precedence over hobbies. I will not be able to focus on my hobbies as much now as I am a full-time father and full-time carer for my father but I will try to check in as often as possible. I hope you understand and appreciate any help you may provide.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.