Owen Walthard
Published

Laser Tripwire

This laser tripwire calls Owen's phone to tell him someone set off the tripwire whenever the light sensor is interrupted by someone.

IntermediateFull instructions provided2 hours279
Laser Tripwire

Things used in this project

Hardware components

Photon
Particle Photon
×1
Photo resistor
Photo resistor
×1
Resistor 221 ohm
Resistor 221 ohm
×1
LED (generic)
LED (generic)
×1
sparkfun photon battery shield
×1
Jumper wires (generic)
Jumper wires (generic)
×6
li ion battery
×1

Software apps and online services

Particle Pi
Particle Pi

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)

Story

Read more

Custom parts and enclosures

Case Plans

It's a case for our tripwire.

Schematics

How to wire the tripwire.
Screen shot 2017 12 18 at 10 38 13 am pqouxyxaph

Schematics

Schematics

How to wire the tripwire.
Screen shot 2017 12 18 at 10 38 13 am gykffuuowy

Real-Life Schematics

How to wire the tripwire.
Photo on 12 18 17 at 10 40 am uwzvyu4bqk

Code

Code for Laser Tripwire

C/C++
It's a laser tripwire. To use it you shine a laser at the light sensor and if someone walks in front of it Owen will be called.
int sensor = A0;
int sensorValue;
int newValue;
int led1 = D0;
int tripped = 0;

void setup() {
    Particle.variable("sensorValue", &sensorValue, INT);
    Particle.variable("newValue", &newValue, INT);
    Particle.variable("tripped", &tripped, INT);
    sensorValue = analogRead(sensor);
    pinMode(led1, OUTPUT);
}

void loop() {
    newValue = (analogRead(sensor))+100;
    if( newValue > (sensorValue)){
        digitalWrite(led1, HIGH);
        tripped = 1;
    } else {
        digitalWrite(led1, LOW);
        tripped = 0;
    }
}

Credits

Owen Walthard

Owen Walthard

1 project • 0 followers

Comments

Add projectSign up / Login