Learning to say Arduino
Last month I promised you I would make a game with an Arduino and Pulse Sensor. This was a promise made with the happy arrogance of a man who has never even tried to broadcast his pulse over the internet. I speak to you now from the other side of that experiential gulf. Here’s what happened.
It was maybe five years ago now that I heard about ‘Journey to the Wild Divine’, the $400+ meditation tool which comes bundled with a heart rate and skin conductivity sensor. I thought this was utterly remarkable stuff, and the idea of plugging myself into a computer and making a feather float using only the unmistakable power of my own calm was narcotic to me.
Imagine my delight then when, while browsing Boing Boing’s 2012 christmas gift list for ways to appease my family for another year, I came across this lovely little open source Pulse Sensor. A week or so later I was looking at some exciting boxes:
Of course I didn’t have any sort of idea how to use it, we’ll get to that. For those that don’t know, an Arduino is an open source microcontroller. If you remember playing with circuit boards and solder in school then this may feel familiar - the Arduino provides a current and allows the user to control the provision and manipulation of that current with code which can be loaded onto the board itself, or run on a computer while taking regular readings from the board.
How does it work?
The Pulse Sensor I am using is called a photoplethysmograph. This is a device which illuminates an organ (the skin in this case) and measures changes in light absorption. In this instance, that change is caused by the pulse wave which travels along arteries and capillary tissue when your heart beats. The analog signal which we read from the board is a fluctuation of voltage caused by the pulse wave itself. It looks a bit like this:
The physical setup was pleasingly simple. The Sensor itself needed treating with a little hot glue to keep the circuitry protected from grease and moisture and connects to the Arduino through it’s analog input pin. Once it’s all set up it looks like this:
Getting the data
It quickly became apparent that running the pulse detection code on the board itself was crucial. The next stage of development was concerned with finding a reliable method to bring the resulting data in over the serial port, and into the browser - where our ultimate goal of course is to build a game. I decided to use Impact as the engine for this project because it’s a great tool for rapid prototyping. Nonetheless, choosing to work in the browser now had other consequences - your web browser can’t usually interface with your computers hardware like this, for security reasons.
Building a game
Now we have the data in the right place, we can start building a game around it. One of the advantages of Impact is that it’s shockingly fast to move from nothing at all to a populated 2d context. Within about 20 minutes I had moved from an integer for bpm to a simple side scrolling race game. You play against an AI opponent and try to beat him to the finish line by raising your heart rate.
The AI you’re racing against is a bit of a trick - every five seconds it looks at your BPM and adjusts the ‘virtual bpm’ of your opponent to be a small percentage above or below yours for the next interval. At the moment your opponent has a 33% chance of ending up faster than you at any given point so you could say it’s an easy game. We ran a number of trials, it’s pretty fun!
Clearly this is a long way from being a polished experience, but it opens the doors to a number of exciting possibilities. In the playlab offices we’ve been throwing ideas around for anything from a canabalt clone (with a special jump pad peripheral!) to a meditation trainer. I’d love to hear from you! We have another pulse sensor coming soon and with a little hackery we’ll have two running with nice long cables on the same machine.
Here’s my question if you’re still reading: There’s something very intimate about your pulse, it’s almost romantic. Especially if there are two people involved! How would you design a game which used this data to make people feel closer to each other? What kind of experience brings people closer together? I’d love to hear your thoughts, ping me on firstname.lastname@example.org. Oh and let’s get all the sex jokes out early because I know you’re thinking of some.
playlab LONDON is a community of designers, artists, gamers and coders enthusiastic about deploying the technology of play to positive social effect.
Hey get in touch we'd like to say email@example.com
Use the arrow keys to look around.
Keep Me Company Company is built on the +sum framework and like +sum, KMCC was conceived as an engine for visualising, raising and sustaining an area's Jen ratio, a measure of the social well being of an environment designed by positive psychologist Dacher Keltner. Unlike +sum, KMCC provides a simple narrative frame to ease the player into the game, and a solid set of game play goals.
KMCC casts players as executives in company which profits from the social feats performed by it's employees. Those playing collect points ('bucks') which accumulate in a central pool to bolster the companies share in a fictional market, against competitors such as UnSociable inc. The game ends when the company has gathered 100% dominance of the market place.go back
The Keep Me Company Company is a radical non profit adventure in giving more value to doing positive things.
At playlab we are big fans of the idea that a game framework is a potent tool for affecting our behaviour. We created +sum as a technical framework which supports that goal.
+sum allows for the delivery of missions to players, and the ability for players to receive points, give points, share messages and collaborate on completing those missions.