Let's see how to make a super compact, cheap and simple ON/OFF redstone Nether portal in Minecraft.
Place a sticky piston on the left side
Place one observer on it, facing the outside
Next to that observer place a dispenser and another observer facing downward to another dispenser
Place 1 repeater (3 ticks) and one redstone on top
In the top dispenser, place a lighter. And place a water bucket in the other one
Place a lever and 2 optional pressure plates (to avoid water going everywhere if there's a bug)
And that's it! You now know how to create a ON/OFF portal. The components are pretty cheap and that whole thing will avoid pigmen from spawning into your house.