Phenylene-diimine-capped conjugate of lower rim 1,3-calix[4]arene as molecular receptor for Mg2+ via arm conformational changes followed by aggregation and mimicking the species by molecular mechanics.