Sunday, 30 August 2015

Writers Block Motivational Assistant

aka, electrocuting friends for fun and profit

One of my friends is a writer, and one of the common complaints I hear is that of “Writers block” - experiencing a creative slowdown and not being able to think of ideas to write.

I experience a similar thing with the projects I'm working on from time to time. A solution I've always sworn by is to just jump in and start doing something – even if it's crappy to begin with, it can always be edited later, and the process of actually taking action helps stir the creativity.

The discussion itself was enough for me to start thinking creatively for ways to overcome writers block. Think a cattle prod, combined with the movie Speed, and you get the idea.

As usual the full write up is below, or here's the video of it in action. Unfortunately there's not much to see, the shock wasn't strong enough to create much of a visible effect - it made my thumb twitch a bit, but seemed very dependent on where the electrodes were placed.

The hardware

As we're administering electric shocks to people with this project, in the interests of safety I didn't feel too comfortable DIY-ing the actual shock circuitry, so I picked up one of these reaction-test toys – the idea of the game each player holds one of the controllers, the light in the centre blinks red, as soon as it hits green, the last player to press their button gets a shock. Simple.
The shock game that's going to form a base for this project
The game in action

The bottom of the unit just contained the main switch, battery compartment and small speaker. None of these are needed in this project, so all found their way into the junk bin.

The top of the PCB just contains the main button (centre, surrounded by LEDs), a number of players button in the corner, and a few capacitors. The 4 LEDs around the edge were removed.

There was also a switch on the side which determined the severity of the shock - either a single one or multiple. I forgot to check which one was selected when I removed it, so that'll be a surprise when it's done. (This was connected to the green wires in the PCB picture below - effectively I've left the switch open)

I also cut away all the controller wires except for player one - that will be the one we're using.

The controller and it's circuitry

Interfacing & Software

How we're going to interface this is by wiring shut the player one button (so effectively it's always held down), and adding an optocoupler in place of the main game button. Then when receiving the signal to deliver a shock, a new game will be triggered, and player one will be shocked for pressing the button too early.

It looks like a steampunk torture device, but it works.
The wires on the controller side were re-wired to a couple of cheap pound-store bracelets, separated by a few 3d-printed plastic spacers and held together with copious amounts of hot glue.

The typical next step here would be to wire in a microcontroller, usb-serial converter and have the PC direct output that way, but I've done that dozens of times and felt like doing something different, so I'm going to use bluetooth and a Wiimote.

The Wiimote connects via bluetooth and contains several sensors. In truth, it's overpowered for this project, but it does give plenty of room for expansion in the future. We're going to use the vibration motors connections to link up to the shocker.

The dismantled Wiimote we're going to use

The connection itself is very straight-forward - a simple optocoupler between the shock toys' main 'play' button connections and the vibration motor output on the Wiimote.

Power is obtained with a 5V wall-wart supply, brought down to 3.3V for the Wiimote using an LM317.

The finished box and bracelet
The software
The source code for the application can be found on Github. Uses Bluecove and MoteJ libraries.

The initial bracelet didn't work to well in testing, as the angle made it difficult to ensure both sides of the connection were in contact with the arm, so I put together an alternative using an old sweat band with a couple of pennies glued into it.


The new shock band