In order to carry out printed circuit board (PCB) circuitry detection better, an effective detection method was proposed. Firstly, the basic principle of image preprocessing based on histogram potential function model was analyzed; such principle was applied to PCB photoelectric image preprocessing, and the primary edge images after removing dark and noise were obtained. Secondly, a line detection method based on improved Hough transform was proposed, the approximate location of line existed in image was ascertained by such method, and the characteristic point sets in the candidate areas were obtained roughly. Then, the basic principle of line detection by using least square method was discussed, the accurate line parameters were acquired by applying least square method to fit these lines detected by the improved Hough transform, and the eventual edge lines were obtained by adding pattern clustering. Finally, the edge detection experiment was carried out by the method in the dark and noisy PCB photoelectric image acquired actually. The results show that the proposed method can better incarnate the PCB circuitry detection.