Mightyohm Geiger counter online (via serial com port)

Support forum for the mightyohm.com Geiger Counter.
http://mightyohm.com/geiger
Post Reply
chankly
Posts: 2
Joined: Thu Apr 18, 2013 2:05 pm

Mightyohm Geiger counter online (via serial com port)

Post 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.
Attachments
Com port TTL level converter
Com port TTL level converter
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

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

Post 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.
bfesser
Posts: 2
Joined: Sat Aug 31, 2013 3:43 pm

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

Post 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.
chankly
Posts: 2
Joined: Thu Apr 18, 2013 2:05 pm

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

Post 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.
Attachments
gprobe.tar.gz
gzipped tar archive of scripts and detailed instructions
(6.71 KiB) Downloaded 1710 times
bfesser
Posts: 2
Joined: Sat Aug 31, 2013 3:43 pm

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

Post 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.
jetson
Posts: 2
Joined: Mon Nov 24, 2014 8:16 pm

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

Post 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
bgrattan
Posts: 5
Joined: Sun Jun 17, 2018 8:33 am
Location: Ashland VA
Contact:

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

Post 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
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

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

Post by mightyohm »

Bob,

Sorry I can't help you, I'm not familiar with rrdtool either.
kpjamro
Posts: 1
Joined: Tue Jun 09, 2020 7:06 pm

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

Post 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).
Attachments
geiger_graph_slow.txt
rename to .sh and make executable
(6.79 KiB) Downloaded 758 times
geiger_graph_quick.txt
rename to .sh and make executable
(2.97 KiB) Downloaded 644 times
Last edited by kpjamro on Fri Jun 26, 2020 6:38 pm, edited 1 time in total.
bgrattan
Posts: 5
Joined: Sun Jun 17, 2018 8:33 am
Location: Ashland VA
Contact:

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

Post by bgrattan »

Thanks! I’ll give it a try.
Bob
Post Reply