A multi-electrode array sensor was developed to study the corrosion behaviors of carbon steel weldments and the effectiveness of the NaNO2 inhibitor in carbonated pore solution. The sensor can simulate a complete weldment, and the measurement results can match well with the coupon immersion test. The galvanic corrosion between the weld area, heat-affected area, and base metal area, as well as the effect of nitrite corrosion inhibitor on the weld area, were observed by measuring the open circuit potential, coupling potential, and galvanic current. The results show that corrosion is likely to happen around the weld metal area and its adjacent heat-affected zone. The intensive galvanic currents can accelerate the localized corrosion, while NaNO2 can inhibit it.