Laser Light Counter

I am relativity new to Arduino programming and I need to know if my project can be applied to any of the arduino boards. What my project does is count how many people are in a room with two laser lights and two photo transistors. It can tell if someone walks in or out of the room and as long as one person is still in the room a light will stay on and when everyone leaves the light turns off. If anyone can give me advise on if the project will work with arduino, Thanks.

Any arduino board 'd capable to count, it's simple part. The tricky side of your project is sensors, if you a new to electronics, I'd suggest to change a plan from lasers to pre-made IR distance sensors, there are many projects /examples/ code you can find in playground (link above-left)

I would recommend an IR receiver, part number TSSP4038 or TSSP58038 specifically. If you use another IR receiver you need to verify that it will accept a continuous modulated signal.

Then see Detecting an IR Beam Break with the Arduino IR Library

The advantage of using IR receivers is that they are digital (a distinct HIGH for unblocked and LOW for blocked) and are insensitive to ambient light conditions. Phototransistors will work -- and they would be cheaper -- but you have to be prepared to create a way to calibrate against ambient light and/or filter out noise.

My project involves coding an arduino to keep track of a certain numerical value. The basis is using two Ir sensors right next to each other in a doorway so you will be able to tell if someone walks in or out. I plan for the project to count up if someone walks in and count down when someone walks out and for it to keep track of the number of people in the room. As long as someone is in the room a light will be on and as soon as everyone leaves the light will turn off. If anyone could help me out and let me know if the arduino board can do this because i couldn't find anything myself, thank you.

Yes, the Arduino can add and subtract.

Edit. Near-identical topics merged.

I'm applying a similar concept and also thought of starting as you are.
Problem is when people entered clumped up or brought objects in with them (shopping cart...)
Way I got around it is a US sensor crossing the doorway and a PIR sensor inside. So every time US detects sudden change it'll check if there is still movement inside or not and thus knowing if there are none, one or two+ people in the room.

another problem is closing the door, normally that would count as someone coming in/out.
Since the door is an electric sliding one, I solved that by adding increment values into the code. If the increment/decrement of distance the US reads matches the sliding door speed (door is pretty thick, about 10 cm) then that's the door opening/closing(depends on wether increment or decrement) if there is a sudden increment followed by a sudden decrement, someone came in/out.

Here's how it knows how many people are in:
-----no people = no PIR movement
-----1 person = US detected sudden inc/decr + PIR detects movement
-----2+ people = 1 or 1+ people are in and the US detects entrance/exit while PIR detects movement

Hope I helped, or at least got ya thinking :wink: