ASK About Flowchart Multiple Room Control Light With Multiple Sensor

Hello, i'm want to task about "How to control light in multiple room (4 Room), with multiple sensor"

in here i have prototype 4 room, each room have an PIR Sensor and LM35 Sensor, can anyone give flowchart or give an overview how to create the code, can all be able to walk together or alternately ?

thanks

To serve what purposes, you have installed the following two sensors in a room.
1. PIR Motion detector sensor;
2. LM35 Temperature sensor.

Do you have these two sensors and Arduino UNO? If so, draw connection diagram (on a piece of paper) among these three devices, take a photograph and post it here. Hope that you will do this task to get some codes from the Forum.

Basically two steps. The first one is to read all sensors and the second one to react on the readings. Obviously you need some setup as well.

I would store the sensors in a struct and use an array of structs that will represent the rooms. Alternative to the struct is a class.

Using arrays will allow you to keep your code small and tidy.

If you have little experience with coding, start with two arrays for the two types of sensors instead of an array of structs.

I would store the sensors in a struct and use an array of structs that will represent the rooms. Alternative to the struct is a class.

I think that the veteran programmers may first poll the programming level of the poster and then start with a basic solution. If the poster would have the working knowledge on struct/class keywords, he would not ask for the codes to operate PIR/LM35 sensors ( I could me wrong.).

If you have little experience with coding, start with two arrays for the two types of sensors instead of an array of structs.

I would like to see the above as the 2nd para of Post#2.

GolamMostafa:
To serve what purposes, you have installed the following two sensors in a room.
1. PIR Motion detector sensor;
2. LM35 Temperature sensor.

Do you have these two sensors and Arduino UNO? If so, draw connection diagram (on a piece of paper) among these three devices, take a photograph and post it here. Hope that you will do this task to get some codes from the Forum.

Just Like this (im use flowchart using 2 room) link : https://drive.google.com/open?id=1GbIKGRELqLbn6skKUZgFjlPSjjGaa44V

1. This is the Flow Chart that you have linked.
flowPIR.png
Figure-1:

2. This is the refined version of Fig-1:
on process

Figure-2:

3. This is the connection diagram among your PIR (HC-SR505), LM35, Relay, and UNO.
pir.png
Figure-3:
4. Coding of Fig-1 in the form of pseudo codes:
L1: Initialize everything as needed
L2: while (DPin-8 != HIGH) //check and wait until movement is detected
{
;
}

L3: Activate DPin-10 to turn ON Light
L4: Read temperature signal from LM35 (int T = (int)100*(1.1/1023)*analogRead(A0):wink:
L5: if(T < 45)
{
jump to L7 to continue with Room-2
}
L6: Activate DPin-9 to turn ON Fan
L7: continue all the above steps for Room-2
.....................
LX: Jump at L2 //repeat the process

5. Convert the pseudo codes of Step-4 into programming codes as much as you can and submit in the post for review/corrections by Forum members.

pir.png

flowPIR.png