DC barrel jack layout
1 is the center pin, so it will be positive.

2 is the outside contact, so it will be negative.

3 is the sense pin that is disconnected from the outside contact when a plug is inserted. It should be connected to the sense connection when one exists, otherwise is should be left unconnected.