Chris CervantesChris KirschAaron Stuber
Published © GPL3+

PC Case Monitoring System

This is a collection of sensors that monitors PC Case Temp, RGB status, and Fan RPM.

BeginnerShowcase (no instructions)Over 4 days100
PC Case Monitoring System

Things used in this project

Hardware components

Photon 2
Particle Photon 2
×3
ELEGOO Upgraded 37 in 1 Sensor Modules Kit V2.0
ELEGOO Upgraded 37 in 1 Sensor Modules Kit V2.0
×2
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×3
NI myDAQ with LabVIEW and Multisim 30-day Evaluation Software
Digilent NI myDAQ with LabVIEW and Multisim 30-day Evaluation Software
×1

Software apps and online services

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

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
x-acto blade
Digilent Screwdriver
Digilent Screwdriver

Story

Read more

Schematics

RPM Schematic

DH11 Schematic

Photo Resistor Schematic

Code

Photo Resistor

Arduino
int input = 0;

void setup() { 
    Particle.connect();
    Particle.subscribe("temp", temperatureHandler);
}

void loop() {
input = analogRead(A0);

Particle.publish("mvolt", String(input));

delay(10000);

}

void temperatureHandler(const char *event, const char *data) {
    int temerature = atoi(data);
}

Humidity & Temperature Sensor

Arduino
Code measures the humidity & temperature sensor. Functions by first identifying a variable for humidity and temperature. Then every 10 seconds will take another sample and upload it to Thingspeak. The LED turns on when the particle device is recording data.
// libaries
#include "Adafruit_DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11

//pin types, and inital variables
DHT dht(DHTPIN, DHTTYPE);
int led = D7;
int temp = 0;
int humid = 0;
bool startLoop = true;

//setup and pull subscribe values
void setup() {
  Serial.begin(9600);
  Serial.println("DHTxx test!");
  pinMode(led, OUTPUT);
  dht.begin();

  Particle.subscribe("rpm", rpm, PRIVATE);
  Particle.subscribe("mvolt", mvolt, PRIVATE);
}

//check if rpm values are zero, if so then don't run particle data
void rpm(const char *event, const char *data) {
  int rpmValue = atoi(data);
  if (rpmValue == 0) {
    startLoop = false;
  } else {
    startLoop = true;
  }
}

//Check if mVolt values are zero, if so then don't run particle data
void mvolt(const char *event, const char *data) {
  int mvoltValue = atoi(data);
  if (mvoltValue == 0) {
    startLoop = false;
  } else {
    startLoop = true;
  }
}

// Function loop
void loop() {
  if (startLoop) {
    digitalWrite(led, HIGH); // Turn ON the LED
    float h = dht.getHumidity();
    // Read temperature as Fahrenheit
    float temp = dht.getTempFarenheit();
    Particle.publish("temp", String(temp), PRIVATE);
    delay(10000);
    String humid = String(random(20, 30));
    Particle.publish("humid", humid, PRIVATE);
    digitalWrite(led, LOW); // Turn OFF the LED
    delay(10000);            // Wait for 30 seconds
  } else {
    // Do nothing if startLoop is false
  }
}

Fan Speed Counting Code

Arduino
This code counts the number of times that a fan blade covers and uncovers the proximity sensor. This data is then sent to a 2nd particle device for publishing via an analog pin
int led=D7;         //define LED port
int proxpin=D14;    //Define Proximity Sensor Port
int counter=A4;
int val=0;
int valold=0;
int start;
unsigned int count=0;

void setup() {
 pinMode(led, OUTPUT);          // LED D7 blue is output
  pinMode(proxpin, INPUT);      // proxpin sensor is input
  pinMode(counter, OUTPUT);
  valold = digitalRead(proxpin);       
  Serial.begin(9600);
}

void loop() {
    analogWrite(counter,count);
    delay(1000);
  start = millis(); // take the start time
  count = 0; // reset couter
  // do the following loop for 6000ms = 6sec
  while (millis()-start < 15000)
  {
     // check for overflow of millis()
     if (start > millis()); {
       start = millis();
       count = 0;
     }
    val = digitalRead(proxpin);
    if (val==LOW)
    {
      digitalWrite(led, LOW);
    }
    else
    {
      digitalWrite(led, HIGH);
      if (val != valold) {
        count ++;
        valold = val;
      }
    }
  }
}

Fan Speed calculation and reporting

Arduino
This code receives the number of times a fan blade has been detected, and then converts it to fan RPM
int counter = A2;
int statusled = D7;
int bladect = 10;
float count = 0;
void setup() {
    pinMode(counter, INPUT);
    pinMode(statusled, OUTPUT);
}

void loop() {
    count=counter*2;
    
    digitalWrite(statusled, HIGH);
    Particle.publish("RPM", String(count), PRIVATE);
    
    delay(2000);
    digitalWrite(statusled, LOW);
    delay(8000);

}

Credits

Chris Cervantes

Chris Cervantes

2 projects • 2 followers
Chris Kirsch

Chris Kirsch

2 projects • 2 followers
Aaron Stuber

Aaron Stuber

2 projects • 2 followers

Comments