How to build a 12v to 5v conversor with a zener?
I'm developing a shield for my Arduino Uno and I want to add in it an external power supply. The power source I want to plug in it has four connectors: 5v, gnd, gnd and 12v. The 5v and the gnd pin goes to their respective pins in Arduino, while the 12v pin goes to a 7805 on the shield or to Vin, and the selection is made with a jumper. The only problem is that the connector can be plugged inverted, swapping 5v and 12, which would damage the AT mega. I know zener diodes are useful for limiting power, but I don't know how to use it. I need a simple circuit in which I can plug my 5v supply and it gets 5v to the chip, and in case I plug the connector inverted, to limit its power to 5v to prevent damage or to shut down the power. I can’t use the 7805 on both pins, because it would deliver something like 4v or less if powered with 5v. And something like a led to indicate that the connector is at a wrong position would be nice too. Thank you.