Brittany Bull
Published © MIT

Serial Dew Point

Quick and easy dew point readings with XinaBox ☒CHIPS and Arduino IDE.

BeginnerProtip4 minutes622
Serial Dew Point

Things used in this project

Hardware components

SW01
XinaBox SW01
×1
XinaBox CC01
×1
IP01
XinaBox IP01
×1
XC10
XinaBox XC10
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

DewPoint.ino

Arduino
Arduino code for due point readings using the XinaBox ☒CHIPS.
#include <xCore.h>  //add core library
#include <xSW01.h>  //add weather sensor library

xSW01 SW01;

const int DelayTime = 500; //Defining set delay time that could be used elsewhere in the code

//Create a variable to store the data read from SW01
float dew_point;

void setup(){

  //Initialise variables to zero
  dew_point = 0;
  
  //Start Serial Monitor
  Serial.begin(115200);

  //Start I2C communication
  Wire.begin();

  //Start SW01 Sensor
  SW01.begin();
  
  //String intro for project
  Serial.println("XinaBox Dew Point Experiment");
  Serial.println("____________________________");

  //Delay for sensor to normalise
  delay(3000);
  
}

void loop(){
  
  //Read and calculate data from SW01
  SW01.poll();

  //Request to get humidity, temperature and dew point data then store in the variables
  dew_point = SW01.getDewPoint();


  //Display recorded data over the Serial Monitor

  Serial.print("Dew Point:");
  Serial.print(dew_point);
  Serial.println("℃ ");

  delay(5000);

}

Credits

Brittany Bull

Brittany Bull

13 projects • 8 followers
A student exploring the world of coding and IoT from a beginners' perspective

Comments