alternative to DC plug

Hi!

I’m new to arduino.
I just want to ask you if I can safely use Vin (with polarity +) and GND (with polarity -) replacing the DC Plug.

I’m using arduino uno and when I unplug the cable from the laptop the arduino doesn’t work anymore…

I also use a transformer with 4.5 Volts of output.

Thanks

4.5VDC should connect to 5V/Gnd.
Vin needs >=6VDC.

There's a voltage regulator on the board and like with any voltage regulator, it needs an input on 2V above the output I order to provide a constant voltage. This means that ideally, you need to feed 7V or higher, however mine's worked when I've fed it with a 5V regulated power supply.

The regulator can only convert a higher voltage to a lower voltage, it can't take 4.5V and convert it to 5V ;)

Better is to connect a normal 9V Battery or a rectified output from a 8-10V transformer with the right polarity. Remember in the jack the centre is +ve and the outer is GND.