Trevor WilliamsRylan TepedinoRyan Kunert
Published

Particle Argon Wi-Fi Enabled Hot Potato Sensor Game

Use multiple sensors with the particle argon connected via the internet to stay connected with friends in an interesting way.

BeginnerFull instructions provided9 hours38
Particle Argon Wi-Fi Enabled Hot Potato Sensor Game

Things used in this project

Hardware components

Argon
Particle Argon
×3
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
KY-018 PHOTORESISTOR MODULE
×1
KY-028 4 Pin Digital Temperature Thermistor Thermal Sensor Switch Module
×1
Arduino Rain Water Level Sensor Module Liqiuid
×1

Software apps and online services

Adafruit.io
IFTTT - Notification

Story

Read more

Schematics

Group 20 - Setup (used built-in LED's for inter communication (pin D7))

Used built-in LED's for inter communication (Pin D7)

Live Photoresistor Updates via Adafruit

Live Temperature Sensor Updates via Adafruit

Live Water Level Sensor Updates via Adafruit

Code

Photoresistor

C/C++
// code from: https://startingelectronics.org/tutorials/arduino/modules/photo-resistor/

int sensorPin = A0;   // select the analog input pin for the photoresistor
int sensorValue = 0;  // photoresistor value read from analog input pin
int receivedinteger =0; 
int LED_BUILTIN = D7;


void setup() {
  pinMode(sensorPin, INPUT);
  Particle.subscribe("Water", myHandler_water, MY_DEVICES); //when useless-on occurs in the cloud (viewable by console.particle.io) run the uselessfunc
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
    sensorValue = analogRead(sensorPin);
    Particle.publish("Light", String(sensorValue)); // String::format formats temp into decimal place # to 2 digits
  delay(10000);
 }
 
void myHandler(const char *event, const char *data) {
  // Handle the integration response
}

void myHandler_water(const char *event, const char *data) {
     receivedinteger = String(data).toInt();  //converts char array to string and then to a int
     
     if (receivedinteger > 700){
     
     digitalWrite(LED_BUILTIN, HIGH);
     
     }
     else{
     
     digitalWrite(LED_BUILTIN, LOW);
     }
}

Water Level

C/C++
int sensorPin = A0; 
int sensorValue = 0; 
int LED_BUILTIN = D7;
int receivedinteger =0; 


void setup() {
pinMode(sensorPin, INPUT);
pinMode(LED_BUILTIN, OUTPUT);
  Particle.subscribe("Temperature", myHandler_temp, MY_DEVICES); 

}

void loop() {
sensorValue = analogRead(sensorPin);
  Particle.publish("Water", String(sensorValue));
  delay(10000);
}

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

void myHandler_temp(const char *event, const char *data){
 
     receivedinteger = String(data).toInt();  
     
     if (receivedinteger > 1000){
     
     digitalWrite(LED_BUILTIN, HIGH);
     
     }
     else{
     
     digitalWrite(LED_BUILTIN, LOW);
     }

}

Temperature

C/C++
int sensorPin = A0;   
int sensorValue = 0;  
int receivedinteger =0; 
int LED_BUILTIN = D7;


void setup() {
  pinMode(sensorPin, INPUT);
  Particle.subscribe("Light", myHandler_light, MY_DEVICES); 
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
    sensorValue = analogRead(sensorPin);
    Particle.publish("Temperature", String(sensorValue)); 
  delay(10000);
 }
 
void myHandler(const char *event, const char *data) {
  
}

void myHandler_light(const char *event, const char *data) {
     receivedinteger = String(data).toInt();  
     
     if (receivedinteger < 3000){
     
     digitalWrite(LED_BUILTIN, HIGH);
     
     }
     else{
     
     digitalWrite(LED_BUILTIN, LOW);
     }
}

Credits

Trevor Williams

Trevor Williams

1 project • 0 followers
Rylan Tepedino

Rylan Tepedino

0 projects • 0 followers
Ryan Kunert

Ryan Kunert

0 projects • 0 followers

Comments

Add projectSign up / Login