Page 1 of 1

Mightyohm Geiger counter online (via serial com port)

Posted: Thu Apr 18, 2013 2:46 pm
by chankly
I have setup an online display of counts per minute from my Mightyohm Geiger Counter for background radiation, from Victoria Australia. I am interested in seeing if there are any long term trends, there is virtually no risk of fallout here, the nearest nuclear reactor is thousands of km away. The graphs can be found here:
http://www.chankly.com/geiger/cpm.html
and converted to uSv:
http://www.chankly.com/geiger/usv.html

Graphs of last hour, 4 hours, day, week, etc. Uploaded every 5 minutes (or hourly for the longer time ranges).

There were three aspects that may be of interest to the forum.

1) I used a serial com port converter rather than USB serial port as I preferred not to have to install a driver, when a com port should do the job. See photo attached of the converter (the USB connect is used for power only).

2) I power the Mightyohm from the 5V rail of the serial port converter, and I just used 3 signal diodes in series to reduce the voltage to 3V. This works fine as the current drawn is very low.

3) I pass the serial output from the Geiger counter to a log file, and then parse this log file a line at a time to collect the counts each second. These counts are then accumulated for one minute and stored in an rrdtool database (which provides the graphs). Modes supported are SLOW and FAST, as both provide similar output and I was able to test both. This conversion is done by a perl script. I chose to accumulate the 1 second counts in the perl script; though it would have been easier to take the CPM from the Mightyohm output. The reason I chose to do it that way is that I did not understand the FAST/SLOW mode displays both provided the same CPM information until after I did some testing of the script. This is all running on a Linux PC.

If there is any interest I can provide the perl script, instructions for Linux, rrdtool db configs, rrdtool graph definitions, and any more details required.

Regards, Alan F.

Re: Mightyohm Geiger counter online (via serial com port)

Posted: Mon Apr 22, 2013 11:53 pm
by mightyohm
This is super cool - thanks for sharing!
rrdtool looks perfect for this type of measurement. Reminds me of network bandwidth logs I have seen in the past.

Re: Mightyohm Geiger counter online (via serial com port)

Posted: Sat Aug 31, 2013 3:56 pm
by bfesser
chankly wrote:If there is any interest I can provide the perl script, instructions for Linux, rrdtool db configs, rrdtool graph definitions, and any more details required.
I am very interested, and would greatly appreciate your effort. I'm hoping to connect my to a Raspberry Pi with a LAMP stack to serve up the graph pages on my local network.

Re: Mightyohm Geiger counter online (via serial com port)

Posted: Sun Sep 08, 2013 3:04 am
by chankly
For instructions and the scripts for loading the Mightyohm data into an rrdtool database, and to produce the graphs, see the attached archive. This is for Linux only. Uncompress and extract it to a new directory with "tar xfz gprobe.tar.gz". Extract it to /var/apps/geiger to be consistent with the default location used by the scripts.

See the file mgc.txt for more details.

I have changed a number of the file locations in these scripts to be more tidy, so let me know if there are any mistakes.

Re: Mightyohm Geiger counter online (via serial com port)

Posted: Wed Sep 11, 2013 5:15 pm
by bfesser
Thank you for sharing this. I really appreciate it. Unfortunately, my kit just died (something on the HV-side), so it'll be a little while before I can test your scripts.

Re: Mightyohm Geiger counter online (via serial com port)

Posted: Mon Nov 24, 2014 9:19 pm
by jetson
Chankly

Thanks for the great instructions and scripts. I was able to use them to connect my Mightyohm geiger counter to my Raspberry Pi and post RRD graphs online. Thanks for thinking of things like log rotation. For others following your instructions, I have one small correction in your rrdtool create statements:
rrdtool create geiger.rrd -s 60 DS:geiger:ABSOLUTE:100:0:U \
RRA:ABSOLUTE:0.5:1:50000 \ <-this ABSOLUTE should be AVERAGE
RRA:MIN:0.5:60:8800 \
RRA:MAX:0.5:60:8800 \
RRA:AVERAGE:0.5:60:8800 \
RRA:MIN:0.5:1440:7305 \
RRA:MAX:0.5:1440:7305 \
RRA:AVERAGE:0.5:1440:7305

To manually start the screen command using your directory structure, use:
sudo screen -S gprobe /var/apps/geiger/probe.pl
To see if it's working properly:
tail -f /var/apps/geiger/probe.log

I made a script to start probe.pl automatically in crontab to survive a power failure or other reboot.
sudo crontab -e
@reboot pi /var/apps/geiger/geigerstart.sh

geigerstart.sh
screen -d -m -S gprobe /var/apps/geiger/probe.pl

Re: Mightyohm Geiger counter online (via serial com port)

Posted: Thu Mar 21, 2019 11:08 am
by bgrattan
Hello,
I'm having problems with several of the graphs produced by the program kindly supplied by "chankly" and "jason." The minutes scale seems to be showing odd values 0, 100 m to 500 m with no calculations of max, min and ave. See attached.
However, the uSv graphs seem to be working.
My disadvantage is that I don't really understand the rrdtool syntax and thus can't troubleshoot the problem which is probably very simple.
Can anyone offer help here? Thanks in advance.
Bob
geigerusv_h.png
geiger_h.png

Re: Mightyohm Geiger counter online (via serial com port)

Posted: Fri Mar 29, 2019 3:30 pm
by mightyohm
Bob,

Sorry I can't help you, I'm not familiar with rrdtool either.

Revised: Mightyohm Geiger counter online (via serial com port)

Posted: Sat Jun 13, 2020 7:03 pm
by kpjamro
I went through the script files and figured out how to make the counts graphs work properly. The problem was that the syntax for these used a deprecated format which I guess now a completely not-working format!

The two revised script files are attached.

One thing to note is that for the "alltime" graph, the start time has to be hard-coded by the user. It is in the seconds-since-epoch format. You can get the current time in that format with the Linux command
date +%s

Ken

PS - a further update. It struck me that the Sieverts numbers were just plain wrong (too small). The sbm20 number used to convert CPM to uSv/hr needs to multiply the number of counts per minute (obviously). But the number that is pulled out of the database must be multiplied by 60 to get CPM (as done on the CPM perl script). So I fixed the multiplier to account for the factor of 60. As a "sanity check" I also print a number that is 8760 times the hourly average, for each of the Sievert graphs. This "annual equivalent" number should be in the range of 1 mSv (per year) for most locations - and it is, with my data anyway (around 20 CPM).

Re: Mightyohm Geiger counter online (via serial com port)

Posted: Sun Jun 14, 2020 6:47 am
by bgrattan
Thanks! I’ll give it a try.
Bob