Power Problems

Attached is the diagram showing how I hooked up my Arduino and 10k ohm potentiometer to run my Servo motor. I hooked it up powering it with a 9v battery and it worked great. My intentions are to power it with a 12v marine battery (this setup is for my boat), but when I hooked it up to that, boom the board got hot and wont work anymore? I was told this is the correct setup to use if I want to power it from a 12v battery?

Clearly too many volts are getting to the board and frying it? My question is, what if in the positive and negative lines to the battery, I put in a inline voltage regulator (12v to 9v)? Will this solve my problems??

It works great with a 9v battery, and I would just use that but im not sure how long the battery will last powering the board and making the servo run??

2423920cf0fca2b77ba0c780e4af28dca6b66eb8.png

Two concerns to start with.

One is that if the mandatory capacitors are missing from the 7805, it is quite possibly oscillating and feeding a voltage other than 5V out.

The other is that a 9 V “PP3” battery will not be able to power it for any significant duration and all sorts of strange things will happen.

And yes, 12 V is far too much for the Arduino.

ok....so is there a diagram that shows what i need and how to hook it all up? I am new to all of this and I am learning as I go

Thanks