Gamer Rehabilitator

by SWels in Circuits > Arduino

87 Views, 0 Favorites, 0 Comments

Gamer Rehabilitator

IMG_4486.JPG

Do you or a loved one frequently scream at their computers out of rage? Are those competitive nights getting just a little too heated? Then this might just be the solution you've been praying for. Using a shock collar, this device aims to apply Pavlovian classical conditioning to reduce 'gamer rage'. When a voice chat key is held and the microphone volume rises above a set threshold, the paired shock collar will deliver negative reinforcement as configured.

Of course, this is a joke premise for a joke project, but the end result is fully functional. Please take extreme care not to hurt anyone who doesn't agree to it. I mostly just wanted to mess around with RF and Serial transmissions, and ended up here.

Supplies

IMG_4468.JPG
IMG_4488.JPG
image_123923953(1).JPG

The materials I used are as follows:

  • 1x U-Do-It-Uino
  • 1x Petrainer 998DRB-1 300M Remote Shock Collar
  • 1x 433MHz RF transmitter module
  • ~25 cm solid core wire
  • Hot glue
  • 3D-printed shell

Note: The U-Do-It-Uino is an Uno clone with some very convenient extra connection points. You can substitute any other Uno clone, but you'll probably need a separate plate to connect the transmitter, and might not fit the shell.

The type of collar used is specific! Trying to use any slightly different model will probably result in the code not working.

The necessary programs and 3D print model can be found here: https://github.com/Svenpai304/GamerRehabilitator

Testing

IMG_4475.JPG
IMG_4476.JPG

Before I could get the transmitter module, I could already start testing the Arduino code with an LED.

As soon as I received all the necessary parts to start testing the RF transmission, I went to work. The collar and receiver, which I got off Marktplaats, seemed to be working after charging, and so I tried to pair it up with my Arduino transmitter. Thankfully, the type of collar I was using had already had Arduino programs written for it. It didn't immediately work, but after changing up the transmission protocol to a different version I finally got the collar to activate up close to the receiver anytime the Arduino got a Serial input. The additional vibration mode of the collar meant I mercifully didn't have to shock myself with every test, though I did have to make sure it still worked a few times unfortunately.

Software

Capture.PNG
Capture.PNG

With the transmitter transmitting and the receiver receiving, it was time to write a desktop application to control the Arduino. I decided to make a small Windows Forms app, something I hadn't touched before, but it was a surprisingly smooth experience. What I needed was a way to register a key being held and a way to measure the microphone volume.

While I had no idea how to approach these issues originally, programming is a group effort, and much of the preliminary work was already done. First, I tried to use a global hotkey to register the key press, and kept to this method for much of my testing, but I eventually switched over to a low-level keyboard hook to register all key presses and releases. This properly let me keep track of when the key was and wasn't pressed. To keep track of the microphone, I used the NAudio library, which lets me keep track of every update to the microphone's value.

Now that the input was working, I could expand the command sent to the Arduino. I ended up using a single byte, with the most significant bit setting the mode of the collar between vibration and shock, and the other seven setting the power between 1-100. I did expand the existing Arduino code a bit more to decode this, after it took a remarkable amount of time on both sides of the program to get the Arduino to interpret the received data correctly.

The commented source code is also available on the GitHub page for further information.

Hardware

IMG_4469.JPG
image.jpg
IMG_4465.JPG
IMG_4472.JPG
IMG_4473.JPG
IMG_4474.JPG
unnamed.jpg

Now that everything was working as I wanted, I could move on from my testing setup and solder the components together.

You can see the reason I'm using this particular board now. Next to every pin are three connection points: one to the pin, one to the 5V line, and one to ground. These were lined up perfectly for the transmitter, so I couldn't help but take advantage. After removing the connector block in the way, I placed the transmitter directly into the plate, and soldered the connections. A circuit diagram is in the images above, so you can reference that if you're trying to build this on a more standard board.

The range and consistency of the transmitter was still extremely lacking, even for such a close-range application, so I decided to make a small antenna to sit on the plate. The antenna is about 17.2 cm of wire coiled up around a pen filling with a diameter of about 2.8 mm. With the remaining wire, I connected it to the top right soldering point of the transmitter (relative to the pins). It took a bit of trial and error to figure that out, since the text on the PCB was extremely misleading, but I got there in the end. I then used a bit of hot glue to fasten the antenna to the Arduino plate as well.

With the physical dimensions set in stone, I was able to design a small 3D-printable case for the design, though my Fusion 360 trial expired and they didn't want to give me an educational license, so I had to fistfight with free alternatives until I found something that worked- namely, TinkerCad. This experience haunts me to the moment you're reading this now and far beyond, and is why the case is so simple. It's a box with a lid and a hole in the side, and it works unfabulously. After the print, I glued the Arduino into place in the corners, and once I put the lid on the project was complete and operational.

Conclusion

Most of the time spent on this project went into very mundane things like research into .NET features and RF protocols and bugfixing. I did enjoy myself though, those things included. Getting to grips with various wired and wireless transmission methods was fun and interesting, and so was making a WinForms app. It's unfortunate that I had to drop my previous project fairly late into its development, but this was a great alternative and I'm glad I could still put a good amount of time into experimenting and making it work the way I wanted. Though there's not much of a physical product at the end of it, there were a lot of technical layers to it and I'm happy with the end result.