Here’s my latest project with the Pi: interfacing it with the Sparkfun Geiger counter & outputting the resulting data to a character LCD.
The geiger counter is interfaced with it’s USB port, with the random number generator firmware. A Python script reads from the serial port & every minute outputs CPM & µSv/h data to the display.
The Python code is a mash of a few different projects I found online, for different geiger counters & some of my own customisations & code to write the info to the display & convert CPM into µSv/h.
This also writes all the data into a file at /var/log/radlog.txt
The code for this is below:
import time import sys import serial import os import RPIO from RPLCD import CharLCD from subprocess import * from datetime import datetime # configuration settings logfile = "/var/log/radlog" # location to save log data serial_port = "/dev/ttyUSB0" lcd = CharLCD(pin_rs=15, pin_rw=18, pin_e=16, pins_data=[21, 22, 23, 24], numbering_mode=RPIO.BOARD, cols=16, rows=4, dotsize=10) #Init LCD with physical parameters f = open(logfile,"a") ser = serial.Serial(serial_port,9600,timeout=1) one = 0 #Init LCD with initial values. lcd.cursor_pos = (0, 1) lcd.write_string("Geiger Counter") lcd.cursor_pos = (1, 2) lcd.write_string("Initializing") lcd.cursor_pos = (2,-3) lcd.write_string("Please Wait...") lcd.cursor_pos = (3, 0) lcd.write_string(str(0) +" uSv/h") f.write("Geiger Counter Initialized\n") f.flush() while 1==1: stamp = int(time.time()) stamp == round(stamp,0) stamp = stamp + 60 count = 0 while 1==1: ct = int(time.time()) ct == round(ct,0) if ct > stamp: break #Read from serial port bit = ser.read(1) if bit != "": count = count + 1 #Conversion of counts per minute to uSv/hr usvh = count * 0.01 at = str(time.asctime()) t = str(time.time()) #Write line to log file & print info to console f.write("["+at+"."+t+"] "+str(count) + " CPM " +str(usvh) + " uSv/h\n") f.flush() print "["+at+"."+t+"] Count "+str(count) + " " + str(usvh) +" uSv/hr" #Send measurement info to LCD lcd.clear() lcd.cursor_pos = (0, 0) lcd.write_string(datetime.now().strftime('%b %d %H:%M:%S\n')) lcd.cursor_pos = (1, 0) lcd.write_string("Radiation Level:") lcd.cursor_pos = (2, 1) lcd.write_string(str(count) +" CPM") lcd.cursor_pos = (3, -1) lcd.write_string(str(usvh) +" uSv/h")
As the cable supplied with the panel is far too short, inflexible & does not even allow the cable gland on the terminal box to form a seal, I have replaced it with some high quality twin core guitar cable, with silicone insulation.
The cable is removable from the panel tail by means of a screwlock two pin connector.
On another note, I have noticed a side effect of fitting a switchmode regulator to the panel: it seems to have formed an MPPT-type regulator setup, as even in low light conditions, when the bare panel is outputting 18.5v at 50mA short circuit, with the switching regulator I can get a useable 13.25v at ~170mA.
This effect is increased in full light, where I can obtain 4.5A short circuit current & ~1.8A at 13.25v output.
I have acquired a 24W monocrystalline solar panel to charge my portable battery pack while on the move. This panel will be able to charge all devices I carry on a regular basis with nothing but some sunlight!
Info on the panel itself. Rated at 24W with nominal 17.6v DC, 1.36A output.
I have installed a switching regulator in the back of the panel, where the connections would normally be wired straight to the array of cells. This regulates the voltage down to a constant 13.8v to provide more compatibility with 12v charging equipment. I have tested the output of the panel in late day sun, at 1.27A.
Here is a quick look inside the FE-5060A Rubidium Frequency Standard. Above you can see the entire physics package, with the rubidium lamp housing on the right hand side. The ribbon cable running into the resonator cavity has the power & signal traces for the internal heater, temperature sensor & Helmholtz coil.
Here is the lamp end of the physics package, with the voltage regulator & RF driver for the lamp. The FETs soldered to the back of the housing are being used as heaters to maintain a constant temperature on the lamp in operation.
The temperature sensor can be seen between the two FETs, with a single copper wire running around the housing to connect to it.
The final part for the battery pack has finally arrived, the PCM boards. These modules protect the cells by cutting off the power at overcharge, undercharge & overcurrent. Each cell is connected individually on the right, 12v power appears on the left connections. These modules also ensure that all the cells in the pack are balanced.
Inside Electronics by Ben Thomson is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.