*VIDEO* Program react differently regards of POWER source - USB/BATTERY

How am i suppose to measure it? Sorry for asking, i'm a beginner. I measured the voltage from the external battery when usb cable was pluged into board. In theory usb has 5V (distance sensor is connected to the red 5V on the board) and when i measured the voltage which was in the external battery which was connected to the board (but the switch was OFF) it dropped like 2V!!! From 10V to 8V. Program worked perfectly. How is this possible that besides the switch on the board from the external battery was off (Imgur: The magic of the Internet - first left Green on the top, lower is the switch), board still collect voltage from the external battery. ---------
3 days ago i accidentaly switched that switch ON when USB was connected, and program schuted down that day. I've read that you musnt do that. 10V from batteries + 5V USB = 15. Max voltage that board can handle is 20V so i didn't worry about it much, i switched it off after 0.5 sec.