Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Automated lighting project

Status
Not open for further replies.

ismith1984

New Member
ok guys i would like your advice on a certain scenario. my friend and i are trying to desgn a project which uses automated lighting in a hallway and then in a room. here is how we want it to work. first of all we want to use infrared sensors as triggers to let the system k now that someone is either in the hallway or in the room. so when someone enter the hallway from either direction we want the light to come on. also when someone enters to room we want the light to come on and remain on while the person is in the room and go off when they leave the room.

we are having trouble deciding how we should go about doing that. do we try to use digital logic in a system like that ( by this we mean the use of gates and flip flops connected eventually to a relay and then turning on out lights. or is it better to use a microcontroller which would then be connected to an input output module .

if you guys say that the microcontroller is the better choice (which is think is) i am having a problem with when more than one individual enters to room in that i do not know how to keep the ligghts on when either of them leave. if th microcontroller is the method of choice please can someone advise one for a projecdt like this one with possible software for it programming. i know that might be asking for alot but any help would be greatly appreciated.
 
Hi,

you've got a serious problem there. :)

Let's assume one person leaves the hallway to enter the room, and never leaves it because he/she has died (a natural thing), the light will remain on forever.

Assuming that nobody dies in either the hallway or the room you might use passive IR-detectors sensing motion. The number of persons in either room is of no importance as long as motion is detected.

Retrigger your light circuit with every movement the person performs.

Boncuk
 
You need to develop a classic finite state system by checking the new state with the previous state.A bit complicated.

Similar thing did recently don't know whether it is relevant.Do not think it too much.
 

Attachments

  • Light Controller Sch.JPG
    Light Controller Sch.JPG
    273.4 KB · Views: 424
Last edited:
Goodness knows why you'd want to use a separate comparator when your're using an MCU or another bridge rectifier or the 12V supply, when you could just tap the supply before the one used to power the LM7805.

EDIT:
I think it's being overcomplicated. PIR can be used to keep the lights on whilst people are in the room and there can be a timer which turns the lights of after a certain period of inactivity. As I said above you can buy ready made modules or if you like hard work or it's educational, you can build your own.
 
Last edited:
I have done this using a PLC ($$), But it can be done with a microcontroller.
It counted the number of people in the room as long as there were 1 or more the light would be turned On. By keeping track of the entrance/exit.
A PLC is just a glorified microcontroller, and a microcontroller would be alot cheaper than a PLC.

The problem with motion is that if you don't move every so-long the light would turn Off; not fun when your in the shower or on the jhon.



Code example for a microcontroller.
Place two sensors (IR) at every entrance/exit;


If "Sensor One" is triggered before "Sensor Two" then someone is entering.

while ( (sensor_one==1)&(enable==1) )
{

if (sensor_two == 1 ) { hall_count++; enable==0;}​

}



If "Sensor Two" is triggered before "Sensor One" then someone is exiting.

while ( (sensor_two==1)&(enable==1) )
{

if (sensor_one == 1 ) { hall_count--; enable==0;}​

}


if ( (sensor_one==0)&(sensor_two==0)) { enable==1; } // Reset Sensor Inputs




What you do is, Increment a counter when a person enters and Decrement the counter when they exit.
if (hall_count >= 1 ) { hall_light = On; } else { hall_light = Off; }
 
Last edited:
Goodness knows why you'd want to use a separate comparator when your're using an MCU or another bridge rectifier or the 12V supply, when you could just tap the supply before the one used to power the LM7805.

:D

This is an industry project not a breadboard project :D.The load is too heavy though it is resistive loads & don't know what bulbs customer uses in later time.I used to isolate the relay thing from the MCU side.

LDR is placing a bit length from the circuit also the AD is varying speeder in different light conditions.It also needs a dark level adjustments.

By using a comparator I'm free of doing AD sampling, comparing , adding hysteresis etc.......
 
ok guys, thank you for the much given input. i appreciated everyone taking time to respond. first thing is i do not want an off the shelf solution myself along with the rest of my team are working on this for a class project so it will be a learning experience for us. i am guessing from the responses that the best method of approaching this is the micro controller alternative. gayan soya thank you for posting your responses i ill look at them and take the input of the other users into consideration and go from there. i am sure i will have a few more questions so when i do have them i will post them.

for now i just want to respond to what you guys said.

firstly Boncuk its fine if someone enters the room and never comes out or dies.. this is an unusual situation so the light remaining would be a good indication to check on that individual. (smile) also i am not persuaded that the motion sensor will accomplish what i want because if one is in the room meditating or something of that sort the lights will go off on their own and i guess that could become very irritating.

gayan I would like your help which part of the the overall project should i consider tackling first. i also took a look at your schematic, what exactly does this system do. it is a system that turn lights on when a vehicle enters a garage or something to that effect or is it something entirely different. i would also like to know if badscrs method like what he spoke about with the plc is also possible with your system instead of using a dark detector. i figure if it is used there would be no need for a dark detector circuit.
essentially what i am asking is what is the best way to approach and what should i consider doing first.
 
hi guys,

question for gayan soyza do you think the pic controller you used would be suitable for the my project.
 
gayan I would like your help which part of the the overall project should i consider tackling first. i also took a look at your schematic, what exactly does this system do. it is a system that turn lights on when a vehicle enters a garage or something to that effect or is it something entirely different. i would also like to know if badscrs method like what he spoke about with the plc is also possible with your system instead of using a dark detector. i figure if it is used there would be no need for a dark detector circuit.
essentially what i am asking is what is the best way to approach and what should i consider doing first.

That little circuit do this!

Let say you have a 300m road from the gate to house.Gate side has 2 IR sensor pairs.Also house side has 2 IR sensor pairs.Also you have two controller circuits on both sides (my cct).There is no any connection between those two controllers.Only lamps 230V line is common output to both of the controllers.

Gate side IR sensor pairs do this.

When a vehicle comes from outside the gate to house side then the street lights must turn on a particular time.But when a vehicle comes from house side to gate side it won't turn on the street lights.

House side IR sensor pairs do this.

When a vehicle comes from house side to gate side then the street lights must turn on a particular time.But when a vehicle comes from gate side to house side it won't turn on the street lights.

That is the basic of this system.But there are hidden logic feeded to the micro controller to do so many tasks.

For humans there is a manual switch to turn on the street lights.It will auto off after preset time.

In generally vehicle moving time is shorter than the human walking time.What will happen if first a human & after a vehicle has gone? This system will allow both of them to move without turning the lights off very accurately.
 
Last edited:
ok i have two more questions for you. i would like to know what type of PIR sensors would be less problematic as you have done this before. and also i woudl like to know how you go about interfacing the PIR sensors with the micro controllers.
 
I am speaking to anyone who can help me right now I wanna know which would work beat at a door I am wanna use two sensors at each entrance which based on which sensor comes on first it will be determined whether someone is coming or going out.
I just need to know what type of ir sensor would be most appropriate for this and also how do I interface it with an 8 bit pic microcontroller.
 
ok i have a question for gayan soyza i have a question. i decided not to use a micro controller afterall i decided to use a counter to achieve the same thing that the micro controller would have accomplished. i looked at the schematic you presented earlier and i decided that i could used the infrared input part of you project. what i would like to know is the part number for the infrared you used along with the part number for the NPN Transistor T4 . thank you in advance.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top