Nolan WaddillDavid Totty
Published

Live Laundry Availability Wireless Display

Never get caught walking all the way down to your dorm's laundry room only to find out none of the machines are available!

BeginnerWork in progress103
Live Laundry Availability Wireless Display

Things used in this project

Hardware components

Argon
Particle Argon
×2
Breadboard (generic)
Breadboard (generic)
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
Gravity:Digital Push Button (Yellow)
DFRobot Gravity:Digital Push Button (Yellow)
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
Jumper wires (generic)
Jumper wires (generic)
×1
LED (generic)
LED (generic)
×2

Story

Read more

Schematics

Circuit Diagram

The IOT Laundry Display circuit diagram

Code

Input Code (Argon 1)

C/C++
This section of the code is utilized by the first argon to accept input from the button and send a request to the second argon to run it’s section of code. It then waits for a response and then executes an output display on the LCD with the response data.
// This #include statement was automatically added by the Particle IDE.
#include <LiquidCrystal.h>


//Declaring pins for the LCD:
//pinout on LCD  (RS, E , D4, D5, D6, D7)
LiquidCrystal lcd(D0, D1, D2, D3, D4, D5);

//button setup
int button = D6; // setting button to integer pin digital 6
int val = 0;    // setting variable val to LOW
String data = ("appliance");



void setup() 
{
	// set up the LCD's number of columns and rows:
	lcd.begin(16, 2);

	// Clears the LCD screen
	lcd.clear();
	
	pinMode(button, INPUT_PULLDOWN);//declaring button pin D6 as an input while using the particle's pull-down resistor
	
	Particle.subscribe("hook-response/Laundry/1", LaundryRead, MY_DEVICES);
}

void loop() 
{
	// Print a message to the LCD.
	val = digitalRead(button);   //setting variable val to the digital read of the button
	lcd.print(" Press Button!");    //printing LCD message
	lcd.setCursor(0, 0);    // puts cursor back to top left
	
	//performing if loop for the publishing event
	if (digitalRead(button) == LOW ){
	    
	    Particle.publish("buttonPress", "buttonPress"); //send buttonPress
	    
	   
	}
	delay(1000);
	

    
}

void LaundryRead(const char *event, const char *data) {
    lcd.clear();
    lcd.print("Washer Ready");
    lcd.setCursor(0,0);
  delay(30000);}

Web Hook Implementation (Argon 2)

C/C++
The second argon uses this section of the code to fetch the desired data from the UNCC laundry website and sends the output to the other argon to display.
//etablishing LED pins
int greenLED = D2;   //setting green LED to digital pin 2
    //setting Red LED to digital pin 11


void setup() {
    
    Particle.subscribe("buttonPress", button, MY_DEVICES);//subscribing to the button event
}

void button(const char *event, const char *data) {
       // Get some data
  String one = String(10);
  // Trigger the integration
  Particle.publish("Laundry", Available, MY_DEVICES);
  // Wait 60 seconds
  delay(60000);
       
}

Credits

Nolan Waddill

Nolan Waddill

1 project • 1 follower
David Totty

David Totty

0 projects • 0 followers

Comments

Add projectSign up / Login