Maker Pro
Maker Pro

Automatic system for home light

I want to make program flow that detect persons entering into room and turning the light on and when they leave room light shut off
Update : I am struggling to update image whenever I am uploading image I am getting error message
 
But in my house, I get enough sunlight in the day due to which I do not need to turn on the light. How can we turn off the light in system from 9:00 am to 4:00 pm ?

programming flowchart

IMG_20200727_155917.jpg
 

hevans1944

Hop - AC8NS
Have you tried Google to find a commercial, off-the-shelf, passive infrared switch (with time-delay to turn-off) that will do exactly as you have described? Is there any particular reason you want to re-invent this wheel? PIR light switches are inexpensive. Or is this just a learning project to get your feet wet with PIR sensors and microcontroller programming?
 
Or is this just a learning project to get your feet wet with PIR sensors and microcontroller programming?
Yes, this is an example project and will help me to solve the challenges come in project development.

Right now System detects that if someone is inside the room, the light should be on but the challenges is that what happens If somsleeping at night, light should turn off.

How to design a system that can be keep the lights off at night ? Does this need extra hardware, or we can do this through programming ?
 
Yes, this is an example project and will help me to solve the challenges come in project development.

Right now System detects that if someone is inside the room, the light should be on but the challenges is that what happens If somsleeping at night, light should turn off.

How to design a system that can be keep the lights off at night ? Does this need extra hardware, or we can do this through programming ?
you need to know time of day. Microcontroller with real time clock (RTC) or separate module for it.
 

hevans1944

Hop - AC8NS
Many commercial PIR-activated outdoor flood-lights also have a visible-light sensor, often just a simple solar cell or a CdS light-sensitive resistor, to monitor ambient light and prevent the flood-lights from activating during daylight hours. Most street lights also have ambient light sensors so they don't operate during daylight hours. Perhaps adding an appropriately located ambient light sensor to your microcontroller will allow you to do what you want. Problem with using a real-time clock or RTC is it has no idea how dark the room is at night. You can attach a cheap CdS sensor to a long length of twisted-pair wires and tape it to a window glass to "detect" when it is night time.
 
Many commercial PIR-activated outdoor flood-lights also have a visible-light sensor, often just a simple solar cell or a CdS light-sensitive resistor, to monitor ambient light and prevent the flood-lights from activating during daylight hours. Most street lights also have ambient light sensors so they don't operate during daylight hours. Perhaps adding an appropriately located ambient light sensor to your microcontroller will allow you to do what you want. Problem with using a real-time clock or RTC is it has no idea how dark the room is at night. You can attach a cheap CdS sensor to a long length of twisted-pair wires and tape it to a window glass to "detect" when it is night time.
Thanks a lot, different question When you design a project, do you use paper and pen to solve the problem that is coming up in the project and that goes to coding.

Do you use flow chart or a FSM?

I want to design a big project I would like to design project on home sefty and security alarm.

Can you assist me to fix flow chart or state diagram
 

hevans1944

Hop - AC8NS
I am not a software professional. I hack small programs, but for anything really sophisticated I have found it best to hire someone who knows better than I how to do it. I haven't used flow charts or state diagrams since college, back in the 1970s. Didn't find either of them particularly useful for what I was doing then, don't think they would be very useful to me now either. You can take online courses to learn computer programming and software design, but why bother for a home safety and security alarm? These are commercially available at reasonable cost, so not much need to re-invent that particular wheel.
 
Top