Development

Sensors / Radiation Board:

» RB 04: Frame Class Utility

This is the basic code to create a frame for Radiation Board

Required Materials

1 x Waspmote
1 x Battery
1 x Radiation board
1 x Geiger tube

Notes

- Geiger tube should not be exposed to sunlight because the CPM may not be as accurate as indoors. We advise to use an opaque enclosure when working outdoors to cover this sensor.
- Never touch Geiger-Müller tube ends directly with hands or using any metallic object under any circumstance. Tube ends works with high voltages (up to 500V) which can produce spikes if they are touched. Internal circuits of radiation board and even the user could be seriously affected.
- The battery must be connected in ANY example.
- This example is valid for Waspmote v15
- If you are using a Waspmote v12, you MUST use the proper sensor fields

Code

 /*  
 *  --[RB_v10_04] - Frame Class Utility-- 
 *  
 *  Explanation: This is the basic code to create a frame for 
 *  Radiation Board
 *  
 *  Copyright (C) 2016 Libelium Comunicaciones Distribuidas S.L. 
 *  http://www.libelium.com 
 *  
 *  This program is free software: you can redistribute it and/or modify 
 *  it under the terms of the GNU General Public License as published by 
 *  the Free Software Foundation, either version 3 of the License, or 
 *  (at your option) any later version. 
 *  
 *  This program is distributed in the hope that it will be useful, 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 *  GNU General Public License for more details. 
 *  
 *  You should have received a copy of the GNU General Public License 
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 *  
 *  Version:           3.0 
 *  Design:            David Gascón 
 *  Implementation:    Javier Siscart
 */

#include "WaspSensorRadiation.h"
#include <WaspFrame.h>

// Variable to store measured radiation
float radiationcpm;
float radiationusv;

char node_ID[] = "Node_01";


void setup() 
{
  USB.ON();
  USB.println(F("Frame Utility Example for Radiation Board"));
  
  USB.println(F("******************************************************"));
  USB.println(F("WARNING: This example is valid only for Waspmote v15"));
  USB.println(F("If you use a Waspmote v12, you MUST use the correct "));
  USB.println(F("sensor field definitions"));
  USB.println(F("******************************************************"));

  // Set the Waspmote ID
  frame.setID(node_ID);   

}

void loop()
{
  ///////////////////////////////////////////
  // 1. Turn on the board
  /////////////////////////////////////////// 
  RadiationBoard.ON();
  delay(100);


  ///////////////////////////////////////////
  // 2. Read sensors
  ///////////////////////////////////////////  
  // Read radiation for 5 secs
  radiationcpm = RadiationBoard.getCPM(5000);
  

  ///////////////////////////////////////////
  // 3. Turn off the sensors
  /////////////////////////////////////////// 
  // Power off the board
  RadiationBoard.OFF();


  ///////////////////////////////////////////
  // 4. Create ASCII frame
  /////////////////////////////////////////// 

  // Create new frame (ASCII)
  frame.createFrame(ASCII);

  // Add temperature
  frame.addSensor(SENSOR_RADIATION, radiationcpm);

  // Show the frame
  frame.showFrame();

  //wait 2 seconds
  delay(2000);
}

Output

H#
Frame Utility Example for Radiation Board

******************************************************
WARNING: This example is valid only for Waspmote v15
If you use a Waspmote v12, you MUST use the correct
sensor field definitions
******************************************************
===============================
Current ASCII Frame:
Length: 46
Frame Type: 134
frame (HEX): 3C3D3E86012334313138373036334439333734324634234E6F64655F30312330235241443A302E30303030303023
frame (STR): <=>�#41187063D93742F4#Node_01#0#RAD:0.000000#
===============================
===============================
Current ASCII Frame:
Length: 46
Frame Type: 134
frame (HEX): 3C3D3E86012334313138373036334439333734324634234E6F64655F30312331235241443A302E30303030303023
frame (STR): <=>�#41187063D93742F4#Node_01#1#RAD:0.000000#
===============================

Quick Publish: