Legged robots have become a prominent area of research in various fields, including gait control, exploration, and path planning. However, studies on force/torque sensors suitable for legged robots remain relatively limited. For use in legged robots, sensors must be lightweight, capable of measuring large forces over a wide range, and offer high resolution and fast sampling rates. Additionally, the lack of compact sensors that are resistant to temperature changes and capable of operating in extreme environments, such as disaster scenarios, presents a significant challenge. To address this issue, this study aims to develop a durable and impact-resistant force/torque sensor tailored to the specific requirements of legged robots. The proposed sensor is designed to be compact by utilizing a photo-coupler and incorporates optimization techniques to enhance sensitivity. Furthermore, a temperature compensation method using a Gated Recurrent Unit (GRU) is proposed. This paper presents the design and development of a compact and temperature-insensitive sensor based on a photo-coupler, along with performance evaluation results obtained by integrating the sensor into a custom-built quadruped robot.