Light dependent resistor and LASER base light switching system.

hi! i want to make a LIGHT DEPENDENT RESISTOR and LASER based light switching system. in which i need ur help. basically it is a hardware interfacing programing and i want to use a 8051 microcontroller in which i want to use a c or c++ language.the discription of these system is that.

laser act as a transmitter and LDR act as a reciver. laser continuuously beam on reciever and ldr recive a signal from a laser it mean there is a line to line communication between laser and ldr. this system should be installed outside the door of the room if someone is want to enter in the room so i want to switch on the light outomatically this could be done in ths way that there is a path between lasre and ldr when path disconnected means communication disturbed between two sensor so light will be on automatically. but the problm is that one person enterd in the room so light will be on for instance more then one person enter in the room one by one so light will be on off on off like i dont want this. i wnt to use a counter if one person enter in room so conter start counting and increment the number of person enter in the room when person out so it will decrement the number of person. like this
i need the coding of ths project so please kindly do me a fvour as soon as posible and send me the coding of this project.
good luck^^...
Hahah. You best get your flamesuit on...
No one is going to write your code for you.

i wnt to use a counter if one person enter in room so conter start counting and increment the number of person enter in the room when person out so it will decrement the number of person.
How are you going to tell if a person is entering or leaving the room?
to BettyBoopTS : LOL!! XD
all kidding aside, here is a link that will give you a very simple example, source code, of an operation, somewhat similar to what you are trying to achieve, you will have to come up with your specific source code, pinout designations, ie;, serial, parallel, usb, or whatever physical interface you intend to use, and also the issue of whether or not someone is entering or leaving as hamsterdam referenced , you may need a secondary photoresistor to detect direction of movement, and either add a 2nd laser source for that photoresistor or collimate the original laser source horiziontally so that it provides the light source for both photoresistors.

http://www.adafruit.com/blog/2009/05/19/piezo-with-an-arduino-photoresistor/
Last edited on
How are you going to know if multiple people are entering/exiting the room at the same time? What about somebody lingering in the doorway itself?

Setting up the laser trip system itself is pretty trivial. Using it to accurately track traffic through the door just isn't practical. The setup is simply inadequate for the task.
bool off=0, on=1;

there you go, and throw in a count++; for good measure.
Unfortunately on these forums teaching programming is promoted, not handing over bucket fulls of lame code that hardly works.
You might want to check http://www.unix.com
or some such website.

edit: and by unfortunately I mean fortunately for the people who want to learn (because they have some great resources), unfortunate for those who can't be assed being programmers but just want to use certain bits of code form time to time without knowing how it works. (or those that try and cheat and get ppl to do their homework for them).
You can also try googling free code...
Last edited on
Topic archived. No new replies allowed.