Showing posts with label regenstein. Show all posts
Showing posts with label regenstein. Show all posts

Tuesday, May 16, 2023

Geiger counter back up in Regenstein Library

My long suffering Geiger Counter is back up and running. I used ChatGPT to create a sample Arduino sketch to interact with the pulses coming from the counter and send a per-minute count to the serial port. Then I have a Powershell script write the date-time and the number of counts to a CSV file on a web server. Then I have dygraph.js make a picture of the results. One flaw that is evident is if the Geiger counter connection gets loose, and it does, once it reconnects it looks like there's a sudden surge of rate, which is fake. Also, this whole thing is reliant on powershell running on a Windows box that gets patched frequently. Oh and ChatGPT will make very big mistakes that you absolutely have to catch.
Enjoy this subpar code!
const int geigerPin = 2; // the pin number connected to the Geiger counter output
volatile int count = 0; // variable to count the number of pulses


void setup() {
  // put your setup code here, to run once:

  pinMode(geigerPin, INPUT); // set Geiger counter pin as input
  Serial.begin(9600); // initialize serial communication
  attachInterrupt(digitalPinToInterrupt(geigerPin), pulseCount, FALLING); // interrupt on falling edge of Geiger counter pulse
  pinMode(13, OUTPUT); 
  pinMode(5, OUTPUT);


}

void loop() {
  // put your main code here, to run repeatedly:

  delay(60000); // wait for 1 minute
  detachInterrupt(digitalPinToInterrupt(geigerPin)); // disable interrupt
  float cpm = count; // * 60.0 / 60000.0; // calculate counts per minute -- this seems wrong
  // Serial.print(cpm); // print counts per minute //
  Serial.println(cpm); // print counts per minute
  count = 0; // reset count
  attachInterrupt(digitalPinToInterrupt(geigerPin), pulseCount, FALLING); // re-enable interrupt
}

void pulseCount() {
  count++; // increment pulse count
    digitalWrite(13, HIGH);
    tone(5, 3800, 5);
    delay(50);
    digitalWrite(13, LOW);
  }
  

Powershell:
# Configure serial port settings
$port = new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one


# Loop indefinitely
while ($true) {
# Read integer from serial port
$port = new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
$port.Open()
$number = $port.ReadLine()

# Write number to file
$path = "\\samba\dean\web\counts.csv"
$timestamp=get-date -format s
# // $NewLine = "{0},{1}" -f $date,$number
# Format the data as a CSV string
    $data = "{0},{1}" -f $timestamp , $number.Trim()
#// $NewLine | add-content -path $file
# $string=$date,$number
# //Add-Content $path $string
# Append the data to the file
    Add-Content $path $data

 echo $data
 $port.Close()
  }
  

Sunday, August 14, 2011

7.72 microRads/hr

A 39 day long sampling of every minute leads the geiger counter to a long term average of 7.72 uR/hr. That's 56658 sampling points. That's about what's it's always been.

http://www.blogger.com/img/blank.gif

Wednesday, March 16, 2011

Geiger Counter back up

My long-suffering Geiger counter is now back up and running.
http://www.lib.uchicago.edu/~dean/float.htm.

Now, as has been pointed out, this particular instance of this experiment is really an experiment, and is run only by me, for only experimental purposes. It doesn't represent any opinion or endorsement or opinion of any entity, whether the University of Chicago Library or the University or anything else. It is not a service. It represents nothing, is not calibrated, and should not be relied upon by anyone for anything. Don't email or call anyone but myself about it.

This instance is located in my office on the A-level of the Regenstein Library, the first basement level of a six-story building. The levels average about 8 microrads/hr here. Outside at Ryerson Physical Laboratory on the fifth floor, levels average to about 12 microrads/hr, which indicate the shielding provided by the Regenstein against the cosmic ray flux.

The problem I've been having with this counter was with the associated AW-SRAD software, which runs under DOS, doesn't appear to support virtual COM ports above COM4. On my Windows XP PC I had installed an Arduino which offered a similar USB Serial converter and I theorize at some point there was a conflict and the Geiger counter with its FTDI USB to serial converter took a high COM port at COM5. After removing the Arduino, I then disabled the real serial port at COM1 and forced via Device Manager->Ports->USB Serial Ports the port to go to COM1.

Friday, February 20, 2009

IR focus test: Regenstein Bartlett Quad


Combo visible / near IR image with a Canon S300.
I can't remember if I posted this in the past or not.

Friday, April 20, 2007

IR-block windows

I cut a window out of a piece of polycarbonate to replace the IR-block filter in the modified Canon S300. It's 1.0mm thick, and the infrared block filter was 2mm, so it didn't solve my focus issues. But it helped. I realized today all I need to do is cut another one out and 1+1=2. Sure it won't be optical cement-glued together, or anti-reflective coated, but who cares. I cut the polycarbonate (which is really the protective cover of a package of CD-Rs) with a dremel and ground the sides to fit.


The windows. The cyan one is the original.


This blurry photo is an example. I include it because of the delightful color variations from the mixed lighting. Fluorescents around the periphery and metal halide in the center. The carpet in the center is nearly black to the eye.

UPDATE: Gah. Adding two windows pushes the CCD back too far, resulting in out of focus images.