You can tell if AC is connected by reading ADC number 3. I believe it shows input voltage level (or something similar). It appears to give three levels: 0 - No power source connected about 0x100 - power source connected, charging about 0x170 - power source connected, not charging. If it is indeed showing input voltage level, then the reading will depend on charger used. A well regulated source will give the same level, whether charging or not.