Toy abuse for fun and (non)profit

Mar 12, 2009 18:56 · 548 words · 3 minute read arduino electronics hack projects

[![3345221754_7dd629b539](http://www.flickr.com/photos/tim_d/3345221754/)This is a panda who has been volunteered to donate his eyes in the cause of - well, something or other.

I picked him up in a charity shop for a pound (is there anything sadder than the toy shelf in a charity shop?  I can’t help wondering how many toys ended up there after their owners were struck down by childhood leukemia or something) so technically, he’s recycled.   I chose a panda for two reasons - one, because I happen to like pandas; and two because their black eye patches mean that you can’t normally see their eyes particularly well.  This will become more important later…

The original idea was sparked by the phrase “a bear market” - so instead, this is a market bear.   In place of eyes, he’s going to have tri-colour LEDs - which will change colour according to how well the stock market is doing.   When it’s going down, he’ll glow red, and when it’s going up, he’ll glow green.   And if there’s been no change, the LEDs will just light up yellow.

There’s also going to be a button inside his paw, which will rebase the scale to the current value of the market - so squeezing his paw will switch the LEDs back to yellow, and then they’ll change colour the next time the market changes.

Although you can’t see it from the photos, he’s actually a glove puppet.  That’s ideal for my vivisectionist purposes, because it means he’s hollow enough to stuff the electronics up inside.   These are an Arduino microcontroller and an Arduino Ethernet shield, which will connect him to the interwebs.   Ideally I’d have preferred a wifi connection because then he won’t have cables emerging from his colon, but that’s for the next generation of mutilated soft toys.

The software is in two parts - there’s a server-side component, which grabs the market data from the Guardian website (I’m using the Guardian because their site is nicely laid out for scraping purposes, and they hopefully won’t be too upset if they find out) and then does the calculation to decide whether it’s up or down.   That feeds back an “up”, “down” or “same” response when polled by the Arduino sketch - which feeds the appropriate voltage onto the analogue outputs to light up the LEDs.   Squeezing his paw fires off a message to the server to rebase the calculations, so the up/down/same algorithm can start from wherever the market is standing at the point of squeeze.

The next stage is to grab the magnitude of the change and fade the LED up and down accordingly - bright for a big change, and dimmer if it’s smaller.   But getting my head around the Arduino Ethernet library is a big enough challenge for the moment, so to start with I’m going with the simple version.   So far it’s working on a breadboard, so the next stage is to build the circuits for implantation into the eye “sockets” and paw.  Extracting the eyes was something of a challenge, because they’re fixed in with fasteners designed to withstand small children gnawing on them - so removal was a case of sheer brute force and application of Tools.   There’s a set on Flickr which documents the whole gruesome process.

[Update: Panda vivisection redux]