For Grove VCC selection you can use a small slide switch. Choose SPDT if you only switch the power rail; choose DPDT if you also want to manage the I2C pull-ups with the same lever.
SPDT + level shifting (recommended for 5 V compatibility): Use an SPDT to pick 3.3 V or 5 V on the Grove VCC pin, and keep SDA/SCL pull‑ups fixed at 3.3 V on the baseboard. Add a tiny bidirectional I2C level shifter between MCU and connector so 5 V modules don’t over‑voltage the MCU.
DPDT without a level shifter (only if MCU side will never see 5 V): Use one pole for VCC and the other to either move the Grove’s pull‑ups to 3.3 V/5 V or disconnect them when at 5 V. Only do this if you are sure the MCU pins will not be pulled to 5 V. Otherwise, add level shifting.
I2C pull-up rules to keep it reliable
Include pull‑ups on SDA/SCL; default value is 4.7 kΩ.
Keep total bus capacitance at or below 400 pF.
Remember pull‑ups draw idle current I = V/R; stronger pull‑ups cost more battery.
Questions to finalize
Do you prefer THT or SMT for the switch?
What’s the maximum current you expect on the Grove VCC (typical modules are modest, but this sets the switch rating)?
Do you want me to add the switch and a small I2C level shifter now?
Here’s what SW1 (C&K JS202011SCQN) does and how its pins work:
What it is (from the datasheet)
“Switch Function 2020: DPDT” and “N: Non-shorting” (C&K JS Series datasheet).
“Circuit Diagram C: Common Pin (Bottom View)” indicates the center terminals are the commons.
How the 6 pins function
It’s a 2‑position DPDT slide switch: two independent 3‑terminal switches.
For each pole, the middle pin is the common; sliding connects that middle pin to one outer pin or the other (non‑shorting between throws).
Practical grouping:
Pole A: pins 1–2–3 (2 is common).
Pole B: pins 4–5–6 (5 is common).
One position: 2→1 and 5→4; other position: 2→3 and 5→6. Verify orientation on your footprint using the pad‑1 marker and the “Bottom View” diagram in the datasheet.
Typical use in your design
Use one pole to select Grove VCC: tie 3.3 V to one outer, 5 V to the other, and route the Grove VCC to the middle (common).
Use the second pole to manage I2C pull‑ups (select 3.3 V vs 5 V, or disconnect) or to drive an ID/enable signal.