This weekend I made a Android/Arduino based web enabled Muon (Cosmic ray) detector. I have to give a tonne of thanks to the team who did it with me (Ramviyas, Olof, Brad, Justin and Hugo) who deserve full credit for making it happen. I should also thank the ERGO Telescope team for thinking up the whole scheme of a distributed cosmic ray observatory in the first place and sending us the missing elements for our project.
Our Muon Source
One ERGO pixel unit (which I hacked)
One Geiger-Muller tube and amp/PSU board (which we didn’t use in the end)
One Arduino MEGA ADK
Arduino Mega ADK
One Android Phone (with GPS, running 2.3.4 or better) – we used a Samsung Galaxy Mini GT-S5570
A CNY17 optocoupler
Some Arduino Code, some Java and some web scripting
Muon Detector (ERGO Pixel)
1) We hooked up the GM tube (in the end I had to hack the LED on the front of the ERGO box) to the Arduino MEGA ADK via a CNY-17 Opto-isolator. The signals out of the Geiger-Muller tube PCB were a bit too noisy to use straight up, and I didn’t manage to build myself a suitable high impedance device/amp to read them directly. We did the whole project in a weekend, so there wasn’t much time for anything!
2)We wrote some Arduino code that will hook up to an android phone and log events with an accuracy of 0.000212s. This is effectively a polling loop which checks a single input pin repeatedly and sends a signal to the Android when it sees a logical high on the input. The code will take any input on pin2 and output a packet with the relative timestamp to the Android. With this method we can resolve to approx 4700 loop cycles within the Arduino, using a counter (declared as a simple int that we add to). The counter is also re-set each 1s by a signal from the Android GPS clock. Counter values at reset are logged to use for a rolling timing calibration, but we didn’t get chance to implement this in the weekend.
3)We wrote an android app that reads NMEA sentences to get the raw time out of the GPS chipset (tested on Samsung phones running Android 2.3.4 and cyanogenmod) and sends a reset to the Arduino every second based on this value. The app also receives signals from the Arduino with the local timestamp (the loop counter in the Arduino) and adds this to the Navstar time (being the correct name for GPS time) We also correct the Arduino timestamp by multiplication with the constant of 0.000212 (our measured resolvable time interval) which bring the Arduino timestamp into seconds. We couldn’t get the date out of the GPS, so the leapsecond (Navstar time is 13 seconds behind UTC at the moment
) correction will be necessary to datestamp it correctly – unless we figure out how to get the date from GPS directly.
The Android App in action
We have a few things that would also be nice to add:
The Arduino code could do with some optimisation – we can probably increase the timing accuracy significantly (but this will obviously take more time than we had over the weekend) to go beyond the 212 microsecond resolution. It’s also running as a polling loop without any de-bounce, so duplicate readings are a distinct possibility. Using interrupts caused problems with the Arduino crashing, I’ll put it on my list to figure out when I have time.
Our system timing and architecture drawing
Timing calibration has been worked out on the back of an envelope, with some work the Android could do a rolling calibration on the Arduino (so that the 4700 loop cycles are adjusted based on observed performance).
A great team!
That’s everything for the moment – here are some links for the resources/websites we used/made: