Tuesday 15 February 2011, 15:02
Editor's note: engineers in radio used to concern themselves with balancing audio and locating transmission towers but they now have a whole set of rather more pressing concerns - like how to stop slot cars spinning off the track when too many people tweet Scott Mills. Patrick Sinclair - a software engineer in the Radio 1 Interactive team - explains how connecting social networks with physical things (Using the volume of tweets from listeners to control a slot car race, to be specific) makes for good drivetime entertainment - SB.
Behind the scenes, we used:
We built a computer-controlled 'fake controller' that plugged into the track, just like a normal manual controller. Slot car controllers are basically just variable resistors. We varied the resistance by connecting relays across resistive load. As we turned the relays on and off, it enabled and disabled the resistors, varying the speed of the cars. Each of the resistors were potentiometers, which allowed us to calibrate the speed of the cars ahead of the race.
The relay board was connected to a USB interface board, which was then plugged into a laptop. We wrote a custom HTTP-to-USB server to make it easy for the Ruby script to turn the relays on and off.
The hardware allowed for a range of seven speeds: from 'slowest' through to 'fastest' and then 'eleven' where the car would spin off the track and finally 'out of this world' where the car would literally spin off into orbit!
We timed how long the car would take to track for each of the speeds so in theory each tweet would make the car go around the track once. Each car would have a queue of outstanding laps based on the number of tweets received, and the size of this queue would affect the speed the car ran at.
Compared to our previous efforts, using SMS messages, Twitter's API was amazing because we could get real-time feedback - within seconds of users tweeting, the car would respond. With the SMS feed, there was a delay of a couple of minutes between a message being sent and us receiving it.
The lessons were:
For next time:
Patrick Sinclair is a software engineer at BBC Radio1
Join the discussion...