A pyridyl based Schiff base compound, (1E,1′E)‐N,N′‐(butane‐1,4‐diyl)bis(1‐(pyridin‐2‐yl)methanimine) (2pdab) was observed to serve as a highly selective and sensitive ratiometric chemosensor for Ni2+ and Cd2+ ions. Mole ratio method and Yoe Jone's method showed a 1:1 binding mode of metal ions (Ni2+ and Cd2+) with 2pdab, while a binding constant of 26.88 ×106 L/mol and 4.29×106 L/mol, for Ni2+ and Cd2+, respectively, was determined. The limit of detection of 2pdab in sensing Ni2+ and Cd2+ was observed to be 3.08 μM and 1.4688 μM, respectively. The selectivity of 2pdab to detect Cd2+ and Ni2+ among various other competitive ions was also studied. The sensor, 2pdab, was applied in real time application for detection of nickel ion in river water sample.