Mario Lino
Published

iGate

With Particle Photon and Node.js you can easily develop a web app to open the gate of your building.

BeginnerShowcase (no instructions)3 hours615
iGate

Things used in this project

Hardware components

1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
JQC-3F Relay
×1
Resistor 221 ohm
Resistor 221 ohm
×1
Resistor 560 ohm
×1
LED (generic)
LED (generic)
×1
Photon
Particle Photon
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
5V battery
Instead of using a battery you can also connect the photon to the mains of your home.
×1

Software apps and online services

Clouding.io
To have an account in Clouding.io is only necessary if you want to use your own web app in your mobile instead of using the Particle App. Using your own server will make the App a bit faster, much more appealing and you will also learn more with this proyect.

Hand tools and fabrication machines

Multimeter
Screwdriver

Story

Read more

Schematics

Wiring

Wiring

Code

Particle Code

Arduino
This code creates two Particle functions that will be called by our web app to turn on or off the pin D2 of the Photon.
const int led = D2;
int on(String command);
int off(String coommand);

void setup()
{
    Particle.function("on",on);
    Particle.function("off",off);
    pinMode(led, OUTPUT);
}

void loop() 
{

}


int on(String command)
{
    digitalWrite(led,HIGH);
}

int off(String command)
{
    digitalWrite(led,LOW);
}

Node.js code

This is the code that builds the web app.

Credits

Mario Lino

Mario Lino

1 project • 0 followers
Aeroespacial engineering student

Comments

Add projectSign up / Login