Photocatalysis with a Raspberry Pi

Access to clean, safe drinking water is a global problem: as water.org notes, 663 million people lack access to water that’s safe to drink. That’s twice the population of the United States, or one person in every ten. Additionally, a recent review of rural water system sustainability in eight countries in Africa, South Asia, and Central America found an average water project failure rate of 20-40 percent. It’s no surprise that the search for a solution to this crisis preoccupies scientists the world over, but what you may not have expected is that, in a lab in Cardiff University, researchers are using Raspberry Pi to help in their efforts to bring safe drinking water to some of the poorest areas of the world.

A tap set into a wall, with sign above reading "SAFE DRINKING WATER"

There are three processes involved in water purification, two of which are reasonably straightforward: filtration can remove particulate matter, while heating water to near 100°C kills bacteria. However, the third process — the removal of highly toxic hydrocarbons, typically from fertiliser and pesticide runoff — is very difficult and, currently, very expensive. The Cardiff group is working on a project to find a cheap, effective method of removing these hydrocarbons from water by means of photocatalysis. Essentially, this means they are finding a way to produce clean water using little more than sunlight, which is really pretty mind-blowing.

Here’s a picture of their experimental setup; you can see the Raspberry Pi in its case on the right-hand side.

A laboratory photocatalysis setup at Cardiff University: on a bench are a beaker of water dosed with methylene blue "pollutant" under UV LED illumination, semi-transparent tubing connecting the contents of the beaker to a flow cell, a Raspberry Pi, and other components.

Raspberry Pi in the lab

A cheap, readily available chemical, titanium dioxide, is spin-coated onto a glass wafer which sits in the bottom of the beaker with a UV LED above it. This wafer coating acts as a semiconductor; when UV photons from the LED strike it, its electrons become mobile, creating locations with positive charge and others with negative charge. As a result, both oxidation reactions and reduction reactions are set off. These reactions break down the hydrocarbons, leaving you with pure water, carbon dioxide, and hydrogen. The solution is pumped through a flow cell (you can see this in the centre of the picture), where an LED light source is shone through the stream and the amount of light passing through is registered by a photodiode. The photodiode turns this output into a voltage, which can be read by the Raspberry Pi with the help of an ADC.

The team are currently using two organic dyes, methyl orange and methylene blue, to simulate pollutants for the purposes of the experiment: it is possible to see the reaction take place with the naked eye, as the colour of the dye becomes progressively less saturated. A colourless solution means the “pollutants” have been entirely broken down. You can see both dyes in situ here:

Laboratory photocatalysis setups at Cardiff University: on a bench are a large LCD display with a desktop showing the Raspberry Pi logo, beakers of water dosed with methyl orange and methylene blue "pollutants", semi-transparent tubing connecting the beakers' contents to flow cells, a Raspberry Pi, and other components.

Experimental setup with methyl orange and methylene blue

In previous versions of the setup, it was necessary to use some very large, expensive pieces of equipment to drive the experiment and assess the rate and efficacy of the reaction (two power sources and a voltmeter, each of which cost several hundred pounds); the Raspberry Pi performs the same function for a fraction of the price, enabling multiple experiments to be run in the lab, and offering the possibility of building a neat, cost-effective unit for use in the real world in the future.

Several of the team have very personal reasons for being involved in the project: Eman Alghamdi is from Saudi Arabia, a country which, despite its wealth, struggles to supply water to its people. Her colleague Jess Mabin was inspired by spending time in Africa working with an anti-poverty charity. They hope to produce a device which will be both cheap to manufacture and rugged enough to be used in rural areas throughout the world.

Jess, a research scientist, smiles as she pipettes methylene blue into a beaker that is part of her group's photocatalysis setup.

Jess demonstrates the experiment: methylene blue going in!

As well as thoroughly testing the reaction rate and the lifespan of the wafer coating, the team are hoping to streamline their equipment by building their own version of a HAT to incorporate the ADC, the photodiode, and other components. Ultimately the Pi and its peripherals could form a small, rugged, cost-effective, essentially self-sustaining device which could be used all over the world to help produce clean, safe drinking water. We are really pleased to see the Raspberry Pi being used in this way, and we wish Jess, Eman, and their colleagues every success!

Edit: We’ve just received this time-lapse of the experimental setup at work (filmed using a Raspberry Pi Camera Module, no less!); you can check it out below: