2

NOOB Question: when my Uno is connected to an external power source it will not start running the uploaded sketch. The Arduino web site says it's because the RX pin is not connected and then gets random data.

The site suggests grounding the RX pin using a resistor (granted it suggests a 10K and I used a smaller one ) or connecting it to the TX pin.

From Why doesn't my sketch start when I power up or reset the Arduino board?

Most likely because you are sending serial data to the board when it firsts turns on. During the first few seconds, the bootloader (a program pre-burned onto the chip on the board) listens for the computer to send it a new sketch to be uploaded to the board. After a few seconds without communication, the bootloader will time out and start the sketch that's already on the board. If you continue to send data to the bootloader, it will never time out and your sketch will never start. You'll either need to find a way to stop serial data from arriving for the first few seconds when the board powers (e.g. by enabling the chip that sends the data from within your setup() function) or burn your sketch onto the board with an external programmer, replacing the bootloader.

From Why doesn't my sketch start when I'm powering the board with an external power supply? (Arduino Diecimila or earlier)

Because the RX pin is unconnected, the bootloader on the board may be seeing garbage data coming in, meaning that it never times out and starts your sketch. Try tying the RX pin to ground with a 10K resistor (or connecting RX directly to the TX pin).

Both failed for me.

What should I do?

8
  • To upload your sketch, you have to connect your uno to your system using usb cable. After that you can use any ext. supply
    – Aircraft
    Sep 28, 2015 at 12:38
  • I uploaded the sketch using the USB port connected to my computer. The sketch runs immediately after I upload it (the motor runs). Then I disconnected the USB port and connect a 9V batery to the barrel connector. The "power on light" on the UNO is on, but the sketch does not start.
    – Fabio
    Sep 28, 2015 at 12:43
  • Try uploading some other sketch like blinking led connected to 13 pin then connect your uno to 9v battery and check if led is blinking or not.!
    – Aircraft
    Sep 28, 2015 at 12:53
  • 3
    Motors use large amount of current. A 9v battery can't provide that much current, so the motors won't run.
    – Gerben
    Sep 28, 2015 at 15:44
  • Gerben is right. The problem was the battery. Everything runs fine on a 9V power source connected to the outlet. So, my question is, what batery should I use? The projet is a small robot with 2 "yellow dc motors"
    – Fabio
    Sep 28, 2015 at 21:39

3 Answers 3

4

The problem was, as Gerben said, the battery was too weak to run the engine.

2

I also had a similar problem running with an external power supply. In my case the sketch ran but totally incorrectly . Conected RX to ground with a 10K Ohm resistor and solved the problem.

Thanks for the info!! Others have spent a lot more time solving this problem than I did.

0
2

I will add my little drop of experience here... So I am using a display tm1637, having CLK in 6 and DIO in 5. When connecting the Battery (12V 3s lipo 4000mA) to Vin, the arduino will freeze, even connected to the USB, will still freeze.

Short version, Moving DIO from 5 to 7 corrected the problem, now i have my device running from USB and or battery with no problem.

Long version: after 3 hours of trying different mods, including resistor to RX,TX, to GND, even removing the ch340 chip and connecting Rts and others to GND/VCC.. Nothing, so i decided to move the different devices from One nano to Other but testing after each connection. When the display was connected, the Nano will freeze while running on battery power. So... i moved DIO first to a different pin, and the device started working. I know is a very particular case, but one more thing to try if you are like me, stock without knowing what to do.... moving some pins (maybe skipping 5?)...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.