Hackster is hosting Hackster Holidays, Finale: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Tuesday!Stream Hackster Holidays, Finale on Tuesday!
Lee Cline
Published

PC Case Temperature Monitor

Adding another metric to track computer health and performance.

IntermediateFull instructions provided2 hours850
PC Case Temperature Monitor

Things used in this project

Hardware components

Argon
Particle Argon
×1
Adafruit ADA372 Thermistor
×1
MAX7219 Dot Matrix LED Display Module
×1
Jumper wires (generic)
Jumper wires (generic)
×1

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
Tape, Electrical
Tape, Electrical

Story

Read more

Schematics

Base Particle Argon

This is the base Particle Argon, connecting the ADA372 Thermistor and the MAX7219 LED Matrix Display

Receiver Particle Argon

This is the receiver Particle Argon.

Code

Base Particle Argon

C/C++
This code was used in the base Particle Argon, containing both a thermistor and display, responsible for passing the data to the receiver particle and the ThingSpeak webhook.
// This #include statement was automatically added by the Particle IDE.
#include <ledmatrix-max7219-max7221.h>
#include <math.h>


int C = D7;
int B = A2;
int previouschecktime = 0;
#define Data_Upload_Frequency 10000

    double temperature_celcius() {
      return (25*3950)/(3950+25*log(3.3/(analogRead(B)-1)));
}

LEDMatrix *led;
int bitmapWidth = 8; 
//String text = "Temp:";  
String text = String(temperature_celcius());
int mode = 0;
int textLength = text.length();
int textX = bitmapWidth;
int fontWidth = 5, space = 1;

void drawText(String s, int x)
{
  int y = 0;
  for(int i = 0; i < s.length(); i++) {
    led->drawChar(x + i*(fontWidth+space), y, s[i], true, false, 1);
  }
}

void setup() {
  led = new LEDMatrix(4, 1, D2, D3, D4);
  led->addMatrix(3, 0, 0, false, false);
  led->addMatrix(2, 0, 0, false, false);
  led->addMatrix(1, 0, 0, false, false);
  led->addMatrix(0, 0, 0, false, false);
  
  Particle.variable("M3171G24CaseTempDataOutput",temperature_celcius());
  Particle.subscribe("ReceivedTempDataGroup24",clean);
  pinMode(C, OUTPUT);
}

void loop() {
  if(led != NULL) {
    drawText(text, textX--);
    if(textX < textLength*(fontWidth+space)*(-1)) {
      textX = bitmapWidth;
      led->flush();
      delay(1000);  
      led->fillScreen(false);
    }
    led->flush();
    delay(250);
  }
  else if (led != NULL) {
    led->shutdown(true);
    delete led;
    led = NULL;
  }

temperature_celcius();
if (previouschecktime + Data_Upload_Frequency < millis()){
    previouschecktime = millis();
    Particle.publish("TempDataGroup24", String(temperature_celcius()), PUBLIC);
    }

  Particle.publish("Temperature", String(temperature_celcius()), PRIVATE);
}

void clean(const char *event, const char *data){
    if (data){
    digitalWrite(C, HIGH);
    delay(2000);
    digitalWrite(C, LOW);
    delay(8000);
    }
}

Receiver Particle Argon

C/C++
This code was used for the receiver Particle Argon, which provides a notification via an included LED when the temperature exceeds a certain value.
int B = D7;
int previouschecktime = 0;
#define Data_Upload_Frequency 10000

void setup() {
  Particle.subscribe("TempDataGroup24", temperature);
  pinMode(B, OUTPUT);
}

void loop() {
}

void temperature(const char *event, String data){
    int dataval;
    dataval=String(data).toInt();
    if (dataval >1) 
    {
    digitalWrite(B, HIGH);
    }
    else{
    digitalWrite(B, HIGH);
    delay(1000);
    digitalWrite(B, LOW);
    }
    if ((previouschecktime + Data_Upload_Frequency < millis()) && (dataval)) {
    int previouschecktime = millis();
    delay(2000);
    publishdata();
    }
}

void publishdata() {
    Particle.publish("ReceivedTempGroup24",  PRIVATE); 
    }

Credits

Lee Cline
1 project • 0 followers
Thanks to Matthew Gudlaugsson.

Comments