In robotics, robotic arms should be smaller, less expensive, and able to demonstrate a better performance, in order to be utilized in various fields. However, expensive actuators and speed reducers are required to generate sufficient force at the end effector after overcoming the gravitational torque of robotic arm. Robotic arms become compact and cost effective if the gravitational torque can be passively compensated. Especially in the field of robotic laparoscopic surgery, the static equilibrium state of the robot arm in the entire workspace is essential to achieve both safety and ease of use. In this study, we propose a novel passive gravity compensation mechanism based on springs and wires. This mechanism utilizes a scotch yoke mechanism to compensate the gravitational torque changed by two rotational degrees of freedom (DOF). Furthermore, we applied to a surgical robotic arm which was constructed using a roll-pitch joint. According to the experiments, it was proved that the new mechanism effectively compensate the gravitational torque. As a result, compact and cost-effective robotic arms can be developed satisfying safety and ease of use.