Four naphthalenediimide colorimetric pH indicators were synthesized with N,N-dimethylethyleneamine at the imide positions and with 5- to 7-membered heterocyclic rings at the bay positions, namely pyrrolidine, morpholine, piperidine and azepane. The pH indicators are constructed in a modular receptor–spacer–fluorophore–spacer–receptor format based on a photoinduced electron transfer (PET) design. The compounds were studied by UV–visible absorption and steady-state fluorescence spectroscopy in 1:1 (v/v) methanol/water. Brilliant colour changes are observed between pH 2 and 4 due to an internal charge transfer (ICT) mechanism. Fluorescence turn-on enhancements range from 10–37 fold; however, the maximum fluorescence quantum yield in the presence of acid is <0.004, which is below naked eye detection. Hence, from the viewpoint of a human observer, these chemosensors function as colorimetric YES logic gates, and fluorimetric PASS 0 logic gates.