A problem with arduino nano and relay

so I am working on a simple project of making a lap turn on and off using a relay.

I first connected the relay to the arduino and to the exteernal ac, had the arduino powered from the pc using usb and everything was fine.

The problem started when i tried to connect to an external poer supply.
so i have this board that takes 220v ac and converts it to 12v dc. i connected it ti the vin and gnd pins on the arduino nano.

i left the usb power and did not connect this converter to the ac yet. for some reason a led on the board turned on (could it be that the arduino is feeding it ?) and the main problem is that the relay stopped working. the light turns on but the coil doesnt switch.
what could be the cause of this and how do i fix this ?

I hope the relay is not connected directly to the Arduino output. All relays etc need to be isolated from the Arduino by a transistor or MOSFET. All relays and motors also need a reverse connected diode across the coil to remove reverse voltage spike when the power is removed.



Can you please post a copy of your sketch, using code tags?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

We can then give you better answers to your questions and help you with a solution.

Tom..... :slight_smile: