IOT PROJECT: "DELIGHT ME" MY FIRST PROJECT IN OUR IOT LABORATORY PROVIDED WITH THE CODE BELOW.

deLIGHT ME

  • this is what i named for this smart thing. When the sensor detects that the light changes to dim, it automatically turn on the lamp. As of now this is just a beginner sample for IOT project, soonest i will develop this 'delight me' with another functionality.

31317689_1659819007450459_6896412906829643776_n.jpg

I will give you the code for this one, I am using JS.

//CPF- deLIGHT Me
var value = cpf.get("light sensor");

if (value < 10) {
//Control Digital-out D2
var d2 = ui.get("socket d2");
cpf.set("socket d2", 1)
cpf.repeat();
}
else {
//Control Digital-out D2
var d2 = ui.get("socket d2");
cpf.set("socket d2", 0);
cpf.repeat();
}

The cable of the lamp is connected to the relay then from relay to arduino shield next is the light sensor connected again to arduino shield.

31301690_1659820384116988_2922678902230876160_n.jpg

Thank you guys, i will be posting here for more updates.

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center