The Raspberry Pi in scientific research

The cost implications that come with finding yourself able to buy a computer for $25 are significant for all of us, but they can make a real difference to the way cash-strapped researchers do things. We’re seeing a surprising number of university departments around the world using the Pi for the sort of tasks you’d previously have pointed a PC at, with very gratifying results.

I had email from Lorna, who manages some of our social media, about a video she’d been sent yesterday. “It’s about crabs,” she said. “The seaside kind.” (Just as well, or I wouldn’t have been able to publish it.) David Soriano, who is an Associate Professor of Chemistry at the University of Pittsburgh-Bradford, has been using a webcam controlled by a Pi to monitor fiddler crabs which are being offered thermal polypeptides, rich in the amino acid tyrosine. Tyrosine starts the pathway to melanin pigment production in the crab, and David’s watching for colour changes that result from it. This is a long video, at 15 minutes, but it’s very interesting, as David describes the setup and some of the crabs’ behaviour.

David is also studying the effects of certain chemical agents on the American Cockroach with the help of a Pi. Cockroaches are much less cute than fiddler crabs, so I won’t embed the video here, but you can watch it on YouTube.

Meanwhile, over in France at Aix-Marseille Université, Sebastiaan Mathôt, a post-doc at the Laboratoire de Psychologie Cognitive, has been running his graphical experiment builder, OpenSesame, on the Pi.

Eben took part in a university psychology experiment once. The results, somewhat surprisingly, demonstrated that he had a closer relationship with Superman than he did with God.

Sebastiaan is testing the Pi for use in psychological experiments, and has found it very suitable. He found a few milliseconds’ inaccuracy in some measurements, but says:

If I were to set up a low-budget lab, I wouldn’t have any problem with running my behavioral studies on a Pi, since this type of temporal jitter has a negligible impact on statistical power.

You can find out more about the setup on his blog; it’s well worth a read.

The biologists are in on it too: click the picture below to visit the University of St Andrews in Scotland, whose Centre for Biological Diversity have written a Raspberry Pi phylogeny reconstruction program, so students can look at the relationship between phylogeny and evolution on a Pi.

Daniel Barker, from St Andrews, said:

Given a bunch of DNA sequences and some pre-processing, LVB gives you an idea how they are related. If you give it one sequence per species, it gives you an idea of how the species are related. LVB combines an optimality criterion that’s rapid to evaluate and a subtle heuristic search – with the intention of working fast, and reasonably well, with large input.

If you’d like to learn more (undergrad-level biology is a whole new world to a lot of us), Daniel came and posted some more explanation on our forums last year. Come and take a look.

Of course, you don’t need to be at a university to use a Pi to research something. Yesterday I spotted a brand new Twitter feed, fully automated with a Pi, dedicated to capturing an image of the Beijing sky every 15 minutes. Zhe Wu, who works at, is collecting the visual data and will be using it to analyse changes in the condition of the city’s air. There’s not a lot of data to process yet; the images only started being collected yesterday. But we’re looking forward to seeing what he does with them. You can view the stream of pictures on Twitter.

Pictures of the Beijing sky today. It’s looking a bit less smoggy today than it did on my last trip!

Back in the UK, we’re seeing some pretty extraordinary research work coming out of schools too. The winners of the 16-18 section of the recent PA Consulting Awards competition, challenging schoolchildren to “make the world a better place” with a Pi, were Alyssa Dayan and Tom Hartley from Westminster School, whose Air Pi we’ve mentioned here before briefly; it’s a very sophisticated, very well implemented project we thought we should talk about some more.

Air Pi is, say Alyssa and Tom, “an automatic air quality & weather monitoring device powered by a Raspberry Pi, capable of displaying, recording and uploading information about temperature, humidity, air pressure, light levels, UV levels, carbon monoxide, nitrogen dioxide and smoke level to the internet.” It’s cheap, it’s modular, it’s open: we love it. Here are Alyssa and Tom, who will explain a bit more about the project and what’s being done with it.

There’s a lot more information on the AirPi website – head over and have a look. You can set one up yourself for as little as £50 (including the Pi), and AirPis are already being used to monitor air quality as far away as India.

Are you using a Pi for research? Let us know in the comments.



As a Pi owner I don’t need anyone to sing its praises to me, however I have a really hard time imagining researchers can’t get hold of a pc when they need one. I’ve lost count of the number I’ve given away, or taken to the tip, just to get rid of the damn things.


A lot of it’s not to do with availability, but to do with space and running costs (as Carrot says).


The Pi uses a lot less power than a desktop PC, is smaller, silent, cooler, etc. so I’d hazard a guess it isn’t just cost that makes it attractive.


we the RPi finally start a revolution in PC-control/PID’s , at affordable costs


Thanks for highlighting OpenSesame!

> I have a really hard time imagining researchers can’t get hold of a pc when they need one.

As a researcher/ developer, partly it’s just the fun of playing with the Raspberry Pi, of course. But I think that researchers in less wealthy countries might genuinely benefit from really cheap equipment. (Although I’m not sure what the world-wide availability of the Pi is.)

Finally, I couldn’t help but notice that the link to my blog is broken. ;-)


I shall fix that immediately. Sorry!


In the next few days, I will join a panel of reviewers of senior-level engineering projects at local universities. I expect to see the Raspberry Pi used as an important component of some of those projects.


It has probably been said many times by now, but that AirPi project is really rather fantastic. Having only skimmed the post here, I didn’t realise that this project had been put together by school students until I eventually reached the About page on the AirPi website. Until then I had been wondering how these guys business model was going to work as I had assumed that this was semi-professional endeavour at least.

I’m sure that this could have been achieved without the Rasberry Pi, but it is clearly be the case that Raspberry Pi was a catalyst for this type of project as well as being a way to realise the project itself.

Congratulations, of course, to Alyssa Dayan and Tom Hartley for winning the PA Consulting Awards competition and also to the Raspberry Pi Foundation for making more progress in Computer Science education in one year than several governments have made in the last twenty.


The only research I ever did with cockroaches was what the colour of their insides looked (and smelled) like whenever I stamped on them, during my time in Malaysia. Those blighters always liked to play dead, so the crunchy sound they made was most satisfying, cos you knew they were definitely NOT playing dead.

So… thanks muchly for not linking to said video, or else I would have stamped my monitor :-)


Ugh. I spent a lot of time in Malaysia as a kid (we’ve got a lot of family out there), and my worst cockroach memory is a pretty bad one; we were all out on Pangkor, where one of my uncles lives, and were walking to his house from the ferry when it started to rain. We took shelter under the eaves of a house.

The rain suddenly started to become…large. And solid. And brown. And full of legs. It turned out that the exterminator had just visited, and something about the rain had triggered a giant infestation of THOUSANDS of bloody cockroaches, all dead or dying, to drop out of the roof en masse, in a giant arthropod wave. And gravity was making them slide down to the bottom of the eaves, where we were, before plopping to the ground. Several ended up inside my t-shirt.

They still give me the heebie-jeebies, hence no embedded cockroach video. I’m pleased that you’re pleased.


I’m more a Langkawi man myself :-) I wonder how the place looks now – 2005 was when they started developing more there – apparently the seven generations curse by Mahsuri was lifted about then.

One of the flying cockroaches flew out from a cupboard when I opened it one morning, flew right into my face – he got an especially hard one with the sole of my shoe. I think that pales in comparison to your experience though – think I would have died several times over if that had happened to me. :-p


It’s also about rules… In my experience, it’s often the case that researchers are supposed to get computers from their institute’s IT department, and wouldn’t officially be allowed to accept 2nd hand equipment (supposedly for legal reasons). Every so often the IT staff hunt out “old” computers to be replaced, meaning the hard drives get destroyed and the rest ends up in a skip. But a raspberry pi is cheap enough to sneak onto a project’s accounts without the admin staff noticing! Also researchers don’t like wasting money – spending money means more grant application writing.


Oops! This was meant to be a reply to George Witherspoon…


Liz, Thank you very much for posting the note on LVB.

George, some thoughts as to why one might use a Pi in research.

It’s not a fixed rule, but if a program runs well on a slow computer, it tends to run brilliantly on a faster computer. Developing compute-intensive software on a slow-ish computer can be very helpful, particularly if you don’t know who the users are, what their hardware is, or how large and complex their input might be.

As to whether researchers can afford a PC: it slightly depends on how they’re paying. If you received a research grant for some purpose, you can buy everything required (outlined in your accepted application for the grant). But, a lot of interesting research happens without specific funding from a research grant. In such cases, access to “central” funds of some kind (from the university or organisation) can be severely limited or zero. It varies, in the UK at least.

If students are doing some of the research, I think it’s great if they can be exposed to “proper” Linux systems administration. On a Pi, they can have full root access to their own SD card. We would not give students (even PhD students) administrator access to our Linux servers. We would not give undergraduate students administrator access, even to desktop computers. This leaves a gap in their experience, which the Pi can fill nicely. It could be done with virtual machines but in a more confusing and less fun way.

Finally: I long for the day when I can just shift my work around on an SD card – instead of lugging around laptops and external drives, or trying to reach servers via a “corporate” VPN that keeps dropping the connection. I kind-of hate having to carry a large bag around. In this respect, I think/hope the Raspberry Pi is a glimpse of the future!

Best wishes,

Daniel Barker

Leave a Comment

Comments are closed