{ "info": { "author": "Yoan Tournade", "author_email": "yoan@ytotech.com", "bugtrack_url": null, "classifiers": [], "description": "# Raspberry Pi Pocket Geiger library\n\n[![Build Status](https://travis-ci.org/MonsieurV/PiPocketGeiger.svg?branch=master)](https://travis-ci.org/MonsieurV/PiPocketGeiger) [![PyPI version](https://badge.fury.io/py/PiPocketGeiger.svg)](https://pypi.python.org/pypi/PiPocketGeiger/)\n\nA Raspberry Pi library to interface with the [Radiation Watch Pocket Geiger counter](http://www.radiation-watch.co.uk/) (Type 5).\n\n![](/misc/type5.jpg?raw=true \"Radiation Watch Type 5 Pocket Geiger counter\")\n\nThe library monitors the Pocket Geiger through interrupts - using the [RPi.GPIO](https://pypi.python.org/pypi/RPi.GPIO) package - and processes the CPM and hourly [Sievert dose](https://en.wikipedia.org/wiki/Sievert).\n\nLearn more about the Pocket Geiger counter on the Radiation Watch [FAQ](http://www.radiation-watch.co.uk/faqs) and on [our blog](https://blog.ytotech.com/2016/03/04/radiation-watch-raspberry/). Actually it is not a proper Geiger-M\u00fcller counter, but a Photodiode PIN sensor that can effectively counts gamma rays.\n\n# Getting started\n\n## Install the library\n\n[PiPocketGeiger on Pypi](https://pypi.python.org/pypi/PiPocketGeiger/).\n\n### Python 2\n\n```\nsudo pip install PiPocketGeiger\n```\n\n### Python 3\n\n```\nsudo pip3 install PiPocketGeiger\n```\n\n## Wiring\n\nThe Pocket Geiger must be wired to the GPIO ports of the Raspberry Pi. Refer to the GPIO pin specification of your RPi revision.\n\nFor exemple you can wire the radiation and the noise pin on respectively the `GPIO24` and `GPIO23` of your Raspberry Pi.\n\n| Pocket Geiger pin | Raspberry Pi pin | Standing for |\n| ----------------- | ----------- | ------------ |\n| `+V` | `3V3` | Alimentation pin (DC 3V~9V) |\n| `GND` | `GND` | Ground pin |\n| `SIG` | `GPIO24` | Radiation-detection pulse pin |\n| `NS` | `GPIO23` | Noise-detection pulse pin |\n\n![](/misc/wiring.png?raw=true \"Wiring of the Pocket Geiger and Raspberry Pi B+\")\n\nThe pin used are specified at the creation of the library object:\n\n```\nwith RadiationWatch(24, 23) as radiationWatch:\n pass # Do something with the lib.\n```\n\nEven if the Pocket Geiger can handle voltage between 3V and 9V, the [RPi GPIO](https://www.raspberrypi.org/documentation/hardware/raspberrypi/gpio/README.md) only works on 3.3V levels, so **do NOT supply 5V** to your Pocket Geiger, but 3.3V instead.\n\n[Pocket Geiger Type 5 interface specification](http://www.radiation-watch.co.uk/uploads/5t.pdf).\n\n## Initialize the library\n\nYou can either use the `with` statement to initialize an instance of the library. It will automatically bootstrap the instance and properly close it when existing the `with` block.\n\n```\nwith RadiationWatch(24, 23) as radiationWatch:\n # Do something with the lib.\n print(radiationWatch.status())\n```\n\nYou can also manage yourself the lifecycle of the instance, using `setup()` and `close()`.\n\n```\n# Create an instance.\nradiationWatch = RadiationWatch(24, 23)\n# Initialize it (setup GPIOs, interrupts).\nradiationWatch.setup()\n# Do something with the lib.\nprint(radiationWatch.status())\n# Do not forget to properly close it (free GPIOs, etc.).\nradiationWatch.close()\n```\n\n## Getting readings\n\nTo get readings, call the `status()` method:\n\n```\nprint(radiationWatch.status())\n# {'duration': 14.9, 'uSvh': 0.081, 'uSvhError': 0.081, 'cpm': 4.29}\n```\n\nThen do whatever you need with the results. For exemple, [log them to a terminal](https://github.com/MonsieurV/PiPocketGeiger/blob/master/examples/console_logger.py) or [write them on a file](https://github.com/MonsieurV/PiPocketGeiger/blob/master/examples/file_logger.py).\n\n## React on radiation hits\n\nThe library allows to register callbacks that will be called in case of radiation or noise detection, using respectively the `register_radiation_callback()` or `register_noise_callback()`:\n\n```\ndef onRadiation():\n print(\"Ray appeared!\")\ndef onNoise():\n print(\"Vibration! Stop moving!\")\nwith RadiationWatch(24, 23) as radiationWatch:\n radiationWatch.register_radiation_callback(onRadiation)\n radiationWatch.register_noise_callback(onNoise)\n while 1:\n time.sleep(1)\n```\n\nThis can be used to simulate the typical [Geiger counter click sound](https://github.com/MonsieurV/PiPocketGeiger/blob/master/examples/geiger_click.py) or as a random generator.\n\n## Stream in real-time on Plotly\n\nAs a more ellaborate idea, you can stream the data directly to Plotly, allowing to sharing it easily. See the [complete exemple](https://github.com/MonsieurV/PiPocketGeiger/blob/master/examples/plotly_streaming.py).\n\n[![](/misc/plotly_streaming.gif?raw=true \"Real-time streaming. Click to see on Plotly.\")](https://plot.ly/137/~tournadey/)\n\nIn the same vein, you can [upload reading to a Google Docs](https://github.com/MonsieurV/PiPocketGeiger/blob/master/examples/google_docs.py) or also [broadcast on Twitter](https://github.com/MonsieurV/PiPocketGeiger/blob/master/examples/twitter.py).\n\nFinally if you want to contribute to an open-data initiative you can [publish your measurements](https://github.com/MonsieurV/PiPocketGeiger/blob/master/examples/safecast.py) to [the Safecast API](http://blog.safecast.org/). More info on the [SafecastPy lib repo](https://github.com/MonsieurV/SafecastPy).\n\nYes, with a Raspberry Pi, Python and an internet access, there's not so much limits to what you can pretend!\n\n# Note on Noise\n\nRemember the Pocket Geiger can't record correctly in presence of vibration. For a more precise and mobile oriented unit, you may look at the [bGeigie Nano](http://blog.safecast.org/bgeigie-nano/) from the Safecast project.\n\n-----------------------\n\nLike it? Not so much? [Simply tell us](mailto:yoan@ytotech.com). Don't forget to check out [our blog](http://blog.ytotech.com)! :-)\n\nHappy hacking!\n\n### Credits\n\nCreated upon the [Radiation Watch sample code](http://radiation-watch.sakuraweb.com/share/ARDUINO.zip).\n\n### Contribute\n\nFeel free to [open a new ticket](https://github.com/MonsieurV/PiPocketGeiger/issues/new) or submit a PR to improve the lib.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MonsieurV/PiPocketGeiger", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "PiPocketGeiger", "package_url": "https://pypi.org/project/PiPocketGeiger/", "platform": "any", "project_url": "https://pypi.org/project/PiPocketGeiger/", "project_urls": { "Homepage": "https://github.com/MonsieurV/PiPocketGeiger" }, "release_url": "https://pypi.org/project/PiPocketGeiger/0.3.1/", "requires_dist": [ "RPi.GPIO (>=0.5.0a)", "flake8 ; extra == 'dev'", "pylint ; extra == 'dev'" ], "requires_python": "", "summary": "A library for monitoring radiation with the Radiation Watch Pocket Geiger.", "version": "0.3.1" }, "last_serial": 5135911, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "db70f9cee61f210b981ede6acbc37eb3", "sha256": "4b8c4b185301e53852566126a3848c1a453edd7282f404d935ab4bd9e62f35d4" }, "downloads": -1, "filename": "PiPocketGeiger-0.1.tar.gz", "has_sig": false, "md5_digest": "db70f9cee61f210b981ede6acbc37eb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2711, "upload_time": "2015-12-12T03:09:03", "url": "https://files.pythonhosted.org/packages/e6/42/fdeaa331959a5f41e2b249cf22a0697cdb1cdae1a9146f29a6fbe9d4abff/PiPocketGeiger-0.1.tar.gz" } ], "0.1a": [ { "comment_text": "", "digests": { "md5": "f4f1da91964ee7d404979929b2029111", "sha256": "a930b4bcb9b0fae90240636b34fab0c3c53a9c74785ecf94127c0bf7f01c41cb" }, "downloads": -1, "filename": "PiPocketGeiger-0.1a.tar.gz", "has_sig": false, "md5_digest": "f4f1da91964ee7d404979929b2029111", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2789, "upload_time": "2015-12-13T18:36:47", "url": "https://files.pythonhosted.org/packages/3a/fd/66560e1437a27606cdc242b274edd0ae8fe1f4b88179eb5757262cacc39d/PiPocketGeiger-0.1a.tar.gz" } ], "0.1b": [ { "comment_text": "", "digests": { "md5": "21067acc4c1250f8427359440fd5f646", "sha256": "62ce86993fbd9d2f68d150163a62743829d3574af69f7120eafb0857925104a3" }, "downloads": -1, "filename": "PiPocketGeiger-0.1b.tar.gz", "has_sig": false, "md5_digest": "21067acc4c1250f8427359440fd5f646", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2840, "upload_time": "2016-03-06T22:56:56", "url": "https://files.pythonhosted.org/packages/67/e7/88630f2de1dac3206bef57877aa1738fde944f24431544aeb24a46d21cd8/PiPocketGeiger-0.1b.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "95433590fa050e448041a65b59562170", "sha256": "525fe9da71d876932fca75037ce1ed34f8b539a48f75c32aac89653d56f2e718" }, "downloads": -1, "filename": "PiPocketGeiger-0.2.tar.gz", "has_sig": false, "md5_digest": "95433590fa050e448041a65b59562170", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2843, "upload_time": "2016-03-06T23:07:07", "url": "https://files.pythonhosted.org/packages/73/c9/bc2bd98e99bfdfe98c427a6860f72a399673d9e00d669bffd50ea9ae0c37/PiPocketGeiger-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "ff220ec4216652e14d7a09e240f9c0f7", "sha256": "1beb21736ed7fcf77c435acc117ba823cc07b5b6b91ac7732b8812a5328d9e0e" }, "downloads": -1, "filename": "PiPocketGeiger-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ff220ec4216652e14d7a09e240f9c0f7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4745, "upload_time": "2017-09-10T16:09:04", "url": "https://files.pythonhosted.org/packages/a3/67/b9a14ed1112e53eefb5217e44bac17f6adb764a45ffa0e01d9775fb0eb27/PiPocketGeiger-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "695f107a4606cf00856484206a03200d", "sha256": "ca63030b2ee75e90fb2a7de52b92a0e8c72a538aaa2f800957954037e6be53f1" }, "downloads": -1, "filename": "PiPocketGeiger-0.3.tar.gz", "has_sig": false, "md5_digest": "695f107a4606cf00856484206a03200d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5141, "upload_time": "2017-09-10T16:09:05", "url": "https://files.pythonhosted.org/packages/51/fb/453f057daaad83e0a6c81a8c5065e680a1b314605ec10581cfce085a2b27/PiPocketGeiger-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "c54d9dbfc9daa229393ea9071471ce76", "sha256": "bc95248ac66563be774d1593581dc6b62bfadbc967777d0f0362f2bef8f70543" }, "downloads": -1, "filename": "PiPocketGeiger-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c54d9dbfc9daa229393ea9071471ce76", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6728, "upload_time": "2019-04-12T22:15:50", "url": "https://files.pythonhosted.org/packages/dc/29/4ac7e444aa3eb0f8da209fb95b8238f10e34384db84b54cc3f0c7bdab383/PiPocketGeiger-0.3.1-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c54d9dbfc9daa229393ea9071471ce76", "sha256": "bc95248ac66563be774d1593581dc6b62bfadbc967777d0f0362f2bef8f70543" }, "downloads": -1, "filename": "PiPocketGeiger-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c54d9dbfc9daa229393ea9071471ce76", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6728, "upload_time": "2019-04-12T22:15:50", "url": "https://files.pythonhosted.org/packages/dc/29/4ac7e444aa3eb0f8da209fb95b8238f10e34384db84b54cc3f0c7bdab383/PiPocketGeiger-0.3.1-py2.py3-none-any.whl" } ] }