Things used in this project

Hardware components:
Photon new
Particle Photon
×1
Adafruit industries ada161 image 75px
Photo resistor
×1
Mfr 25fbf52 221r sml
Resistor 221 ohm
×1
09590 01
LED (generic)
×1
sparkfun photon battery shield
×1
11026 02
Jumper wires (generic)
×6
li ion battery
×1
Software apps and online services:
Xidmhfnahh6gnduppwzf
Particle Pi
Hand tools and fabrication machines:
Lasercutter
Laser cutter (generic)

Custom parts and enclosures

Case Plans
It's a case for our tripwire.
caseplans_(1)_0m6RNtQalB.svg
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 TripwireC/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

Large user 3339430 26yj7jsbau
Alex Rink
1 project • 0 followers
Joined Hackster.io to post a project my friend Owen and I made.
Contact
Photo
Owen Walthard
1 project • 1 follower
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login