Friday, July 6, 2012

Putting Everything Together: Part 2: Geiger Counter

So.... putting everything together proved rather tough for the other sensors that requires more complex code.   As I'm not that familiar with C++ (I tend to code in Java/Python) and the use of libraries, I had to read up on how everything worked first. This took a good half of the week, as there were little nuances that kept cropping up whenever I tried to turn the files for reading the BMP085 Pressure/Temperature sensor or the Geiger Counter into libraries. Anyways, today's post is about the Geiger Counter.

The setup with the GeigerCounter looks like this (on the Arduino Mega ADK):



The code (not sure if I should post complete code, since it's technically not mine...?) roughly works like this:

The GeigerCounter.ino file will read input from the sensor continuously. Functions are stored in a header (.h) and source (.cpp) file. Whenever the counter registers a "pick" (a particle hitting the Geiger Tube) an LED on the breakout board that came with the tube will light up. This will prompt the GeigerCounter's computePick() to print out the average rate, the average time gap between each particle hit (in ms), and so on.

We also output the average rate continuously in order to send a stream of data to the cloud. There are also functions that lets us output other useful measurements, such as gap, standard deviation, etc. We will determine later on what specific data we want to transmit.

Having the ability to send "picks" will be useful for the average user, who will probably only want to know when something important is happening. The continuous transmission to the cloud will be useful for scientists/researchers who will need more data.

No comments:

Post a Comment