Jazmin RamosTaylor Barrett CrvichJordan Jeffrey
Published

Study Buddy - MEGR 3171 IoT Group Project 10

An engineering student's life isn't easy, this Argon "Study Buddy" sensor helps your friends focus from a distance!

IntermediateFull instructions provided90
Study Buddy - MEGR 3171 IoT Group Project 10

Things used in this project

Hardware components

Argon
Particle Argon
×3
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×4
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×2
Amazon Web Services Tactile Push Button Switch w/ Cap
×1
5 mm LED: Green
5 mm LED: Green
×2
5 mm LED: Red
5 mm LED: Red
×4
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×3
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×2
Resistor 220 ohm
Resistor 220 ohm
×4

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Google Sheets
Google Sheets

Story

Read more

Schematics

Hub

Communicates with Students to tell them to study

Student

Receives study message and communicates back "yes" response.

Hub Picture

Student Picture

Code

Hub

HTML
int G1=D3;
int R1=D2;
int G2=D8;
int R2=D7;
int B1=D4;
int B2=D6;
int s1=1;
int s2=1;

SerialLogHandler logHandler;
void setup() {

    pinMode(D2, OUTPUT);
    pinMode(D3, OUTPUT);
    pinMode(D7, OUTPUT);
    pinMode(D8, OUTPUT);
    pinMode(D4, INPUT_PULLUP);
    pinMode(D6, INPUT_PULLUP);
 
    //Particle.subscribe("study1", STUDYING1);
    //Particle.subscribe("study2", STUDYING2);
    delay(1000);
    digitalWrite(D3,LOW);
    digitalWrite(R2,LOW);
    digitalWrite(G1,LOW);
    digitalWrite(G2,LOW);
    Particle.subscribe("1studying",studying1);
    Particle.subscribe("2studying",studying2);
}
void loop() {

    int button1state;
    int button2state;
    button1state=digitalRead(B1);
    button2state=digitalRead(B2);
    if(button1state==LOW){
        Particle.publish("gostudy1");
        digitalWrite(R1,1);
        digitalWrite(G1,0);

    } 
    if(button2state==LOW){
        Particle.publish("gostudy2");
        digitalWrite(R2,1);
         digitalWrite(G2,0);
    }
    if(s1==0){
      digitalWrite(R1,0);
         digitalWrite(G1,1); 
    }
      if(s2==0){
      digitalWrite(R2,0);
        digitalWrite(G2,1); 
    }

}
void studying1(const char *event, const char *data){

    int s1;
    digitalWrite(R1,0);
    digitalWrite(G1,1);
    s1=0;
}

void studying2(const char *event, const char *data){

    int s2;
    digitalWrite(R2,0);
    digitalWrite(G2,1);
    s2=0;
}

Student 1

HTML
// This #include statement was automatically added by the Particle IDE.


// This #include statement was automatically added by the Particle IDE.

#include "application.h"
#include "Particle.h"
#include <LiquidCrystal.h>

LiquidCrystal lcd(D0, D1, D2, D3, D4, D5);
int button=D7;
int LED=D8;
int contrast=D6;
int studyingvalue=0; //if asked to study be 1, if studying 0
void setup() {
    pinMode(button, INPUT_PULLUP);
    pinMode(LED, OUTPUT);
    lcd.begin(16,2);
    lcd.setCursor(3,0); // Moving the cursor to row 1 and in the middle
    lcd.print ("Booting Up");
    delay(5000); // 5 second delay in the code so you can see the display message
    lcd.clear(); 
    Particle.subscribe("gostudy1",study);
    //Particle.subscribe("ok",ok);
analogWrite(D6,200);
}

void loop() {
      int buttonstate;
    buttonstate=digitalRead(button);
     if(buttonstate==LOW){
        digitalWrite(LED,LOW);
        Particle.publish("1studying");
            //clearlcd
            lcd.clear(); 
             lcd.setCursor(3,0); // Moving the cursor to row 1 and in the middle
            lcd.print ("Good Job");
    }

}
void study(const char *event, const char *data){

        digitalWrite(LED,HIGH);
        lcd.setCursor(3,0);
        lcd.print("STUDY JAZ");
 

}

Student 2

HTML
// This #include statement was automatically added by the Particle IDE.


// This #include statement was automatically added by the Particle IDE.


// This #include statement was automatically added by the Particle IDE.

#include "application.h"
#include "Particle.h"
#include <LiquidCrystal.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(D0, D1, D2, D3, D4, D5);
int button=D7;
int LED=D8;
int studyingvalue=0; //if asked to study be 1, if studying 0
void setup() {
    pinMode(button, INPUT_PULLUP);
    pinMode(LED, OUTPUT);
    lcd.begin(16,2);
    lcd.setCursor(3,0); // Moving the cursor to row 1 and in the middle
    lcd.print ("Booting Up");
    delay(5000); // 5 second delay in the code so you can see the display message
    lcd.clear(); 
    Particle.subscribe("gostudy2",study);
    //Particle.subscribe("ok",ok);
}

void loop() {
      int buttonstate;
    buttonstate=digitalRead(button);
     if(buttonstate==LOW){
        digitalWrite(LED,LOW);
        Particle.publish("2studying");
            //clearlcd
            lcd.clear(); 
             lcd.setCursor(3,0); // Moving the cursor to row 1 and in the middle
            lcd.print ("Good Job");
    }

}
void study(const char *event, const char *data){

        digitalWrite(LED,HIGH);
        lcd.setCursor(3,0);
        lcd.print("STUDY RED");
 

}

Credits

Jazmin Ramos

Jazmin Ramos

1 project • 1 follower
Taylor Barrett Crvich

Taylor Barrett Crvich

1 project • 1 follower
Jordan Jeffrey

Jordan Jeffrey

1 project • 1 follower

Comments

Add projectSign up / Login