My code runs differently on external power than on USB connected to laptop.

Hi all.

I started playing around with arduinos recently and I found a wierd problem.

When I push code to the arduino I can get it to work as I wish, no problem. But when I unplug it and set it to run on external power everything messes up.

For reference I have a relay that is supposed to turn on when a soil moisture porbe reads below a certain value, but only for a couple of seconds. This works fine on the PC power, buit when I hook it up to my 12 V power supply the relay is permanently on.

Any help appriciate. :slight_smile:

The contents of your sketch may be useful.
Please post sketches using the code tags ( </> )

Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.