Connor RiceAlexa Caldwell
Published © GPL3+

MEGR 3171 - Fall 2019 - Shower Temperature Measurement

This project involves incorporating two particle argon devices and measuring the ideal shower temperature.

BeginnerShowcase (no instructions)15 hours73
MEGR 3171 - Fall 2019 - Shower Temperature Measurement

Things used in this project

Hardware components

Argon
Particle Argon
×2
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×2
Breadboard (generic)
Breadboard (generic)
×2
Resistor 220 ohm
Resistor 220 ohm
×3
Resistor 10k ohm
Resistor 10k ohm
×1
Adafruit 10K Precision Epoxy Thermistor
×1
Jumper wires (generic)
Jumper wires (generic)
×13
LED (generic)
LED (generic)
Red, Green, Yellow
×3

Software apps and online services

ThingSpeak API
ThingSpeak API
Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Schematics

Particle Argon 1

Argon that directly measures water temperature

Particle Argon 2

Argon that receives and displays corresponding light

Circuit Diagram - Argon 1

Circuit Diagram - Argon 2

Yellow Circle = Too Cold; Green Circle = Nominal; Red Circle = Too Hot

Code

Temperature Sensor Code

C/C++
This is the code that the Argon in the shower used read and send the temperature data obtained from the thermistor.
#include <math.h>

int ThermistorPin = A5;
int Vo;
double R1 = 9970;
double logR, R2, T, Tc;
double c1 = 0.001129148, c2 = 0.000234125, c3= 0.0000000876741; 

void setup() {
   pinMode(D7, OUTPUT);
    Particle.subscribe ("light_on_accr", Lightaccr);
    pinMode (ThermistorPin, INPUT);
}

void loop() {
  // Gets data from the Thermistor and converts it into usable temperature data
  Vo = analogRead(ThermistorPin);
  R2 = R1/(4096.0/((double)Vo-1));
  logR = log(R2);
  T = (1.0 / (c1 + (c2 * logR) + c3 *( logR * logR * logR)));
  Tc = T - 273.15; 
  // Sends the data to the other argon
  Particle.publish("accr_temperature", String(Tc));
  //Sends the data to the live graph
  Particle.publish("temperature_in_C", String(Tc));
  // Wait 15 seconds
  delay(15000);
}
 // Acknowledgement that the data was received by the other Argon
void Lightaccr(const char *eventName, const char *data)
{ 
    digitalWrite(D7, HIGH);
 } 

Temperature Indicator Code

C/C++
This is the code used for the Argon that displays the light according to the temperature of the water in the shower.
float V=1;
int led1;
void setup() {
    pinMode(D6, OUTPUT);
    pinMode(D5, OUTPUT);
    pinMode(D4, OUTPUT);
    Particle.subscribe ("accr_temperature", Light);
}
 // Turns on the lights depending on the temperature range
void Light(const char *event, String data) {
    led1=data.toInt();
    if (led1<=37.7){
        digitalWrite(D6, HIGH);
        digitalWrite(D5, LOW);
        digitalWrite(D4, LOW);
    }
    else if (led1>=37.7 && led1<= 43.3){
        digitalWrite(D5, HIGH);
        digitalWrite(D4, LOW);
        digitalWrite(D6, LOW);  
    
    }
    else if (led1 >= 43.3){
        digitalWrite(D4, HIGH);
        digitalWrite(D5, LOW);
        digitalWrite(D6, LOW);   
    }
    else {
        digitalWrite(D6, LOW);
        digitalWrite(D5, LOW);
        digitalWrite(D4, LOW);
    }
    String connect = String(V);
Particle.publish("light_on_accr");

}

Credits

Connor Rice

Connor Rice

1 project • 0 followers
Alexa Caldwell

Alexa Caldwell

1 project • 0 followers
Thanks to Kyle Tucker, Dylan Duplessis, Jerry Autry, and Douglas Lawrence .

Comments

Add projectSign up / Login