Go Down

Topic: Motion controlled lights home/office (Read 261 times) previous topic - next topic

Temerity

Hi,
I am looking at automating the lights in my house/office by adding PIR sensors to detect presence + relays to switch lights on/off + arduino/nodemcu to give an app/web interface as well.

Relays can easily be added to the light switches for on/off functionality. The question is "what will be the best way to link the PIR to the nodemcu/arduino?"

Furthermore:

1)1 PIR might trigger 1 light or 2 or more depending on location. For eg. in bathroom I want only 1 light triggered through a PIR whereas a PIR in living room will trigger 2 lights. Can PIR trigger relays directly without need for arduino or similar? IF yes, can we then read the relay state wirelessly to provide the app functionality and also trigger the relays remotely through a master arduino/nodemcu?

2) The PIR might be located far away from the relays, in this case what is best option to wirelessly link the PIR to the relay/nodemcu keeping in mind long lasting power source?

Considering I want to do whole house, there will be multiple relays connected to all the current manual switchboards + PIR's to detect presence + arduinos/nodemcus

There are many options coming to mind:

1) Use a central nodemcu/arduino as master unit and wireless connect other (relays +PIR) combos to it?
2) use separate nodemcu + relay + PIR to each wall switch and control?

Another question is power source for all the components. Powering the arduino/relays should be ok. What about the PIR if they are mounted in a location which doesn't have power source? Can they be battery operated and last a year?

IR or Zigbee or BLE, which would be most suitable?

Would love to hear suggestions on what will be optimum way to do this.

Thanks

GoForSmoke

How much of that can you code already? What you sketch out is not nearly a beginner project.

PIR only signals when it detects change. What keeps the lights on when the subject stands still?
PIR is low power but you need a datasheet for yours or testing it to say how much power it needs.
Suppose PIR only runs 10 times a second?

Relays should not be switched too frequently. A minimum OFF time in software can handle that.

Using bits in variables to hold binary sensor readings, 1 bit per sensor, bitwise logic can be performed on all of the bits at once. It beats writing if statements with line after line of conditions and matching parenthesis to do the same with a logic operation. Are you up on bits?

Have you done anything with wifi?
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Temerity

How much of that can you code already? What you sketch out is not nearly a beginner project.

PIR only signals when it detects change. What keeps the lights on when the subject stands still?
PIR is low power but you need a datasheet for yours or testing it to say how much power it needs.
Suppose PIR only runs 10 times a second?

Relays should not be switched too frequently. A minimum OFF time in software can handle that.

Using bits in variables to hold binary sensor readings, 1 bit per sensor, bitwise logic can be performed on all of the bits at once. It beats writing if statements with line after line of conditions and matching parenthesis to do the same with a logic operation. Are you up on bits?

Have you done anything with wifi?

Hi,
Looking at options to connect PIR with Nodemcu and also app interface right now. Also which protocols to use etc. More like design the system first and then code it.

Coding will come little later.

I haven't worked on bit level but done a few arduino projects like Alexa enabled Nodemcu 4 channel relay to control lights & also rfid smart attendance system for a school.


DVDdoug

I didn't build my home automation system...   I have:

X-10 Motion Sensor
RF to X-10 Receiver/Transmitter
X-10 Compatible Dimmer/Switch

In my setup the motion sensor only controls one light.   But the RF transmitter receiver also works with other wireless controllers and other dimmers, and the dimmer can be operated by other controllers/timers, or it can be operated locally.

Temerity

I didn't build my home automation system...   I have:

X-10 Motion Sensor
RF to X-10 Receiver/Transmitter
X-10 Compatible Dimmer/Switch

In my setup the motion sensor only controls one light.   But the RF transmitter receiver also works with other wireless controllers and other dimmers, and the dimmer can be operated by other controllers/timers, or it can be operated locally.
Nice

Go Up