Hi! I am having a problem that lies with the power supply of my project (I think).
The project is supposed to run with an external power supply which I attached to the Vin of the arduino. While debugging my code, I had both this external supply and the USB cable attached (USB to my computer). Now the code is clean, I want the project to run on the external supply only. But, when I disconnect the usb cable the project stops working (also after resetting the arduino).
The servos just start moving back and forth randomly. If I then reconnect the usb and reset the arduino everything is fine again.
I tried the wiring as shown in the attached drawings, both ways only work when both USB and external power are connected. The supply voltage is 7,2V when the servos are connected directly to the power supply and 9V when the servos are powered by the 5V output of the arduino.
I used two different arduinos to test (UNO and UNO rev3)
I've had arduinos working with servos and an external power supply before and have no idea why this is not working, I think the code is fine as it is working perfectly when both the USB and the external power supply are connected.
Thanks for reading, I hope you can help