Relay switching issue between 2 sources

issue solved....
Bat+ connected to PC0 (ADC0) which could provide a sneak path from Bat+ to Vcc,

giving you the 2.7V when USB is disconnected.

Try putting a 10K resistor between PC0 and Bat+.

(Because of the high impedance of the ADC input, the reading of the

Bat+ voltage should not be significantly affected by the 10K resistor.)

my thanks to my all friends who spend time to support me thank you very much....