Project showcase
Wa.Te.X. the Robot Explorer

Wa.Te.X. the Robot Explorer © CC BY

Exploring for methane, for water and the temperature on the surface of an unknown planet.

  • 4,168 views
  • 0 comments
  • 15 respects

Components and supplies

About this project

Wa.Te.x. is the project that participated in the World Robot Olympiad 2015, in Doha, Qatar, in the Open Category. It is a project implemented by the B.E.A.S.T., the Robotics team of the 7th Senior High School of Trikala, Greece

http://7lyk-trikal.tri.sch.gr/

Wa.Te.x., the robot explorer, consists of two different technologies: a Lego EV3, that is programmed to move, and an Arduino circuit with the sensors for the data logging. More specifically:

1. a Lego EV3 motor, that provides and constitutes the Wa.Te.x's movement

2. two Ultrasonic sensors that catch sight of possible obstacles back and forth, like a volcano

3. two contact sensors

4. an Arduino circuit for the temperature sensor, the gas sensor and the ph meter

5. an Arduino WiFi Shield for the wireless connection with the WiFi hot spot, which is a smartphone

6. a temperature sensor

7. a gas sensor MQ4

8. a ph meter

9. a battery for the Arduino circuit

We need a real time online update of the data that Wa.Te.x. records. So, via the WiFi Shield, the wireless connection WiFi and the cloud platform Xively, the robot explorer sends in real time the data from the ph meter, the gas sensor and the temperature sensor to the platform, and they are presented in a plot form as well.

The scenario is:

1. During its exploration, Wa.Te.x. discovers on the surface of the unknown planet two dimples with water.

2. Its mission is to check the water ph with the ph meter and to record the temperatures on the planet surface.

3. At the same time, it detects the possible existence of methane via the gas sensor.

4. Between the two dimples with water- the one of which contains drinkable water and the other one acid water (vinegar) - two very active volcanoes are located that explode, making our robot explorer's mission harder.


Code

Data_Logging on Xively for temperature and phArduino
/*Δημιουργήθηκε προκειμένου να μετράει θερμοκρασία αλλά και ph και να στέλνει τα στοιχεία στο Xively μέσω WiFi*/

#include <SPI.h>
#include <WiFi.h>
#include <HttpClient.h>
#include <Xively.h>

char ssid[] = "";   //  WiFi SSID
char pass[] = "";    // Password for WiFi SSID
int keyIndex = 0;            // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;

// To API Key του Xively προκειμένου να στείλουμε δεδομένα
char xivelyKey[] = "It";
//Χively feed ID
#define xivelyFeed 5
//datastreams (ονομάτα καναλιών του xively
char PhID[] = "Ph";
char TempID[]="Temperature";

// Pin για θερμοκρασία και για Ph
#define PhPin A0
#define TempPin A3


// Define the strings for our datastream IDs
XivelyDatastream datastreams[] = {
  XivelyDatastream(PhID, strlen(PhID), DATASTREAM_FLOAT),
  XivelyDatastream(TempID, strlen(TempID), DATASTREAM_FLOAT),
};
// Finally, wrap the datastreams into a feed
XivelyFeed feed(xivelyFeed, datastreams, 2 /* number of datastreams */);

WiFiClient client;
XivelyClient xivelyclient(client);

void printWifiStatus() {
  // To SSID του δικτύου
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // Η διεύθυνση IP που πήρε η WiFi Shield
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // Η δύναμη του σήματος
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm \n");
}
//Η διαδικασία που καλείται για να επιτευχθεί η σύνδεση με το WiFi δίκτυο
void connectWiFi()
{
    // Δεν αν υπάρχει σύνδεση με την WiFi shield
  if (WiFi.status() == WL_NO_SHIELD)
  {
    Serial.println("[ERROR] WiFi Shield Not Present");
    // Do not continue
    while (true);
  }
 
  // Προσπάθει να γίνει σύνδεση
  while ( status != WL_CONNECTED)
  {
    Serial.print("Attempting Connection - WPA SSID:");
    Serial.println(ssid);
 
    status = WiFi.begin(ssid, pass);
  }
 
  // Connection successful
  Serial.print(" Connection Successful");
  Serial.print("");
  Serial.println("-----------------------------------------------");
  Serial.println("");
}
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  //pin setup
  pinMode(PhPin, INPUT);
  pinMode(TempPin, INPUT);
  pinMode(13,OUTPUT); 
  Serial.println("Starting single datastream upload to Xively...");
  Serial.println();

 connectWiFi();
  printWifiStatus();
}


void loop() {
  int getReturn = xivelyclient.get(feed, xivelyKey);    //Επικοινωνία με την πλατφόρμα xively
  if(getReturn > 0){
    Serial.println("Ph Datastream");
    Serial.println(feed[0]);
  }else Serial.println("HTTP Error");

  //Για την μέτρηση του Ph
  unsigned long int avgValue;  //Για την μέση τιμή του αισθητήρα
  float b;
  int buf[10],temp;
  for(int i=0;i<10;i++)       //Λήψη 10 δειγμάτων για πιο σωστή μέτρηση
  { 
    buf[i]=analogRead(PhPin);
    delay(10);
  }
  for(int i=0;i<9;i++)        //Ταξινόμηση των δειγμάτων από την μικρότερη προς την μεγαλύτερη
  {
    for(int j=i+1;j<10;j++)
    {
      if(buf[i]>buf[j])
      {
        temp=buf[i];
        buf[i]=buf[j];
        buf[j]=temp;
      }
    }
  }
  avgValue=0;
  for(int i=2;i<8;i++)                      //Λήψη της μέσης τιμής από τα 6 δείγματα
    avgValue+=buf[i];
  float phValue=(float)avgValue*5.0/1024/6; //μετατροπή της μέτρησης σε milivolt
  phValue=3.5*phValue;

 //Για την μέτρηση της θερμοκρασίας
  int tempReading = analogRead(TempPin);    
  // Μετατροπή σε τάση
  float voltage = tempReading * 5 / 1024.0;  
  // Μετατροπή σε θερμοκρασία
  float celsius = (voltage - 0.5) * 100 ;  
                       
  datastreams[0].setFloat(phValue);
  datastreams[1].setFloat(celsius);
  
  //Εκτύπωση των τιμών
  Serial.print("Read sensor value ");
  Serial.println(datastreams[0].getFloat());
  Serial.println(datastreams[1].getFloat());

  //send value to xively
  Serial.println("Uploading it to Xively");
  int ret = xivelyclient.put(feed, xivelyKey);
  //return message
  Serial.print("xivelyclient.put returned ");
  Serial.println(ret);
  Serial.println("");
  
  
  //delay between calls
  delay(15000);
}

Schematics

Data Logging charts on Xively
Xively

Comments

Similar projects you might like

MeArm Robot Arm - Your Robot - V1.0

Project tutorial by Benjamin Gray

  • 28,110 views
  • 4 comments
  • 41 respects

Ball Tracking Robot

Project showcase by Rohan Juneja

  • 51,092 views
  • 41 comments
  • 102 respects

Elliot the Line Follower Robot

Project showcase by SMM2

  • 10,664 views
  • 5 comments
  • 25 respects

Make your first Arduino robot - The best beginners guide!

Project tutorial by Muhammed Azhar

  • 68,364 views
  • 19 comments
  • 154 respects

Amazing 6WD Off-Road Robot | Arduino RC Robot

Project tutorial by Jithin Sanal

  • 8,695 views
  • 0 comments
  • 53 respects

Super Easy to Build 1Sheeld 2 Wheel Drive Robot

Project tutorial by Garry Gerwer and Ahmed Hamdy

  • 20,182 views
  • 3 comments
  • 35 respects
Add projectSign up / Login