Tyler Henderson and Ryan Brancheau
Published

Washer/Dryer Notification (Team 42)

A notification system that updates the status of their laundry from anywhere as well as notifies roommates of who's currently doing laundry.

BeginnerShowcase (no instructions)121
Washer/Dryer Notification (Team 42)

Things used in this project

Hardware components

Photon 2
Particle Photon 2
×2
Breadboard (generic)
Breadboard (generic)
×2
Jumper wires (generic)
Jumper wires (generic)
×11
Elegoo 37 Sensor Kit
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE

Story

Read more

Schematics

IR Sensor

Sound Sensor

Code

IR Sensor

C/C++
#include <Particle.h>

const int transferSensorPin = A0; // Analog pin the transfer sensor is connected to
int soundPin = D7;


void setup()
{
    Serial.begin(9600);
    Particle.subscribe("dryer", soundvalue);
}

void loop()
{
    // Read the analog value from the transfer sensor
    int sensorValue = analogRead(transferSensorPin);

    // Print the sensor value to Serial Monitor (optional)
    Serial.println(sensorValue);

    // Publish the sensor value to the Particle cloud
    Particle.publish("transfer_sensor_value", String(sensorValue));

    // Add a delay to avoid flooding the Particle cloud
    delay(1000);
}

void soundvalue(const char *topic, const char *data) {
	int soundValue = atoi(data);
	if (soundValue == 1){
    	digitalWrite(soundPin, HIGH);
	}
}

Sound Sensor

C/C++
#include <Particle.h>

int soundPin = D5;     // Sound sensor input pin
int indicatorPin = D10; // LED output pin

void setup() {
    Particle.subscribe("transfer_sensor_value", irlight);

    pinMode(soundPin, INPUT);
    pinMode(indicatorPin, OUTPUT);
}

void loop() {
    int soundValue = digitalRead(soundPin);
    Particle.publish("dryer", String(soundValue), PRIVATE);
   // digitalWrite(indicatorPin, !soundValue); // Invert soundValue for LED
    delay(1000);
}

void irlight(const char *topic, const char *data) {
    int sensorValue = atoi(data);
    if (sensorValue > 1000) {
    	digitalWrite(indicatorPin, LOW);
    }
    else {
    	digitalWrite(indicatorPin, HIGH);
    }

}

Credits

Tyler Henderson and Ryan Brancheau
1 project • 0 followers

Comments