When looking at old projects I realized that my RS232 Geiger counter project was actually somewhat impractical. It wasn't often I could be bothered to hook up a PC with a serial cable when
measuring radiation levels, something which defeated much of the purpose of the counter. Sure it had a nice LCD screen, but being able to quickly take measurements, and then
check a log file once finished would be have been much better. And more importantly, having the possibility to monitor radiation levels at some distance was something I missed quite often.
I have my Android phone with me everywhere, and I had some past experience with using bluetooth on Android, so I thought combining the two could solve this problem. The finished app can be downloaded
for free from Google Play: BluGeiger
Because interfacing with serial ports is so easy, I decided to stick with the Bluetooth Serial Port profile in this project. To make it easy to both debug, and allow the use of 3rd party software
such as terminal programs, I decided to make a serial protocol which was as human readable as possible, while still being easy to implement in a MCU with limited resources. All commands are ended using
a line feed character. The final result was this:
Command
Command type
Direction
READC
Request GM tube specifications
To GM counter, from app
START
Begin sending count values.
To GM counter, from app
HALTT
Stop sending count values.
To GM counter, from app
NAMET:["GM Tube Name as string"]
Name of the GM tube in the counter.
From GM counter, to app
PERID:[x as integer]
Update interval of the GM counter, in milliseconds.
From GM counter, to app
MAXCT:[x as integer]
The highest count rate per seconds supported by the GM counter hardware.
From GM counter, to app
DOSER:[x as float]
The conversion factor, from counts per minute to microSivert/hour. So if 2μSv/hr corresponds to 100 CPM, the conversion factor is 50.0
From GM counter, to app
COUNT:[x as integer]
The last count measurement, taken during the measuring interval.
From GM counter, to app
The idea was to make the first letter of each command unique, and also have same number of letters in each command. Each command is punctuated by a line feed (LF, '\n', or 0x0A) character.
Communication is bi-directional, and uncomplicated. The app will first send a "READC" command until it receives configuration data from the GM counter. Once this is done, the app sends a "START" command so
count values are sent for logging.
From the GM counters perspective, commands to the GM counter can be sent at any time, i.e. there is no state machine other than "transmitting"/"not transmitting" of count values. In it's initial state
the GM counter should not transmit count values, but wait until instructed to do so. Usually the unit reading from the GM counter will want the configuration data before receiving count data. The GM counter
should wait until it receives a "READC" command, after which is sends at least the Tube Name, Maximum counts per seconds, and GM counter update interval in milliseconds. The dose rate conversion factor is an optional
field. E.g. the counter receives a "READC", and proceeds to send the following string: "NAMET:SBM-20\nPERID:1000\nMAXCT:5000\nDOSER:175.0\n". See the table below for an explanation of these fields. When receiving
a "START" command the counter should begin sending strings of "COUNT:XXX\n" where XXX denotes the integer value of the last count rate. These strings should be sent at the interval specified in the "PERID:" command.
When receiving a "HALTT" command the counter should stop sending "COUNT:XXX\n" strings.
The data to fill in for each field should be easy to find, with the exception of the maximum count rate. If one can find a chart of the gamma sensitivity of the tube, the maximum count rate would be where the
slope of the curve stops being linear. This assumes the counting circuitry itself is able to keep up, and discriminate pulses at that frequency. In the example below for the popular SBM-20 GM tube, the maximum
counts per second value is just a wild guess from my side.
Data Field
Value
Command
Command String
Tube name
SBM-20 (String)
NAMET:
NAMET:SBM-20
Maximum counts per seconds
1000 (Integer)
PERID:
PERID:1000
GM counter update interval in milliseconds
5000 (Integer)
MAXCT:
MAXCT:5000
Conversion rate, in CPM/μSv/hr
175 (Float)
DOSER:
DOSER:175.0
Counts measured during the last read interval
12345 (Integer)
COUNT:
COUNT:12345
The data in the table above is used by the app to scale the reading so it is possible to tell when the GM tube is about to saturate. It is also used to convert the current CPM reading to an estimated dose rate. So far I have used this
app to interface with one of my Geiger counters, which can be seen here. During debugging of this app I made a Golang simulator of the GM counter behavior, which may be useful when
implementing a GM counter compliant to the protocol used in this app. The Golang code can be downloaded here, and uses this serial library.
Disclaimer:
I do not take responsibility for any injury, death, hurt ego, or other
forms of personal damage which may result from recreating these
experiments. Projects are merely presented as a source of inspiration,
and should only be conducted by responsible individuals, or under the
supervision of responsible individuals. It is your own life, so proceed
at your own risk! All projects are for noncommercial use only.