Project showcase
Hydrobot "Argolith" and Arduino Data Logging

Hydrobot "Argolith" and Arduino Data Logging © CC BY

Measuring underwater luminosity and temperature with Arduino Uno on hydrobot "Argolith"

  • 5,296 views
  • 1 comment
  • 12 respects

Components and supplies

About this project

During the school year 2014-2015, the hydrobot team implemented the hydrobot project, a prototype marine robotics program from the laboratory of Sea Grant Massachusetts Institute of Technology (MIT) which is distributed, in Greece, by the Interactive Science and Technology Exhibition Eugenides Foundation.

Hydrobot "Argolith" was implemented by the hydrobot team, in the context of the "Technology in the service of the protection of the environment" program. In order to provide "brain" to our hydrobot, we plugged into it the microcontroller Arduino Uno in order to record the values of underwater luminosity and temperature. Moreover, we used a data logging shield, which provides us the real time clock and the recording circuit in the SD Card, where we saved the data of the measurements. In this way, "Argolith" has an electronic brain. The Arduino circuit is in a waterproof case.

All these measurements happened in Litheos River of Trikala.

Building "Argolith" is a project which can offer great solutions in many scientific fields, as technology, electricity, physics, chemistry, biology.

The project was presented in "Researcher's Night 2015", in "Digital Festival 2015", in "FameLab 2016" and the related lesson plan took the 1st place in the 2nd Hydrobots Challenge in its category http://hydrobots.gr/index/?p=4194.

Finally, the Municipality of Trikala awarded the hydrobot team during a planned event on the bank of the river by offering a tablet.

https://www.facebook.com/7geltrhydrobot/?fref=ts

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

Underwater view of Litheos River. The music of the video is "La mer", composed for "Argolith" by a former student of Musical School of Trikala 




Code

Data Logging of underwater temperature and luminosityC/C++
#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#include "RTClib.h"
//Πρόγραμμα καταγραφής δεδομένων 
#define LOG_INTERVAL 30000 // καθέ πότε θα καταγράφονται τα δεδομένα
    
// Τα pin για τα ενσωματωμένα LED
#define redLEDpin 3
#define greenLEDpin 4
     
// Τα ανολογικά pin για τα δεδομένα
#define tempPin 0 //Θερμοκρασία στο 0
#define photoPin 1 //Ο αισθητήρας φωτεινότητας στο Pin Εισόδου 1
RTC_DS1307 RTC; // Καθορισμός του αντικειμένου για την μέτρηση πραγματικού χρόνου Time Clock object
     
     
// Για την σύνδεση της κάρτας μνήμης
const int chipSelect = 10;
     
// Το αρχείο που θα δημιουργηθεί στην κάρτα μνήμης
File logfile;
     

void setup() {
    Serial.begin(38400);
    Serial.println();
    
    Serial.print("Initializing SD card...");
    pinMode(10, OUTPUT);
    // Έλεγχος της κάρτας μνήμης
    if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // Τέλειωσε
    return;
    }
    Serial.println("card initialized.");
    logfile = SD.open("Argolith.csv", FILE_WRITE); //Δημιουργία του αρχείου και άνοιγμα για να γράψουμε
     if (! logfile) {
       
    Serial.print("couldnt create file");
    }
    Serial.print("Logging to: ");
    Serial.println("Argolit.csv");
         Wire.begin();
    if (!RTC.begin()) {
    logfile.println("RTC failed");
     Serial.println("RTC failed");
    }
     
    logfile.println("Millis,Time,Temperature,Lightness,Characteristic"); //Η πρώτη γραμμή θα έχει τις ενδείξεις milliseconds, time, θερμοκρασία
     
    Serial.println("Millis,Time,Temperature,Lightness,Characteristic");
    pinMode(redLEDpin, OUTPUT);
    pinMode(greenLEDpin, OUTPUT);
    logfile.close(); //κλείνουμε το αρχείο για να γράψει τα δεδομένα
       
}
void loop() {
  logfile = SD.open("Argolith.csv", FILE_WRITE); //ξανανοίγουμε το αρχείο για να γράψουμε δεδομένα
  DateTime now; //διαβάζουμε τον χρόνο
 
  // Η καθυστέρηση για την καταγραφή του χρόνου
  delay((LOG_INTERVAL -1) - (millis() % LOG_INTERVAL));
  digitalWrite(greenLEDpin, HIGH);
 
  // Πόσα δευτερόλεπτα έχουν περάσει από την λειτουργία του Arduino
  uint32_t m = millis();
  logfile.print(m); // Γράψε το χρόνο στο αρχείο
  logfile.print(", ");
  Serial.print(m); //Γράψε στη σειριακή θύρα 
  Serial.print(", ");

// Διάβασε την χρονική στιγμή.
now = RTC.now();
// Γράψε την χρονική στιγμή στο αρχείο
logfile.print(now.year(), DEC);
logfile.print("/");
logfile.print(now.month(), DEC);
logfile.print("/");
logfile.print(now.day(), DEC);
logfile.print(" ");
logfile.print(now.hour(), DEC);
logfile.print(":");
logfile.print(now.minute(), DEC);
logfile.print(":");
logfile.print(now.second(), DEC);
Serial.print(now.year(), DEC);
Serial.print("/");
Serial.print(now.month(), DEC);
Serial.print("/");
Serial.print(now.day(), DEC);
Serial.print(" ");
Serial.print(now.hour(), DEC);
Serial.print(":");
Serial.print(now.minute(), DEC);
Serial.print(":");
Serial.print(now.second(), DEC);
delay(10);
//Ξεκίνα την καταγραφή της θερμοκρασίας
int sum=0;
for (int i=0;i<16;i++)
  {
  int tempReading = analogRead(tempPin);
  sum+=tempReading;
  }
// Μετατροπή της αναλογικής εισόδου σε θερμοκρασία
float temperatureC = sum* 0.48828125/16;
logfile.print(", ");
logfile.print(temperatureC);
Serial.print(", ");
Serial.print(temperatureC);
//Γράψε την φωτεινότητα
    int photoval = analogRead(photoPin);
    logfile.print(", ");
    logfile.print(photoval);
    Serial.print(", ");
    Serial.print (photoval);
  
    if (photoval < 10) {
      logfile.print(", ");
      logfile.println("Dark");
      Serial.println(", Dark");
      } 
  else if (photoval < 200) {
      logfile.print(", ");
      logfile.println("Dim");      
      Serial.println(", Dim");
            } 
   else if (photoval < 500) {
     logfile.print(", ");
      logfile.println("Light");     
     Serial.println(", Light");
            } 
   else if (photoval < 800) {
     logfile.print(", ");
      logfile.println("Bright");     
     Serial.println(", Bright");
            } 
    else {
          logfile.print(", ");
        logfile.println("Very bright");                
          Serial.println(", Very bright");
        }
        logfile.close();
digitalWrite(greenLEDpin, LOW);


} 

Schematics

Light sensor measurement connection
Light cdspulldowndiag
Temperature sensor measurement connection
Temperature tmp36fritz

Comments

Similar projects you might like

Temperature & Humidity Data Logging

Project tutorial by MatrixOrbital

  • 3,689 views
  • 0 comments
  • 16 respects

360 Radar (that encodes data onto an image)

Project tutorial by Alireza Karkon

  • 11,518 views
  • 10 comments
  • 43 respects

Simple Data Statistics (Temperature)

by paskino

  • 3,669 views
  • 0 comments
  • 13 respects

Star Wars Lunch Box Data Aquisition

Project showcase by Josh Makatura

  • 7,292 views
  • 1 comment
  • 26 respects

Post Data to a Google Spreadsheet with Temboo

Project tutorial by Temboo_OFFICIAL

  • 1,389 views
  • 0 comments
  • 7 respects

Rube Goldberg Weather Station with Internet Data Storage

Project in progress by randtekk

  • 9,666 views
  • 7 comments
  • 48 respects
Add projectSign up / Login