How To Program An Arduino Nano Using The IDE

Step by step guide to using and programing an Arduino Nano.

The Nano is an extremely useful board. It is small, cheap and can be used for most model railroad and diorama needs.

It has  12  digital pins,  with pins  3, 5, 6, 9, 10 and 11 being pwm pins and,   7 analog pins,  just the same as its bigger and more expensive companion UNO.

There are 7 analog pins.  A0 to A5 can be used as digital pins. A6 and A7 are limited to use as analog input pins.

So effectively you have 16 pins that can be used as digital pins.

Adding sketches (Arduino lingo for a program) to a Nano requires a little different approach which is dependent on the board that you use.

Clone Nano boards often use different chips.  And programing is chip dependent. So you must check the board specifications sheet provided by your manufacturer to see which chip is on the board.

If  your board has a CH340 chip, you will have to install the CH340 chip driver on your computer.

Go to this page and download the driver.  It will be a .zip file. Unzip the file and install the driver.

After installation, when you upload a sketch to a Nano with the CH340 chip, the IDE will automatically use that driver.

We assume that you have downloaded and installed the Arduino IDE.  If not, get it here.

And if you do not know how to use it, this will take you to a good tutorial.  Click here.

To install a program on your Nano, open the IDE and go to File and choose new.  Overwrite what you see with your sketch.

If you would like to see a large number of sketches made just for model railroaders and diorama makers, look at our Free Arduino Sketchbook.

Name it and save it.

Connect your Nano to your computer.

Go to Tools and select your board, which will be, of course, a Nano







And then you have to make a choice that is chip dependent.  You have three choices.

Sometimes it is a sheer guess. Start at the top and it your program won’t load, choose the next.

With the CH340 chip on the clone boards we use,  the old bootloader is the choice.




The next step is to establish communications between your computer and the board.  Go to port and click on the port that shows the check mark.






Now it is a simple matter of clicking on the upload arrow that you find just under EDIT at the top left of your screen.


Once you have it programmed,  there is no need, nor your desire, to keep it connected to your computer.   But it does need power.  And there are a couple ways to do that. This page shows you how to do that.


We hope that you found the information in this page useful. The internet is all about getting and giving. And giving back is the best. Please donate $1 or more to aid us in our continuing quest to add to and polish the information in our site.

Scroll to top