In the previous part we show how to publish and share our radiation measurements through internet services. But what is their value if we don’t have an appropriate way to navigate, consult, visualize and centralize these measurements with those of others? How to give the measurements a meaning and a purpose?

To do better we should ensure the data will last beyond our enthusiastic-initiative and can be retrieved and exploited by others.

Open data with Safecast

We’re fortunate because this is exactly what the Safecast project aims to provide: an open platform for everyone to publish their environmental data, with great navigation and visualization tools, a real-time portal and last but not least a hacker data oriented mindset.

As they put it, Safecast is a global volunter-centered citizen science project working to empower people with data about their environments.

The Safecast initiative also followed the Fukushima crisis, in an urge to collect and publish accurate and trustworthy open radiation data, openly accessible to citizens of the world1. The volunteer-driven organization has been known to provides efficient technical means, like the bGeigie Nano device, a full-pledged radiation sensor.

Compared to the Radiation Watch Pocket Geiger, the bGeigie it is not cheap2, but way more complete and accurate. With its GPS chip and real-time clock it allows effective mobile radiation measurements. Its pancake can monitor all Alpha, Beta and Gamma radiations. The device has been successfully used to collect millions of data-points.

Past the hardware, maybe the most interesting part is the whole system conceived and maintained by the Safecast community to store, share and consult the data. With the Safecast API measurements can be made available and controlled by citizens, researchers and journalists.

Python wrapping the API

To made things really easier I’ve developed a Python wrapper for the Safecast API: here comes SafecastPy. The implementation was done following the Twitter API wrapper Twython library as a model.

To make it works, that’s the usual Python pip-ABC:

pip install SafecastPy

Then do whatever you want3. Only do please be conscientious about the data you sent to the Safecast API, as this is a voluntarily maintained database. To test things out you can use the development instance, which do not fear messy data.

As Python is a very convenient language to manipulate near any data format you’ll have no difficulty broadcasting you’re own sensor data to the Safecast API. This way your data will gain in power by contributing to a worldwide and open database.

You can also use the library to navigate through the Safecast open-data and use it on your own project.

Radiation Watch feat. Safecast

Coming back to our Pocket Geiger playground, we can now publish its measurements to the Safecast API. That will be our way to create a bridge between these two great initiatives than are Radiation Watch and Safecast.

With the PiPocketGeiger library this is a no-brainer:

# Init the libs.
safecast = SafecastPy.SafecastPy(api_key=API_KEY)
with RadiationWatch(PIN_SIGNAL, PIN_NOISE) as radiationWatch:
  while 1:
    # Get the Pocket Geiger measurement and publish it.
      'latitude': '49.418683',
      'longitude': '2.823469',
      'value': radiationWatch.status().get('uSvh'),
      'unit': SafecastPy.UNIT_USV,
      'captured_at': datetime.datetime.utcnow().isoformat() + '+00:00',
      'device_id': device_id
    # Wait until the next reading.
    time.sleep(5 * 60)

The complete code can be found here.

To test things out I myself maintain one of my Raspberry Pi logging my Pocket Geiger readings to Safecast:

These measurements are published to the Safecast API by my Raspberry Pi, and grabbed back and plotted for you in this browser with plotly.js. Inspect the page to see the javascript sources.

All these measurements can been retrieved directly on the Safecast API website. As you can observe there still isn’t much interesting hazard in my house. Does someone has Cesium 137 to send me?

Fulfilling the promise

Now you can take a Raspberry Pi, get your hand on a Radiation Watch Pocket Geiger, and yeah you’ll have a Geigier counter for your house. The software produced in this series is open-sourced and documented5, so if you have basic hardware and Python skills you surely be able to get it work. No more unnoticed wild rays in your house!

I hope you’ve enjoyed this series. Please don’t miss the chance to tell me! Also if you have projects in the same vein I’ll be very happy to hear from you. I myself have ideas following on from that series6. Maybe you’ll have funnier ones?


1. See complete history here.

2. Nor it is ready to use, as it comes as a kit whose requires some work to assemble.

3. For the usage please refer to the GitHub README.

4. I already apologize for the data logging discontinuity, caused by the very too frequent outages of my internet connection. I really do need to relocate.

5. More or less. Tell me where it’s not good or clear enough.

6. Like putting all that in a box and create a software platform for everyone to easily publish background radiation measurements. It will be the people choice to publish their sensor data to internet services or open-data platforms X or Y - simply by pushing a button. Well, that’s an idea.