Mr Penguin – A twitter controlled bubble robot

For the last couple of lunchtimes I have been working with my technical director Alan to create a bubble machine that could respond to our social media presence.
Meet Mr P

Mr p

We brought a kids bubble machine for a couple of quid and modified the switch on top so it was linked by a transistor. This transistor was then enabled and disabled by the GPIO socket on a Raspberry Pi, which we then switched on and off using a simple node.js program.

IMG_20151005_133209

The Twitter API has two REST callbacks which are were helpful for us to respond to our presence.

Firstly, one call to get the all the retweets of the logged in user
Secondly, one call to get the list of followers

I wrote the program to poll these callbacks every minute and to detect any changes.

Lastly, the program also posts to our company Slack channel, detailing what Mr P is excited about.

Screen Shot 2015-10-12 at 11.53.41

 

Here’s a copy of the source code and here’s a video of the little guy in action.