Raul Alberto Castrillon Lopez
Published

Monitor Carbon Monoxide and Dew Point

Telemetry system that provides real -time behavior of carbon monoxide and dew point in the production of medical air.

AdvancedWork in progress5 days1,126
 Monitor Carbon Monoxide and Dew Point

Things used in this project

Hardware components

HYGRODYNAMICS DEW POINT MONITOR MODELS 8092
Dew point monitor
×1
RAM 4021-DPX
monitor carbon monoxide
×1
Resistor 100 ohm
Resistor 100 ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×1
poyurethane box
×1
Android device
Android device
Site display system
×1

Software apps and online services

Arduino IDE
Arduino IDE
Ubidots
Ubidots

Hand tools and fabrication machines

Drill
1/8 drill bit for wall
plastic tie
Tie plastic cable from monitors to catch up Linkit ONE

Story

Read more

Schematics

electronic chart

This diagram describes how LinkIT ONE connection between and monitors carbon monoxide and dewpoint

Code

Datalogger carbon monoxide and dew point

Arduino
Datalogger carbon monoxide and dew point , this code describes how to capture through 2 terminals analog conversion digital data measured 2 analyzers of these variables , then processed to standardize them and send them to the platform UBIDOCTS where it is possible to observe
/*
 REGISTRADOR DE DATOS 

Data recorder sent to the platform UBIDOCTS values ​​monoxido carbon and dew point in the production of medicinal air Clinic North
based on the Web Client example created 13 July 2010

 modified 29 Jan 2016
 by Raul Castrillon Lopez
*/

#include <LTask.h>
#include <LWiFi.h>
#include <LWiFiClient.h>
#include <LBattery.h>

#define WIFI_AP "AP_PISO_S2_A"         //wireless network name
#define WIFI_PASSWORD "**APPISOS2A_P0s31d0n**"  // Key
#define WIFI_AUTH LWIFI_WPA  // choose from LWIFI_OPEN, LWIFI_WPA, or LWIFI_WEP.

// Ubidots information

#define URL        "things.ubidots.com"
#define TOKEN       "xxxxxxxxxxxxxxxxxxxxxxx"   // replace with your Ubidots token generated in your profile tab
#define VARIABLEID1 "xxxxxxxxxxxxxxxxxxxxxxx"   //Punto de rocio
#define VARIABLEID2 "xxxxxxxxxxxxxxxxxxxxxxx"   //Monoxido de carbono


int counter = 0;
void enviar_uno(void);
void enviar_dos(void);

void setup()
{
  LTask.begin();
  LWiFi.begin();
  Serial.begin(9600);

  // keep retrying until connected to AP
  Serial.println("Connecting to AP");
  while (0 == LWiFi.connect(WIFI_AP, LWiFiLoginInfo(WIFI_AUTH, WIFI_PASSWORD)))
  {
    delay(1000);
  }
}

void loop()
{ 
  enviar_uno();
  enviar_dos();
  for (char i=0;i<120;i++){
  delay(1000);
  }
}

///////////////////////////////**************************************//////////////////////////////////
void save_value1(String value){
 
  Serial.println("Sending value to Ubidots...");
  LWiFiClient c;
  while (!c.connect(URL, 80))
  {
    Serial.println("Retrying to connect...");
    delay(100);
  }

  String data = "{\"value\":"+ value + "}";
  String thisLength = String(data.length());
  
  // Build HTTP POST request
  c.print("POST /api/v1.6/variables/");
  c.print(VARIABLEID1);
  c.print("/values?token=");
  c.print(TOKEN);
  c.println(" HTTP/1.1");
  c.println("Content-Type: application/json");
  c.println("Content-Length: " + thisLength);
  c.print("Host: ");
  c.println(URL);
  c.print("\n" + data);
  c.print(char(26));

  // read server response
  
  while (c){
    Serial.print((char)c.read());
  }
  
  c.stop();
  
}
/////////////////////////////////////////*********************//////////////////////////

void save_value2(String value){
 
  Serial.println("Sending value to Ubidots...");
  LWiFiClient c;
  while (!c.connect(URL, 80))
  {
    Serial.println("Retrying to connect...");
    delay(100);
  }

  String data = "{\"value\":"+ value + "}";
  String thisLength = String(data.length());
  
  // Build HTTP POST request
  c.print("POST /api/v1.6/variables/");
  c.print(VARIABLEID2);
  c.print("/values?token=");
  c.print(TOKEN);
  c.println(" HTTP/1.1");
  c.println("Content-Type: application/json");
  c.println("Content-Length: " + thisLength);
  c.print("Host: ");
  c.println(URL);
  c.print("\n" + data);
  c.print(char(26));

  // read server response
  
  while (c){
    Serial.print((char)c.read());
  }
  
  c.stop();
  
}

void enviar_uno (void){
  float dato_analogo=0;
  dato_analogo=analogRead(A0);
  dato_analogo=(dato_analogo*5)/1024;  
  
  dato_analogo=(dato_analogo-32)/1.800;
  save_value1(String(dato_analogo));
}

void enviar_dos (void){
  float dato_analogo=0;
  dato_analogo=analogRead(A2);
      
  dato_analogo=(dato_analogo*5)/1024;

  dato_analogo=dato_analogo-0.5;  
  dato_analogo=dato_analogo/0.02;
  if (dato_analogo<0){
    dato_analogo=0;
  }
  else {
    dato_analogo=dato_analogo;
  }
    
  save_value2(String(dato_analogo));
}

Credits

Raul Alberto Castrillon Lopez

Raul Alberto Castrillon Lopez

1 project • 2 followers
Electronic engineer, passionate about design and programming of embedded systems

Comments