Why do you have two charge circuits? Assuming that we're talking about a normal North American style SAE J1772 "J plug" (IEC 62196 Type 1) the same two conductors are used regardless of voltage so no switching is required; the same terminal (labelled "N") is "AC Neutral" for 120 V Level 1 charging or "AC Line 2" for 208–240 V Level 2 charging. I assume that normal practice, as catphish suggested, is to use a single onboard charger which accepts the whole range (from somewhat less than 120 V to somewhat more than 240 V, usually 100 to 250 V) without a configuration change.I need to figure out if I have a 120Vac in or a 240Vac on the pin2 on the J1772 connector to enable my L1 charge circuit or my L2 charge circuit.
I'm not trying to be difficult or disregard the original question, but the best answer to "how do I detect voltage and switch charging circuits" may actually be "don't detect voltage and always use the same single charging circuit".