I am new to this and a strange phenomenon happens to me when I disconnect the USB from the Arduino Uno.
I have a small program with two HS311 servomotors.
Between these two servos, I programmed three routines that are repeated in a loop.
The problem is that when I deploy it works fine until I disconnect the USB cable. When I take out the USB cable, the program does anything. It seems to be deprogrammed.
Has this happened to you?
Will there be something I am doing wrong?
I would appreciate any suggestions to understand what happens to me.
cessariuss:
Will there be something I am doing wrong?
if you were to show us the code, the wiring, the type of Arduino you are using and how things are powered - that would help us help you...
for example if you have a while (!Serial); // wait for serial port to connect. Needed for native USBline in the setup you might be stuck in an infinite loop when you unplug the USB cable depending on your arduino...
Servos are powered from arduino board
those servos need ~200mA each when moving with no load... that's a lot of power going through your board... if there is a load, you might be in trouble.....
Please correct your post above and add code tags around your code: [code]`` [color=blue]// your code is here[/color] ``[/code].
It should look like this:// your code is here
(Also press ctrl-T (PC) or cmd-T (Mac) in the IDE before copying to indent your code properly)
————————
can you post a picture ? are you sure the grounds are properly connected ?
as mentioned, that's a lot of current going through your Arduino if the servomotors do any work
cessariuss:
Should I add an independent power source for servos?
Check first if the jack power supply is working. What kind of 9V is it ? (The 9V rectangular battery won’t do, is it a 9V DC power supply connected to main ? what power ?)
You can connect both usb and the jack if you have a good Arduino => get stuff printed to Serial
Check first if the jack power supply is working. What kind of 9V is it ? (The 9V rectangular battery won’t do, is it a 9V DC power supply connected to main ? what power ?)
You can connect both usb and the jack if you have a good Arduino => get stuff printed to Serial
The power source is 9V DC 650mA and is connected as shown in the diagram, to the 9V input (not usb).
The power source is a 220V AC transformer that lowers the voltage to 9 V DC.
I have also tried powering only with USB. Connected via USB to the PC the program works fine. The fault occurs only when the Arduino is energized with the 9V power source (transformer).