Gavin TrotterDaniel Law
Published

Lane Tech HS - PCL - The Snack Detector (Prototype)

Using an Argon and a Metal Touch sensor, This device notifies you when your favorite snack is gone.

BeginnerProtip2 hours223
Lane Tech HS - PCL - The Snack Detector (Prototype)

Things used in this project

Hardware components

Argon
Particle Argon
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
Arduino Metal Touch Sensor
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Arduino IDE
Arduino IDE
Maker service
IFTTT Maker service

Story

Read more

Code

Particle Web IDE code

Java
This is the code flashed onto the argon in order for the sensor to pick up signal.
int touchpin = D7; // sets the metal touch sensor to D7
int value ; // defines the numeric variables as value

    void setup()
{
    Particle.variable("value", value);// Reads the value variable in order for IFTTT applet to work
    pinMode (touchpin, INPUT) ; // sets the metal touch sensor as INPUT
}

void loop ()
{
  value = digitalRead (touchpin) ; // reads the value of the touchpin
  
  if (value == HIGH)      // If the value is HIGH 
  {
    Serial.println("HIGH"); // the sensor has been triggered, tells IFTTT to send myself an email
  }
  else       
  {
    Serial.println ("LOW");  //the sensor is not triggered
  }
  delay(250); 
}

Credits

Gavin Trotter

Gavin Trotter

3 projects • 2 followers
Daniel Law

Daniel Law

16 projects • 8 followers
Teacher. Maker. Citizen of the planet.
Thanks to Daniel Law.

Comments

Add projectSign up / Login