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

in iotlab •  7 years ago  (edited)

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.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations! This post has been upvoted by the communal account, @steemph.cebu by jriel being run at Teenvestors Cebu (Road to Financial Freedom Channel). This service is exclusive to Steemians following the Steemph.cebu trail at Steemauto. Thank you for following Steemph.cebu curation trail!

Don't forget to join Steem PH Discord Server, our Discord Server for Philippines.

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by jriel from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.