Hello All,
I am very new to programming but have been slowly reading and talking to friends and am starting to get an idea of using an arduino for various things.
I have an idea for a project and i wonder if those that are more knowledgeable than me could advise as to feasibility of creating this.
I have an Automess 6150AD-4 geiger counter - a commercially made german radiation detector. It displays the radiation readings on a LCD screen and also outputs the data as binary. The meter acts purely as a transmitter, and outputs the strings exactly 1.049seconds apart and a new string always starts with '02' as demonstrated below.
The automess outputs at 4800baud, 8 bits, no parity, 1 stop bit, and i captured this data on the CoolTerm program on a macbook using a USB-Serial adaptor)
02 14 E2 55 FE 5D
02 14 32 53 FE 8B
02 14 98 50 FE 22
02 14 13 4E FE B7
02 14 A2 4B FE 03
02 14 44 49 FE E7
02 14 F9 46 FE 55
02 14 C1 44 FE 6F
02 14 9B 42 FE 33
02 14 85 40 FE 2F
02 14 02 7D FD 96
02 14 19 79 FD 89
02 14 20 44 FE 8E
02 14 FF 41 FE 54
02 14 DE 7F FD 48
02 14 DE 7B FD 4C
The manufacturer has been very helpful and sent me the technical manual for the output, complete with a QBASIC code for decoding the string. A friend has re-written the string in C for me. The string contains the information of the meter type, and the dose rate.
My plan is to make a Data logger that plugs into the GM counter to log this output, and to tie it to a GPS reading.
All i want to capture is the radiation reading, the GPS location and a time stamp.
The ports of the device i am using to capture that data is GND and Tx, so my plan is to use UNO WITH a TTl to RS232 adaptor, an SD/GPS shield and package it up in a box with a battery (the 6150AD4 also outputs 4.5v which i will explore in future for a power source using a nano and micro SD etc, but for now - UNO and external power)
-
step 1 is get the Automess talking to the arduino, and the arduino logging the binary data to a plain SD card shield
-
step 2 is then to layer in GPS shield and get that logging with the binary data
-
step 3 is to work out how to decode the binary on the arduino so it logs the data as a readable text. (no idea how to do this!)
It is step 3 i am unsure about to be honest, and i am not yet convinced about step 2 either.
Below here is the QBASIC from the manufacturer for decoding the string. I sent them my data grab and they verified it is correct, but left the decoding up to me. I also attach the manufacturers instructions they sent
Any suggestions or comments on this idea welcome,
thanks
Ed
' Variable Types
DEFINT A-W
DEFSNG X-Z
' Constant Expressions
CONST STX = 2
CONST DEVERR = 57
'---------------------------------------------------------------------
'Main Program
'---------------------------------------------------------------------
' Open COM: 4800 Bd, no parity, 8 data bits, 1 stop, no handshake
OPEN "com1:4800,n,8,1,rs,cs,ds,cd" FOR INPUT AS #1
ON ERROR GOTO RecvErr
' Main Loop: read and decode string (6 characters including STX),
' display result, exit on any key.
MainLoop:
DO
WHILE ASC(INPUT$(1, #1)) <> STX: WEND 'wait for STX
sonde = ASC(INPUT$(1, #1)) 'type of detector/6150AD
bc = sonde
mantlo = ASC(INPUT$(1, #1)) 'low order mantissa
bc = bc XOR mantlo
manthi = ASC(INPUT$(1, #1)) 'high order mantissa
bc = bc XOR manthi
expon = ASC(INPUT$(1, #1)) 'exponent
bc = bc XOR expon
IF expon > 127 THEN expon = expon - 256
bc = bc XOR ASC(INPUT$(1, #1)) 'block check
IF bc <> 0 THEN ERROR DEVERR 'block check error
mant = manthi * 256 + mantlo '16 bit mantissa
xdl=mant*2 ^ (expon - 15) 'dose rate as floating point number
GOSUB GetProbe 'set ger$, det$ and unit$
PRINT TIME$; " Device: 6150"; ger$; " Detector: "; det$;
PRINT USING " Reading=########.### "; xdl;
PRINT unit$
LOOP WHILE LEN(INKEY$) = 0 'exit on any key
PRINT "End."
END
'---------------------------------------------------------------------
'set ger$ / det$ / unit$ according to 'sonde'
'---------------------------------------------------------------------
GetProbe:
flag$ = ""
IF sonde >= 128 THEN flag$ = "/E": sonde = sonde - 128
ger$ = "AD2/4/6" + flag$
IF sonde >= 64 THEN ger$ = "AD1/3/5" + flag$: sonde = sonde - 64
det$ = "unknown"
unit$ = "μSv/h"
SELECT CASE sonde
CASE 0
det$ = "Probe AD-0"
unit$ = "cps"
CASE 7
det$ = "Probe AD-b"
CASE 15
det$ = "Probe AD-15"
CASE 17
det$ = "Probe AD-17"
unit$ = "cps"
CASE 18
det$ = "Probe AD-18"
CASE 19
det$ = "Probe AD-19"
unit$ = "cps"
CASE 20
det$ = "internal GM"
CASE 21
det$ = "AD-t low DR"
CASE 22
det$ = "AD-t high DR"
END SELECT
RETURN
' ---------------------------------------------------------------------
' Handler for transmission errors
' ---------------------------------------------------------------------
RecvErr:
IF ERR = DEVERR THEN PRINT TIME$; " Transmission Error": RESUME MainLoop
ON ERROR GOTO 0
ADBUCHSE.pdf (132 KB)