I will be working with Arduino(s), and I would like to find a way to download the sketches to the board semi permanently, in a way that I can remove the USB from the board, apply power, and still have the Arduino execute the code

I am planning to use Mega2960, Uno, and Nano. If there are any differences between the uploading process, please let me know.

P.S., I am using boards produced by Elegoo, not by Arduino, if that makes a difference.

  • 3
    But... that is basically what happens when you press the "upload" button... it programs your compiled code into the board.
    – Majenko
    Nov 15 '19 at 22:02
  • When I unplugged the Mega, it stopped functioning, although it still had power from a 9v battery. I also tried hitting the reset button.
    – Nutmeg
    Nov 15 '19 at 22:03
  • 2
    Then you either have something in your code or circuit that is broken.
    – Majenko
    Nov 15 '19 at 22:07
  • Oh well... I currently don’t have access to the code currently, as the Mega was at a Robotics Club that I visit.
    – Nutmeg
    Nov 15 '19 at 22:09
  • 1
    A 9V block battery should never be used with an Arduino board. It is only meant for low power applications and cannot provide enough current. So I guess the code stops working, because the Mega does not have enough power and browns out
    – chrisl
    Nov 15 '19 at 23:15
  1. Download the Arduino software (IDE, or Integrated Development Environment).

In our case, we only need to download and run Windows Installer and follow the pop up instructions. When asked if you want to install the Arduino driver, just press Yes.

  1. Connect your Arduino Nano board to your computer.

In this step, Windows should automatically find the proper Arduino driver and install it, and your Nano board should be ready to use. If not, please refer to the above mentioned instruction for details on installing the drivers. Some compatible Nano boards such as DCCduino manufactured by a Chinese company use different USB-to-Serial chips so they require to install different drivers, but the installation should be quite straight forward once you have downloaded the proper drivers from internet.

  1. Launch the Arduino application.

  2. Open the blink example.

Open the LED blink example sketch: File > Examples > 01.Basics > Blink.

For those who are not familiar with Arduino sketch, a sketch is simply a program with various instructions telling Arduino board what to do.

  1. Select your board.

You’ll need to select what type of Arduino board you are using. In our case, simply select Tools > Board > Arduino Nano w/Atmega328.

  1. Select your serial port

You also need to select the serial device of the Arduino board: Tools > Serial Port. Usually the port number will be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port.

  1. Upload the program to Nano board

Now, simply click the “Upload” button in the environment. Wait a few seconds – you should see the RX and TX leds on the board flashing. If the upload is successful, the message “Done uploading.” will appear in the status bar.

A few seconds after the upload finishes, you should see the pin 13 (L) LED on the board start to blink (in orange). If it does, congratulations! You’ve gotten Arduino up-and-running.

Disconnect from your computer and connect to a power supply to see the blinking light.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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