Controlling Appliances connected to Outlet w/Beam Sensor

Hi, I'm a beginner on using Arduino Microcontroller , I just wanna ask how should i make use of my arduino microcontroller to control the outlet . This is for our Thesis in Software Engineering I wanna ask the Proper codes, as well as the Beam Sensor. It would make a LOT HELP thankyou in Advance! :slight_smile: I got 1 Arduino M.Controller and 2 Pairs of Beam Sensor and a 24V of Relay. Thankyou in Advance for the KIND HELP! :slight_smile:

Logic of our Project:

"Automatic Switch for Light & Air Conditioner in offices w/Sensor"

The Lights & all appliances will be Open as soon as the 1st person goes inside the Room
and Turn off all the appliances except for the Computer as soon as the room got zero (0) Person on it.

--THANKYOU SO MUCH! :slight_smile: :slight_smile:

issue with your logic, i think. how do you know if someone is going in or out?