GithubHelp home page GithubHelp logo

arduinopocketgeiger's Introduction

Arduino Pocket Geiger library

An Arduino library to interface with the Radiation Watch Pocket Geiger counter (Type 5).

The library monitors the Pocket Geiger through interrupts, processes the hourly Sievert dose and allows to get back the data using a simple interface. It comes with examples to print data to Serial or log it on a SD card, giving you some ideas of what to do with it.

Learn more about the Pocket Geiger counter on the Radiation Watch FAQ or on our blog. Actually it is not a proper Geiger-Müller counter, but a Photodiode PIN sensor that can nevertheless effectively counts Gamma radiation.

Getting started

Install the library

Go the Arduino Library Manager and search for RadiationWatch: install, that's it!

Alternatively download the library as a zip, extract it and put it in your Arduino libraries folder. (see instructions)

If you link the command-line, check CLI.md for arduino-cli installation and getting started instructions.

Wire your Pocket Geiger board to your Arduino

First connect your Pochet Geiger Type 5 board to your Arduino. By default, the binding used is as follow:

Pocket Geiger pin Arduino pin Standing for
+V 5V Alimentation pin (DC 3V~9V)
GND GND Ground pin
SIG 2 Radiation-detection pulse pin
NS 3 Noise-detection pulse pin

You can change the pins used by the library at its initialization. Remember to use pins that enable external interrupts.

/*
signPin is the radiation pulse pin, which must match the signIrq number.
noisePin is the noise pulse pin, which must match the noiseIrq number.
*/
RadiationWatch radiationWatch(signPin, noisePin);

Pocket Geiger Type 5 interface specification.

Look at the buildlogs folder for more step by step instructions.

Launch the Serial printer example

Go to your Arduino examples and launch the RadiationWatch -> SimpleSerialPrinter sketch. It outputs to the serial port the current emission level for each gamma ray that hits the Pocket Geiger counter.

Your done! Enjoy your -hopefully- low exposure to Gamma radiation.

Plot in real-time with Python

Load the RadiationWatch -> SerialCsvLogger sketch to your Arduino. Then launch the Python script serial_plot.py.

You need Python installed with matplotlib and pyserial. You may need to set the serial port corresponding to your Arduino in the Python script.

The script will output the radiation level in real-time.

Log the results to an SD card

You'll need the Arduino Ethernet shield (recommended) or the SparkFun microSD shield.

Load the RadiationWatch -> SdCardCsvLogger sketch to your Arduino. The radiation measurements will be stored in a rad.csv file on the microSD card, so you can then retrieve and process them later.

Remember however the Pocket Geiger can't record correctly in presence of vibration, so try to keep the whole stationary during the measurements. For an advanced mobile unit of measurement you may look at the bGeigie Nano from the Safecast project.


Misc.

Find this cool? Check out our blog or send us a note.

This lib was featured on the Radiation Watch website.

If you search a building idea, the Playspoon fully integrated LCD Geiger counter may inspire you.

Happy hacking!

Credits

Created upon the thomasaw and Tourmal libraries, themselves based on the Radiation Watch sample code.

@puuu contributed some major enhancements to the library structure (see #4 and #5).

Contribute

Feel free to open a new ticket or submit a PR to improve the lib.

arduinopocketgeiger's People

Contributors

monsieurv avatar puuu avatar thomasaw avatar toumal avatar wesleynw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduinopocketgeiger's Issues

Only recieve data when I tap the sensor

Hi,

I am using an Arduino Nano IoT 33 and am experiencing similar behavior to the behavior described in issue 11. I only receive data when I tap the sensor
I am using version 0.6.4 of RadiationWatch install via Arduino libraries.
Could you help with this please?

Thanks,
Ewan

Interrupts broken on latest Arduino Libraries

On the latest Arduino Libraries, using interrupts has changed significantly. Your code generates : `ISR not in IRAM!

Abort called`

I'm looking at how to fix it, but so far have not found a solution.

Measures seems unreliable when working with IRQ

Working with interrupts on an Arduino Uno seems to give incorrect result when the acquisition runs over a long period of time (more than a couple of minutes).

I've done a series of tests using alternatively:

  1. my fork of the Arduino library with IRQs, or the one from Tourmal
  2. The Arduino library from thomasaw, which is an adaptation of the Radiation Watch Arduino sketch into an Arduino library
  3. The very original Arduino sketch from Radiation Watch sample codes

The first gives results around 11 nSv/h after more than, whereas the two others gives measures of ~50 nSv/h, with stable results over all the acquisition time. Note that the first one have also results around 50 nSv/h the first minutes of the acquisition, but after some time the results drops to stabilize around 11 nSv/h.

The tests were run on the same environnement and over a period of time superior than 20 minutes (knowing that the recommanded acquisition time to have reliable results with the type 5 Radiation Watch is 2 min see Radiation Watch spec chart).

I have no test bench or other counter geiger to validate that the measures are good, but something seems wrong with the Arduino library that uses IRQ.

I'll do tests again with data logging to be able to really compare the results

Doesn't compile on non-AVR architectures

RadiationWatch.cpp doesn't run on non-AVR architectures like the ARM SAMD M0 (Arduino Zero) for a couple reasons:

  1. The calls to dtostrf() produce compiler errors. The fix for this is straightforward. In RadiationWatch.cpp, just after the line #include "RadiationWatch.h" add the following:

ifndef ARDUINO_ARCH_AVR

include <avr/dtostrf.h>

endif

You'll also need to edit the dtostrf.c library file, as jsmith describes in this thread: http://forum.arduino.cc/index.php?topic=368720.0

  1. The two instances of function calls like this:
    pinMode(PinNumber, INPUT);
    digitalWrite(PinNumber, HIGH);
    need to be changed to:
    pinMode(PinNumber, INPUT_PULLUP);
    This change is backwards compatible (at least with Ardunio IDE 1.6.5 and later) and so this code works fine on AVR-based systems too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.