Raspberry Pi Geiger Counter

Geiger Counter Setup

Geiger Counter Setup

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")
Info Display

Info Display

Tags: , , , , , , , , , ,

Monday, May 20th, 2013 Hacks, Personal Project, RasPi No Comments

Solar Cable Upgrade & Pseudo-MPPT

New Cable

New Cable

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.

Tags: , , , ,

Monday, May 6th, 2013 Personal Project, Randoms Comments Off

Wearable Raspberry Pi – Solar Charging

 

24W Solar Panel

24W Solar Panel

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 Panel

Info Panel

Info on the panel itself. Rated at 24W with nominal 17.6v DC, 1.36A output.

Regulator

Regulator

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.

 

 

 

Tags: , ,

Wednesday, May 1st, 2013 Hacks, Personal Project, Randoms Comments Off

FE-5680A Rubidium Frequency Standard – Initial Teardown

Physics Package

Physics Package

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.

Lamp End

Lamp End

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.

Main frequency synth board. This contains the RS-232 interface & the AD9830A from Analog Devices. This IC is a direct digital synthesizer & waveform generator.

 

Synthesizer Board

Synthesizer Board

Tags: , , , , , , , , , , , , , , ,

Thursday, April 25th, 2013 Randoms Comments Off

Wearable Raspberry Pi – Some Adjustments

USB Hub

USB Hub

As the first USB hub I was using was certainly not stable – it would not enumerate between boots & to get it working again would require waiting around 12 hours before applying power, it has been replaced. This is a cheapie eBay USB hub, of the type shown below.

These hubs are fantastic for hobbyists, as the connections for power & data are broken out on the internal PCB into a very convenient row of pads, perfect for integration into many projects.

Breakout Hub

Breakout Hub

I now have two internal spare USB ports, for the inbuilt keyboard/mouse receiver & the GPS receiver I plan to integrate into the build.

These hubs are also made in 7-port versions, however I am not sure if these have the same kind of breakout board internally. As they have the same cable layout, I would assume so.

 

Connector Panel

Connector Panel

Here is a closeup of the back of the connectors, showing a couple of additions.

I have added a pair of 470µF capacitors across the power rails, to further smooth out the ripple in the switching power supply, as I was having noise issues on the display.

Also, there is a new reset button added between the main interface connectors, which will be wired into the pair of pads that the Raspberry Pi has to reset the CPU.
This can be used as a power switch in the event the Pi is powered down when not in use & also to reset the unit if it becomes unresponsive.

 

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Monday, April 22nd, 2013 Personal Project, RasPi Comments Off

Wearable Raspberry Pi Part 2.5 – Battery Pack PCM

Battery PCM

Battery PCM

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.

 

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Tuesday, April 16th, 2013 Personal Project, RasPi Comments Off

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 65 other subscribers