Cattle cage is a term that refers to a structure used to house farm animals or animal homes. The structure might be in the form of a container, a building, or something else entirely, depending on the type of animal being farmed. Because most cattle shed doors are slotted or padlocked, there is a high rate of theft from irresponsible individuals seeking to take livestock without permission. The primary objective of this research is to devise a security system capable of keeping cattle pens secure and free of thieves or burglars that cause livestock loss. The author chooses the Atmega 328 microcontroller because it features a Harvard architecture that separates program code and data memory to maximize work and parallelism. Additionally, this circuit may be connected to an Arduino Uno to create a variety of electronic circuits ranging from simple to complicated. LED control, helicopter control, servo drive control, and robot control can all be implemented by adding specific components. Thus, a prototype was created for an automatic door safety system that employs an infrared sensor to detect the presence of animals and automatically opens the entrance, locking it with a password and ringing a buzzer in front of the farmer's house if the password is incorrect. This tool was created to help minimize cattle losses due to theft.