I am trying to design the ladder logic for an energy saving system with the following characteristics...

Whenever a person enters the room, they pass by sensor (IN_1), and light (OUT_1) in the lobby are turned on for 2 minutes, and then turn off automatically.

If a person exits, they pass sensor (IN_2), which turns on light (OUT_2) - which remains on for 1 minute and then turns off automatically.

When there is between 10 and 20 people in the room, one air conditioning unit is turned on (OUT_3), if more than 20 people are in the room 2 air conditioners turn on (OUT_3 and OUT_4).

(OUT_4) will turn back off when the room has less than 20 people, but (OUT_3) will remain on until there are no more people in the room.

I fell like I know how to design the majority of this system, but I am confused on how to keep OUT_3 on when there are less than 10 people in the room, as I figured I would use a Limit instruction to turn it on when 10-20 people were in the room. Could anyone suggest any solutions to this?

Thanks