Saturday, February 21, 2015

Cosmic Ray Telescope



The telescope M1 is well on its way to completion now that the lead sheilding has finally arrived. Here is the first real data from the sensors, the thermal and static noise from the environment has not yet been eliminated this will be done when the cooling system is finished:
114
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
299
968
0
0
293
971
0
0
291
972
0
0
284
976
0
0
277
979
0
0
264
983

Pictures of operation:





Code:
 import processing.serial.*;
 PrintWriter output;
 
 Serial myPort;        // The serial port
 int xPos = 1;         // horizontal position of the graph
 
 void setup () {
 // set the window size:
 size(800, 300);        
  output = createWriter("positions.txt"); 
 // List all the available serial ports
 println(Serial.list());

 myPort = new Serial(this, Serial.list()[0], 9600);
 // don't generate a serialEvent() unless you get a newline character:
 myPort.bufferUntil('\n');
 // set inital background:
 background(0);
 }
 void draw () {
 }
 
void loop(){
 // get string:
 String inString = myPort.readStringUntil('\n');
 
 if (inString != null) {
 //  whitespace:
 inString = trim(inString);

 float inByte = float(inString); 
 inByte = map(inByte, 0, 1023, 0, height);
 
 
 // draw 
 stroke(127,34,255);
 line(xPos, height, xPos,( height - inByte));
 output.println(height-inByte);
 println(height-inByte);
 // at the edge of the screen, go back to the beginning:
 if (xPos &rt;= width) {
 xPos = 0;
 background(0); 
 } 
 else {
 // x++
 xPos++;
 }
 }
 }
 void keyPressed(){
   output.flush(); 
  output.close(); // homefree
   exit();
 }
 

//This is all Arduino now:


int sensorPin = A0;    
  
int sensorValue = 0;  // variable to store the value coming from the sensor



void setup() {
Serial.begin(9600);
}

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);    
  Serial.println((sensorValue));
}


A brief note: The Processing will be 32 bit as the Serial functions are in use. Going with processing because the goal is to distribute these sensors globally. Build list and software hookup instructions will be coming soon for those interested in working on the project.


The idea is to make a global map of the radiation experienced on Earth.

No comments:

Post a Comment