Muhammad Akram
Created December 6, 2016

Measurement System for Radioactivity in Buildings

This project shows the design and development stages of a Radon detector.

126
Measurement System for Radioactivity in Buildings

Things used in this project

Software apps and online services

LabVIEW Community Edition
LabVIEW Community Edition
Arduino IDE
Arduino IDE

Story

Read more

Schematics

Lab View Interface

The desired result for Radon counts per minute, Temperature and Relative humidity is serially transmitted from Arduino to the Lab view and displayed on its graphical user interface.

Project Block Diagram

Radon Detector Block Diagram

Arduino Connection Diagram

Power Supply Simulation

Power Supply

Analog Circuit Layout

Analog Circuit Layout

Analog Design Block Diagram

One of the core elements of this project is the analogue amplifier that is the intermediate stage between the sensor and the Arduino board. Its purpose is to amplify the incoming signal from the sensor to measurable levels and sustain the voltage (that indicates the particle energy) long enough for the Arduino to sample it and convey it to the interface. The simulation of the whole circuit was done in Mindi.

Charge Sensitive Amplifier

Peak Detector With Reset

Shaping Amplifier

Arduino Implementation Flowchart

Arduino Implementation Flowchart

Labview General Block Diagram

Labview gets the data serially from Arduino and display the data on GUI.

Labview control panel

Final output is shown on Labview

Code

Arduino Code

Arduino
The Arduino boards read inputs through a sensor and convert it into an output. The instruction to the board is given by writing a code in the Arduino IDE and uploading it to the built-in microcontroller. The programming language is based on Wiring and the Arduino IDE is based on Processing.
//LAST 

#include "DHT.h"
DHT dht;
  
int sensorValue1;//Voltage
int sensorValue2;//Temperature
int sensorValue3;//Humidity
int sensorValue4;//Last voltage 218
int sensorValue5;//Last voltage 214
unsigned long int sensorValue6;//for pcount 218
unsigned long int sensorValue7;//for vcount 214
int volt218;
int volt214;
 int voltage;
     int mincount=0;
     int vcount=0; // Radon 218
     int pcount=0; //Radon 214
    // Variables will change:
 
    long previousMillis = 0;        // will store last time LED was updated
   
    // the follow variables is a long because the time, measured in miliseconds,
    // will quickly become a bigger number than can be stored in an int.
    long interval = 60000;           // interval at which to blink (1 minute)
//      int ledPin = 3;                 // Reset Pin(Peak detector wire connected here for reset)

void setup()
   {

 
   Serial.begin(9600);
   dht.setup(2); // data pin 2

//   pinMode(ledPin, OUTPUT);      // sets the digital pin as output
   pinMode(LED_BUILTIN, OUTPUT); // initialize digital pin LED_BUILTIN as an output.(External LED is also connected on pin 13)
 
   }
    
    
void resetsignal()               //Function definition
{
  
//digitalWrite(ledPin, HIGH);   // sends high signal on pin 3
digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1); // wait for a second
//digitalWrite(ledPin, LOW);    // send low signal on pin 3
 digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
 delay(1); 
//delay(1000); // wait for a second
}

void loop()
    {
         unsigned long currentMillis = millis();
         int sensorValue=analogRead(A0);
         voltage = sensorValue * (5.0 / 1023.0)*100;// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
   
         //Serial.println(voltage);
         //delay(1000);
            if((voltage>20) && (voltage<=100))
              {
      
               vcount=vcount+1;
               resetsignal();   //Send Reset signal after count value by calling resetsignal() fuction
               volt218 = voltage;
              }
           if ((voltage>100) && (voltage<=229))
              {
                pcount=pcount+1;
                resetsignal();   //Send Reset signal after count value by calling resetsignal() fuction
                volt214 = voltage;
               }
             
      if(currentMillis - previousMillis > interval) {
        // save the last time you blinked the LED
        previousMillis = currentMillis;
        mincount=mincount+1;
        /*
//        Serial.println(mincount);    //Track the minute number
         Serial.print("Radon214: ");
        Serial.println(vcount);   
        Serial.print("Radon218: ");
        Serial.println(pcount);

       Serial.print("Humidity: ");
       Serial.print(dht.getHumidity());
       Serial.println(" %, Temp: ");
       Serial.print(dht.getTemperature());
       Serial.println(" Celsius");
       delay(1000); //Delay 2 sec*/

/////////////////////////////////////////////
    //---------- 
    //Data preparation for sending
    //---------- 
    //sensorValue=analogRead(A0);
    sensorValue1 = volt214;//Actual Voltage   
    sensorValue2= dht.getTemperature()*100;        //Temperature
    sensorValue3=dht.getHumidity()*100;            //Humidity
    sensorValue4=volt218;
    sensorValue5=volt214;    
    sensorValue6=vcount;  //Count218
    sensorValue7=pcount;  //Count214
    
    //----------        
    //Data size
    //----------   
    
    //size Voltage
    int count1=1;
    int num1=sensorValue1;
    while(num1>9){
    count1++;
    num1=floor(num1/10);
    }
    int sizeSValue1=count1;
    
    //size Temperature
    count1=1;
    num1=sensorValue2;
    while(num1>9){
    count1++;
    num1=floor(num1/10);
    }
    int sizeSValue2=count1;
    
    //size Humidity
    count1=1;
    num1=sensorValue3;
    while(num1>9){
    count1++;
    num1=floor(num1/10);
    }
    int sizeSValue3=count1;

        //size voltage1
    count1=1;
    num1=sensorValue4;
    while(num1>9){
      count1++;
      num1=floor(num1/10);
     }
    int sizeSValue4=count1;
    
     //size voltage2
    count1=1;
    num1=sensorValue5;
    while(num1>9){
      count1++;
      num1=floor(num1/10);
     }
    int sizeSValue5=count1;
    
    //size count1
    count1=1;
    unsigned long int num2=sensorValue6;
    while(num2>9){
      count1++;
      num2=floor(num2/10);
     }
    int sizeSValue6=count1;
       
    //size count2
    count1=1;
    num2=sensorValue7;
    while(num2>9){
      count1++;
      num2=floor(num2/10);
     }
    int sizeSValue7=count1;
    
    //Packing and sending   
    String sizepack1 =String(sizeSValue1,DEC);  //String data type formed by sensorValue type DEC
    String sizepack2 =String(sizeSValue2,DEC);  //String data type formed by sensorValue type DEC
    String sizepack3 =String(sizeSValue3,DEC);  //String data type formed by sensorValue type DEC
    String sizepack4 =String(sizeSValue4,DEC);  //String data type formed by sensorValue type DEC
    String sizepack5 =String(sizeSValue5,DEC);  //String data type formed by sensorValue type DEC
    String sizepack6 =String(sizeSValue6,DEC);  //String data type formed by sensorValue type DEC
    String sizepack7 =String(sizeSValue7,DEC);  //String data type formed by sensorValue type DEC
                 
    String pack1 =String(sensorValue1,DEC);     //String data type formed by sensorValue type DEC
    String pack2 =String(sensorValue2,DEC);     //String data type formed by sensorValue type DEC
    String pack3 =String(sensorValue3,DEC);     //String data type formed by sensorValue type DEC
    String pack4 =String(sensorValue4,DEC);     //String data type formed by sensorValue type DEC
    String pack5 =String(sensorValue5,DEC);     //String data type formed by sensorValue type DEC
    String pack6 =String(sensorValue6,DEC);     //String data type formed by sensorValue type DEC
    String pack7 =String(sensorValue7,DEC);     //String data type formed by sensorValue type DEC
  
    String DataSeries =String("A"+sizepack1+sizepack2+sizepack3+sizepack4+sizepack5+sizepack6+sizepack7+pack1+pack2+pack3+pack4+pack5+pack6+pack7);//Concatenating
    Serial.println(DataSeries);                 //Sending
///////////////////////////////////////////////
        vcount=0;
        pcount=0;

      }

     }

Credits

Muhammad Akram

Muhammad Akram

1 project • 0 followers

Comments