About

Ian Ozsvald picture

This is Ian Ozsvald's blog, I'm an entrepreneurial geek, a Data Science/ML/NLP/AI consultant, founder of the Annotate.io social media mining API, author of O'Reilly's High Performance Python book, co-organiser of PyDataLondon, co-founder of the SocialTies App, author of the A.I.Cookbook, author of The Screencasting Handbook, a Pythonista, co-founder of ShowMeDo and FivePoundApps and also a Londoner. Here's a little more about me.

High Performance Python book with O'Reilly View Ian Ozsvald's profile on LinkedIn Visit Ian Ozsvald's data science consulting business Protecting your bits. Open Rights Group

20 November 2010 - 14:49Packt’s new “Python Text Processing with NLTK 2.0 Cookbook”

I’m rather excited to have received a review copy of Packt’s new NLP book “Python Text Processing with NLTK 2.0 Cookbook“, it is based around Python’s Natural Language Processing toolkit.

I’ve been using the O’Reilly book for over a year, I’m curious to see what’s different between the two. I’ll post a full review once I’ve been through it.


Ian applies Data Science as an AI/Data Scientist for companies in ModelInsight, sign-up for Data Science tutorials in London. Historically Ian ran Mor Consulting. He also founded the image and text annotation API Annotate.io, co-authored SocialTies, programs Python, authored The Screencasting Handbook, lives in London and is a consumer of fine coffees.

1 Comment | Tags: ArtificialIntelligence, Python

7 November 2010 - 23:28£5 App #23 – “Things we built this summer”

Last Tuesday we had our 23rd £5 App event, given that it is only our second event this year we chose to let people “show and tell” about the things they built this summer. We had 9 speakers, I bought the beer, John baked the cakes.

Shardcore and the Englightenment Machine

Shardcore‘s Enlightenment Machine was installed at the WhiteNight festival a week back, here he explains what’s going on:

£5 App #23 – Shardcore and the Enlightenment Machine from Ian Ozsvald on Vimeo.

Jon and Digestly

Jon‘s Digestly lets you summarise tweets which can then be sent by email to e.g. your mum who wants to hear more about you:

£5 App #23 – Jon and Digestly from Ian Ozsvald on Vimeo.

Ian (me!) and the Social Microprinter

My Social Microprinter is a CBM 231 receipt printer + Arduino + WiShield + remote server, it prints tweets and useful info using a regular shop’s receipt printer via serial:

£5 App #23 – Ian and the Social Microprinter from Ian Ozsvald on Vimeo.

John and the Arduino Doorbell

John’s Arduino-powered door-bell couples a regular remote-control doorbell with lego, wood and a big bell:

£5 App #23 – John and the Arduino Doorbell from Ian Ozsvald on Vimeo.

Seb and Geek Family Fortunes

Seb built a Family Fortunes clone recently (we played it at BarCamp Brighton) using Flash, Nun-chucks and an iPad:

£5 App #23 – Seb and Geek Family Fortunes from Ian Ozsvald on Vimeo.

Emily and SocialTies on the iPhone

Emily is working on an iPhone app with me that we’ve named SocialTies, it helps you find your friends and ‘similar people’ when you’re at an event or conference. It was inspired by the fruitless hours I’ve spent at events wondering if I’ll ever find anyone I know…

£5 App #23 – Emily and SocialTies from Ian Ozsvald on Vimeo.

Kyran and JavaScript Social Graph Visualisations

Kyran and I have been working on some social graph visualisations, Kyran’s interface lets you see where you sit in an event’s social network whilst reading real-time updates from attendees:

£5 App #23 – Kyran and JavaScript Social Graph Visualisations from Ian Ozsvald on Vimeo.

Mike and the Tardis Money Bank

Mike’s Tardis Money Bank was designed to help him and son keep tabs on pocket money. It has gone on to be used by many families since its launch:

£5 App #23 – Mike and the Tardis Bank from Ian Ozsvald on Vimeo.

Jay and Twitter Election Predictions

Jay’s real-time election results predictor read Twitter during the UK elections, the results were interestingly accurate:

£5 App #23 – Jay and using Twitter to Predict Elections from Ian Ozsvald on Vimeo.

If you’re interested in keeping tabs on future events or would like to speak please join our £5 App Google Group.


Ian applies Data Science as an AI/Data Scientist for companies in ModelInsight, sign-up for Data Science tutorials in London. Historically Ian ran Mor Consulting. He also founded the image and text annotation API Annotate.io, co-authored SocialTies, programs Python, authored The Screencasting Handbook, lives in London and is a consumer of fine coffees.

No Comments | Tags: Entrepreneur, projectbrightonblogs, sussexdigital, £5 App Meet

6 November 2010 - 16:04Building a Social Microprinter

Over the last couple of months I’ve been building up a social microprinter (inspired by Tom Taylor‘s implementation and Matt Webb‘s original idea). Here’s the current version – Arduino+WiShield+CBM231+off-site server (powered partly by BenOSteen’s Python driver):

There’s a second quick video and talk for the £5 App event I ran earlier in the week.

The goal is to build a social microprinter – a printer that’d live in a social environment (currently The Skiff co-working office in Brighton) which would help bring people a little bit closer. Currently it prints tweets (for ‘theskiff’) and shows events, later it’ll show recent Gowalla check-ins and maybe some local news headlines or the weather (but there’s got to be better stuff to show, right?…ideas on a postcard please).

My original intent was to build a device that could be stuck on the wall in a cafe, it would show tweets on a screen (probably under the cafe’s or Brighton’s hashtag) and let non-Internet folk post their own messages back. Doing this nicely would have needed a screen, machine, wall space etc – using a receipt printer seemed like an easy way to prototype the idea.

Jumping forward, here’s an early version – this is a CBM231 connected to my Ubuntu laptop via a USB->RS232 lead (note – this lead is good, the cheap ones on eBay can be bad – see below). Here I’m using BenOSteen’s Python driver to send tweets via serial to the printer.

This device has done the rounds, here it is on display at BuildBrighton’s talk to the British Computer Society:

Here it is in use at Likemind Brighton showing international #likemind tweets as other groups meet around the world on Friday morning (note – unicode converted to ‘?’ as I haven’t figured out if/how to get international characters out of the printer yet!):

It ran during the weekend of Barcamp Brighton and printed out barcampy stuff, I added some notes about local cafes and a job ad for one of the companies:

The goal all along was to build an independent controller (so removing the laptop from the equation). For this I coupled an Arduino with a WiShield 1.0. The WiShield libraries are easy enough to work with, after an hour’s experimentation I got WPA2 working (it takes 25 seconds to negotiate the connection on each attempt), we use WPA2 at home and in The Skiff.

Coupling the Arduino to the printer was easy enough, I have been trying (and so far failing) to get a Max233 chip acting as a voltage level converter so for now I’m using a pre-built RS232 Level Shifter. This converts the Arduino’s 0V/5V TTL to +12V/-12V RS232 levels (powered from the Aruino’s 5V out). To output text I’m using Roo Reynold’s Aduino sketch, this handily includes some control codes to cut the receipt after printing.

Next I wanted live data. At first I simply put a short plain text file on a web site, used the WiShield to fetch it and Roo’s code to print it. Now I’m using a hacked version of Ben’s code to write tweets (including bold and underline control codes) to a text file which is stored online (microprinter.ianozsvald.com), this ready-to-print file is grabbed over the WiShield, printed and then cut. The online file is updated every 2 minutes.

The final tweak was to add a button to the printer. Using the Arduino’s demo button sketch I hooked up a big thumb-sized button. The Arduino’s main loop is looking for a combination of ‘at least 5 seconds have passed since the last print’ and ‘button pressed’, then it’ll kick off the web request for new data. Once this request returns it prints out the text.

I look for the pattern “————–” (14 dashes) to start and end the message, before this we get HTTP headers (from the WiShield) that I didn’t want to print.

Here’s the finished hardware:

This is a WiShield 1.0. The button (shown just out of shot top-left) is connected 3.3V->button, button->Pin 6 AND Ground (via a 15k resistor). For the printer I’m using Pin 8 for tx (blue lead on the RS232 level converter) and Ground, the level converter is powered by the 5V out.

Here’s the connector:

The connector is overly-connected in this image. I think all you actually need is Pin 2 from the RS232 Level Converter to Pin 3 on the 25 pin connector along with Pin 5 (GND) to Pin 7 (GND on 25 pin connector). With yellow wires I’ve shorted Pins 4&5 and 8&20 but I think this is overkill (they’re used for bus control but they’re probably ignored in this configuration).  Here’s a full pinout.

During all the hacking our faithful cat Mia has attempted to assist whenever she could. Here she’s taken ownership of the bag used to transport the early versions:

Along the way I also acquired an Epson TM T88 II receipt printer, it is ‘just another serial printer’ but takes different control codes (and it looks like it might have a smaller character set than the CBM 231). As yet I’ve only tried printing plain ASCII, I’d like to investigate further and build a library that supports this printer too.

Note on buying leads from eBay! be aware that if you buy cheap leads from eBay (e.g. £2 silver/blue leads) then you might end up with a pack of 5 (because if you buy 5 and one breaks, you’ve got 4 more that work, right?), you might have 5 dead-on-arrival leads. You could then report the problem and the nice people could then ship you a replacement set, but then you might discover that you’ve got another 5 DOA leads. You have been warned.

If you’re buying your first microprinter do try to buy a working serial lead with it (it’ll probably be a 9 pin to 25 pin converter lead) – if you get the wrong lead (null modem vs straight serial – I forget which you need!) then you won’t get anything (the bane of my first few week’s of testing). Buy a printer+lead that’s known to work and you won’t go wrong.

Spend the £8 per lead and buy from Amazon if you don’t want to waste hours wondering why your printer is just printing out reams of ‘?’ rubbish:

If you want to build your own then the first best source of info is the microprinter wiki. Roo Reynolds has Arduino drivers (which I hacked a bit for my implementation) that don’t depend on external data sources.

You’ll find my Python server source and Arduino sketch (which assumes you’ve got a WiShield 1.0) here: social_microprinter. Note that the code is horribly hacky, it was written over many short sessions when I could steal an hour or two from other projects.

It could do with being straightened out and commented and a few nice new features would include Gowalla check-in notifications, event RSS reading and weather printing.

Many thanks to my fellow hackers at BuildBrighton for help debugging my early serial problems and to Barney for the lend of his RS232 Shifter (I’ll soon get this Max233 working, promise!).

Here’s the finished, installed unit on the work bench at BuildBrighton in The Skiff (just by the social kitchen space). Once it is a bit more robust it’ll move to the front of the building:


Ian applies Data Science as an AI/Data Scientist for companies in ModelInsight, sign-up for Data Science tutorials in London. Historically Ian ran Mor Consulting. He also founded the image and text annotation API Annotate.io, co-authored SocialTies, programs Python, authored The Screencasting Handbook, lives in London and is a consumer of fine coffees.

2 Comments | Tags: Life, Programming, projectbrightonblogs, Python