Relay Functionality Issue in Circuit with Waveshare TOF Laser

Hi,
Not a softwavre more likely circuit problem.
In the current circuit setup, the relay operates flawlessly without any load, successfully switching the 5V voltage on and off. However, upon connecting the Waveshare TOF laser, the relay fails to activate. This behavior suggests a potential issue within the circuit. Here is the shematics:

Thank you for your help.

What is the power source of this setup?
9V battery?
Also, 5V is not correct voltage on nano VIN.

Yes 9v battery. 5.2V is on VIN.

Vin has to be at least 6.5V and 9V "box battery" is not able to power up your setup.
Your schematic leaves much guesswork.

You have some voltage regulator on your setup. What exactly?

If I add direct power to laser sensor it works. A dc dc step down converter is the voltage regulator. 3A max

If you don't want to tell what regulator, I need to guess again...

Give your step down converter 5 AA batteries in series to input. From 5V output power Nano to 5V pin, not VIN.

Your relay circuit probably needs flyback diode as well, but it's secondary .

Unfortunately I do not know the exact type of converter, but I will check. I have place only for the 9V battery

This is the step down module

Not really. That same behavior could be caused by an error in you code.

Wat Was it also connected to the nano?

An oled display, micro servo, incremental rotaty sensor, capacitive button, and a normal button.

Sorry for the typo
When you had direct power to the laser was it also connected to the nano D10, D11 pins?

Yes

Can't you wire another power source, like 5-6AA batteries or 9V PSU to the battery contacts?
Arduino, laser, relay through buck converter can draw way more than 300mA and 9V battery is not reliable power source.
Did you move the 5V supply from arduino VIN to 5V pin?

Was the direct power supply also powering your custom board or was it a separate supply?

I have only one power supply for powering everything. When I made the first prototype and just wired the parts together it worked flawlessly. Now with the pcb I have this problem.

When I also add power through USB port it works.

Not a surprise, correctly powered to 5V with sufficient current.
Which doesn't happen if you give 5V to VIN and especially if your battery can't provide sufficient current...

If this is your only choice it is best to abandon your project It will not work as indicated.

If I add the 9V directly to VIN and the laser will get the power through the DC DC converter?