A few years ago, while I was Web Producer at s1, I was asked to develop a ‘hyperlocal’ community web platform. Â The system I designed and developed with Duncan McDonald, s1community, went on to power over 100 s1-branded community sites, 80 Evening Times local sites and still employs full time journalists to curate content from thousands of public contributors.
It’s a platform I’m very proud of, but in the six years or so that have passed since we launched there have been huge changes in the wider web. Â Most notably, people are no longer tied to their PCs. Â The growth in web access from smartphones and tablets has been explosive and many people – myself included – now rarely look at a desktop or laptop computer outside of office hours.
Against that backdrop I was itching to do something different in the hyperlocal space. Â I think there’s a big opportunity to connect people, businesses, charities and council services in a much more integrated and cost-effective way than has ever been possible before.
When I saw Nesta’s Destination Local, with £50K of funding for new hyperlocal ideas, it seemed like the perfect opportunity to try something new that would be too risky to try independently.  I called the idea Our Town, and we submitted it to Nesta as a Herald & Times Group project a couple of months ago.  Ten winners were selected from 165 entries and I’m delighted to say that ours was one of them.
I spent the day in London on Wednesday with the other winners, discussing our ideas and working out what comes next. Â It’s going to be a big job but I think it could be an exciting future direction for local communities online.
About a year ago my manager at the Herald & Times set me a challenge – how do you move street papers like the Big Issue into the digital age?
On one level it sounds like a trivial problem. Â Dozens of solutions already exist to translate newspapers and magazines into digital editions. Â We already use several such systems for our commercial newspapers and magazines – everything from digital facsimile systems like NewspaperDirect to bespoke print-to-digital workflows like the one we developed between Atex Prestige and our Drupal-based CMS for heraldscotland.com.
Any of those solutions would be a valid way to get street papers into a digital format. Â But street papers present another, unique challenge… how do you preserve the physical transaction with the vendor on the street when everything is digital?
There are, of course, high-tech solutions to that conundrum – technologies like NFC, RFID and swiping cards with Square readers are all valid solutions.  But they’re also fragile, expensive and not particularly well suited to the street vendor environment. In the end I came up with a pretty simple solution.  Using cardboard cards printed with unique access codes, vendors could sell ‘digital’ editions of their magazines alongside the regular print editions.
Within an hour of my video upload last night I already had someone asking how to do it. Â It’s a good question – despite the popularity of the Philips/NXP MFRC522 RFID chip and the MF522-AN board based on it, there’s actually very little online in the way of tutorials or source code to get started.
Here’s how I got up and running and to my first ‘hello world’ test…
Although the board has header pins they don’t line up with Arduino (as they would on a regular shield) so a breadboard is the easiest way to match the pins to the relevant in/outs on the Arduino.
If you’re using an Arduino Uno the pins map as follows:
Reset > Pin 5
SS > Pin 10
MOSI > Pin 11
MISO > Pin 12
SCK > Pin 13
Ground > Ground
3.3v > 3.3v
2. Software
Example sketches for this board are really hard to come by. Â I eventually found an example written by the guys at B2CQ Shop which covers pretty much everything you’d want to do – identifying cards, reading their data and, if the card supports it, writing data back.
Since I found the sketch so hard to come by (and I can’t actually find the source again now!) I’ve shared my modified version below. Â This version is just tweaked slightly to respond to a couple of specific cards. Â However all of the original code and comments are still in there, so it shouldn’t take long to work out what you need to uncomment in order to restore/tweak functionality.
I hope this helps someone. Â If anyone has any questions please feel free to get in touch. Â And if you make something cool with it please share your examples. Thanks!
I’ve been meaning to do some experiments with RFID for a while. Â The technology is cheap, reliable and opens up a world of possibilities for exhibit and event IT interactive displays.
I chose Arduino as my platform for RFID, not only because it’s robust and I’m familiar with it, but also because it has established integration with openFrameworks and Flash – my two platforms of choice for interactive displays.
My first RFID module arrived today and I’m pleased to say that it was up and running within the hour. Â So far it seems totally reliable and incredibly fast – a quick swipe past the reader is enough to correctly identify the card.
Here’s a quick video of my first test. Â It’s a really simple ‘hello world’ type example, but it demonstrates a few things: 1) the I2C protocol works; 2) the wiring is correct; 3) this simple sketch is enough to get the raw ID numbers off the card and out to the serial line.
Once we’ve got serial I/O, everything else (in Flash, HTML, openFrameworks, etc) is established tech.
What’s next? I’d love to do an event or venue installation where RFID labels (which cost pennies each) personalise an AV experience to each user. Â But for now I might pair this with a door lock to give me contactless access to my garage.
Wow! I’ve been blown away with the amount of interest in my wee Space Invaders alarm clock modification. Â Thank you everyone!
Four days on from my original blog post my YouTube video has been viewed over 11,000 times and details of my project have spread right around the globe, translated into German, Spanish, Portuguese and French… and others I’m still finding!
I’ve posted the code and the circuit online for anyone else who’d like to try it, but I’ve had a lots of first-time Arduino users asking for a complete “from scratch” guide via Twitter, email and in the online comments.
I guess from a standing start – without experience of coding and/or electronics – there’s quite a lot to it, so I’ll make a start for anyone who wants to have a go themselves. Â Click the link to read more… (more…)
A couple of weeks ago I was in our local Boots chemist. They were clearing out all the Christmas gifts at 75% off.  I saw this Space Invaders alarm clock reduced to around £3 ($5) and had to have it, even though I had no use for another alarm clock.  (Btw, even though Boots are now sold out, the same clock is available from Play, IWOOT, Menkind and others.)
The challenge was… what to do with it?
In the end I decided to turn it into an ambient device, connected to the internet and capable of alerting me when things happen. Right now I’ve got it firing up with a new message arrives in my Gmail inbox, but really it could do anything – flag up Twitter replies, indicate the chance of rain or even, paired with one of my previous projects, act as an additional ringer for the doorbell.  I’ve added a row of LEDs (three red, three yellow) to give it some more feedback options.
Every time I get a new email the clock moves from side to side and does the classic Space Invaders sound, then lights one of the LEDs to give me an idea of how many unread messages there are. Â There’s loads more that could be done with it, but I was happy just turning it into something more useful without destroying it in the process.
If you want to make one yourself, here’s what I did…
I used an Arduino to give the clock some more logic. I didn’t want to alter the external appearance of the clock and space was incredibly tight inside, so I used an Arduino Nano clone that I had lying around.
First step was to get the components working on a breadboard. I ran 6 LEDs off the Arduino’s digital pins and added an opto-isolator to another digital pin to act as a switch. I knew the Arduino wouldn’t be able to drive the clock’s motor straight off an IO pin, so my plan was to simply trigger the clock’s handy ‘demo’ button from the pin and deliver the main clock/motor power from the direct 5V pin on Arduino.
Here’s the wiring layout that I ended up with…
The original power source for the clock was 3 AA batteries producing around 4.5v. I was planning to power the clock directly over USB – I figured 5V was close enough – so the battery compartment provided the perfect space to house the additional components. Unfortunately the battery box wasn’t quite deep enough for the Nano, so my first job was to cut out the battery recess with a craft knife. I left a small lip on the bottom edge to support the additional components and to retain the original motor mounting point.
With a bit of breadboard trimming (with a hacksaw… quick and nasty!) I was able to fit it into the clock…
Next step, the Arduino sketch. The code is currently dead simple: listen to the serial input and if it’s a number, light that many LEDs; if the new number is higher than the old number (i.e. you’ve got new emails, not just cleared out old ones) then also close the ‘demo’ switch to activate the sound and movement. Here’s the finished code.
int ser = 0; // for incoming serial data
int prevCount = 0;
int timer = 100;
void setup() {
for (int thisPin = 2; thisPin <= 13; thisPin++) {
pinMode(thisPin, OUTPUT);
}
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
if (Serial.available() > 0) {
// read the incoming byte:
ser = Serial.read();
if (ser >= 48 && ser <= 58) {
int newCount = ser - 48;
if (newCount > 0 && newCount > prevCount) {
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(1500);
digitalWrite(12, HIGH);
delay(500);
digitalWrite(12, LOW);
}
prevCount = newCount;
} else {
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13,LOW);
}
}
for (int thisPin = 3; thisPin <= topPin; thisPin++) {
if(thisPin <= 5) {
digitalWrite(thisPin, HIGH);
} else {
digitalWrite(thisPin+3, HIGH); // Because I left a gap in the digital pins
}
}
}
The last step was to write a quick script to poll Gmail and get the number of unread messages. Â I’ve tried lots of different languages for Arduino serial control in the past – Perl, PHP and DOS shell scripts – but every time it’s been a little bit flakey, at least under Windows. Flash Actionscript is pretty reliable using Serproxy, but that was overkill for this project. So in the end I decided to give Python a go. It was a good choice – reliable and really quick to implement. Â Here’s the code…
The only bit that had me scratching my head was Arduino’s trick of resetting every time the serial line is opened. Â The Nano takes around 1.5 seconds to restart, meaning it would always miss the first mail notification. A wee sleep command fixed that.
And that’s about it. Three hours and around £12 of components (including the Nano clone) to turn an alarm clock into a Gmail notifier.
Future scope
There are still lots of free pins on the Nano, so plenty of scope for expansion. A light sensor could be a useful addition so it doesn’t trigger when the room lights are off, and maybe a knock sensor so it could be set to ‘snooze’ with a quick tap. Apart from that, most other mods would be software-based. I might make the three red LEDs linked to Gmail and the yellow ones linked to Twitter.
If you decide to make one of your own please let me know. Â And if you make any improvements to the software, please share!
Update: The response to this hack has been phenomenal – thanks for all your emails and feedback. Here are some of the mainstream sources that have picked up on it.