Tell the difference between 3.7V battery power and USB power - will this work?

He is measuring the same Vbatt with 2 different Vcc's (Vref).