Light door and kettle switch


#1

About This Project

When I return to my home I make ever a cup of tea, And when I go to my home I do not see the key of my door, because there isn’t light.
I’m really determined to remedy the situation! :slight_smile:

I will use a Raspberry Pi Zero, connected to the internet, and a Cayenne app for Smartphone an Tablet. I will connect the Raspberry Pi to the relay shield, and to the PIR sensor. When the PIR sensor read the presence of a person out of my door, Cayenne switch on the light outside the door, and also switch on the Kettle in my kitchen.

Cayenne also send me an email informing me that someone has arrived home.

Now I see the keys, and I have a hot cup of tea whe I return to my home.

On Hackster.io
On Instructables

What’s Connected

For this project I’ve used:

Raspberry Py zero or Raspberry Pi
USB wireless wlan
PIR sensor
Relay Shield
Breadboard
Power supply for breadboard
Led pannel
12 Volts power supply
Cayenne app

Triggers & Alerts

The PIR sensor have two potentiometers (see figure). One of this is for the time, the other is for sensitivity. When you modify the position of potentiometer, you modify the time of signal goes “on”, and when you modify the potentiometer for the sensitivity, you modify the sensibility of sensor. With a LOW sensitivity, the sensor detect only the movements very near, with a HIGH sensitivity, the sensor detect also a movement that are far away of it.

This is very important, because I want switch on the light and the kettle, only when I or somebody of my family is very near the door.
For this reason, I’ve adjusted the sensitivity sensor to minimum value, and the time medium value, like 10 seconds.

If you have mounted the hardware, installed the Cayenne, and tested the relay on Cayenne with the widget button, and the sensor pin with I/O widget sensor, it’s the moment for the TRIGS.

The trig are rules that trigger an action when it happens another.

This is the classic IF construct. IF <–> ELSE

Open Trig and select IF. Inside IF select your platform, and also select the pir sensor.

Then select On value, and after click on then. In this position select Relay 1 or 2, and click ON.

Follow this step also for the second relay.

After this step, add an other rule. When the PIR goes OFF, switch OFF the light.

Open Trig and select IF. Inside IF select your platform, and also select the pir sensor.

Then select OFF value, and after click on then. In this position select Relay connected to the light, and click OFF.

You can also add a alert. When the PIR sensor goes ON, Cayenne send an email to an address that you specify in the app. Try to setup the email alert!

Dashboard Screenshots

Photos of the Project


Light on and off , between Cayenne app and momentary switch, for home automation by arduino
#2

Nice project!


#3

I second that, nice project! Will get you the participation prize soon :slight_smile: Bonus points for submitting the video ha.

-B


#4

Great! I love videomaking…like than IoT! :smiley:


#5

Participation prize sent my friend!

-B


#6

Yess GREAT!! :slight_smile: