Polyaniline (PANI) with electrodonating and electrowithdrawing substituents were electrodeposited and studied as sensing materials in resistors and heterojunctions. Whereas the dimethoxyaniline leads to a highly conductive material, the tetrafluoroaniline leads to a poor conducting polymer. However, this latter was used in heterojunctions, associated with a highly conductive material, the lutetium bisphthalocyanine LuPc2. Elsewhere, hybrid materials combining polypyrrole (PPy) with ionic macrocycles as counterions were also electrosynthesized and used as sensing material in resistors, for the detection of ammonia. They exhibit a higher sensitivity compared to PPy prepared with small counterions, with a stable response in a broad range of relative humidity.