The present study optimized the properties of the electropolymerized polyaniline (PANI) solid inner contact for a potentiometric chemical sensor by varying the thickness of the polymer layer. A potentiometric sensor for detecting one of the paralytic shellfish toxins, decarbamoyl saxitoxin (dcSTX), in mussel extracts was selected as a case study. The plasticized PVC membrane composition, developed in previous work for the detection of this toxin, was used. The structure and electrical properties of PANI layers of different thicknesses were studied using scanning electron microscopy and electrochemical impedance spectroscopy. The effect of PANI solid contact thickness on the characteristics of the potentiometric sensor, including sensitivity, detection limit, and selectivity to dcSTX in buffer solutions and mussel extracts, was evaluated. The formation of a water layer at the inner solid contact and PVC membrane interface was investigated using electrochemical impedance spectroscopy and a water test. PANI layer thickness 1.1 µm was found to be optimal for solid inner contact for potentiometric sensor with PVC membrane providing highest sensitivity and selectivity.