We used Kelvin probe force microscopy to measure the potential barrier associated with grain boundaries in B-doped p-type polycrystalline silicon. The potential barrier at non-contaminated grain boundaries varied approximately from 5 to 90 meV according to grain-boundary character. The random boundaries had a higher potential barrier than the coincidence boundaries. This barrier increased with increasing twist component of the grain boundary when the misorientation angle of two adjoining grains was almost the same. Copper and iron contamination caused a significant increase in the grain-boundary potential barrier, making the potential barrier depend more strongly on misorientation, probably because of anisotropy of grain-boundary segregation.