Andrew Jones
Published

MEGR 3171 IOT Fish Tank Temperature Sensor

Device that triggers the temperature of the fish tank and the room temperature in order to satisfy the right temperature for fish life.

IntermediateFull instructions provided5 hours82
MEGR 3171 IOT Fish Tank Temperature Sensor

Things used in this project

Hardware components

Argon
Particle Argon
×1
Breadboard (generic)
Breadboard (generic)
×1
Temperature Sensor
Temperature Sensor
×1
Adafruit Waterproof DS18B20 Digital temperature sensor
Adafruit Waterproof DS18B20 Digital temperature sensor
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Through Hole Resistor, 47 kohm
Through Hole Resistor, 47 kohm
×1

Software apps and online services

Maker service
IFTTT Maker service
Particle Build Web IDE
Particle Build Web IDE

Story

Read more

Schematics

Room Temperature Sensor Schematic

This is the schematic for the Room Temperature circuit

Waterproof Sensor Circuit Schematic

This is the schematic for the water temperature circuit

Code

Waterproof Temperature Sensor (Fishy)

C/C++
Waterproof Temperature sensor to test the temperature of a fish tank
#include "OneWire.h"
#include "DS18.h"
DS18 sensor(D4);

char temp[0];
float temps=0;
int x=0;
int current_temp = 0;
int previous_temp = 0;

void setup() {
    pinMode(D7, OUTPUT);
  Particle.variable("fishy", temp);
}


void loop() {
  //tempSensor();
  x=analogRead(D4);
  current_temp=(((((x*3.3)/4095))*100)*1.8)+32;
  if (abs(current_temp - previous_temp) >=0)
  {
      digitalWrite(D7,HIGH);
      Particle.publish("fishy", String(current_temp),PRIVATE);
      digitalWrite(D7,LOW);
      
  }
  
  previous_temp=current_temp;
  delay(1000);
}

Room Temperature Sensor

C/C++
Takes the temperature of the room surrounding the fish tank
#include "OneWire.h"
#include "DS18.h"
DS18 sensor(D4);

char temp[0];
float temps=0;
int x=0;
int current_temp = 0;
int previous_temp = 0;

void setup() {
    pinMode(D7, OUTPUT);
  Particle.variable("roomtemp", temp);
}


void loop() {
  //tempSensor();
  x=analogRead(D4);
  current_temp=(((((x*3.3)/4095))*100)*1.8)+32;
  if (abs(current_temp - previous_temp) >=0)
  {
      digitalWrite(D7,HIGH);
      Particle.publish("roomtemp", String(current_temp),PRIVATE);
      digitalWrite(D7,LOW);
      
  }
  
  previous_temp=current_temp;
  delay(1000);
}

Credits

Andrew Jones

Andrew Jones

1 project • 2 followers

Comments

Add projectSign up / Login