HOME > > ELECTRONICS MAIN PAGE > > ELECTRONICS PROJECTS CONTENTS > > MISC MICROCONTROLLERS > > ARDUINO PLUG

Introduction to Arduino

This page is more diary than discourse!

I put it together with two intentions...

--- I hope that when you read it some of the fun that I've had in my early Arduino days will come across... and encourage you to give one a try

--- I hope that may come across this before getting your own Arduino, and that it will help you get up and running quickly.

If you are looking for a more disciplined, formal, and organized guide to programming the Arduino, then may I recommend my tutorial? I may be new to the Arduino, but I've been playing with computers for forty years, and taught for twenty.

If you are looking for a general overview of why I like the Arduino, there's a page with that information, too. This page gets into the "doing it" stuff.

So! Down to the tale....


About noon, Sunday 27 January 2008, in the UK, I ordered an Arduino Diecimila from Tinker.IT, for delivery to a UK address.

Theirs is a nice, no hassle, sensible website.

Monday: I'm doing my Arduino investigations on an XP machine, so I studied the getting started guide, and downloaded the Windows zip file (cite source). Note that Linux or the Mac X OS, are acceptable too. (And Vista is okay, too.)

All I had to download was one simple zip archive. Just one file. Nothing clever or complicated.

I merely double clicked on the file, and XP's internal unzipper took me inside.

Next, I created an empty folder on my desktop. Named it ArduinoSys. Dragged the files and folders from the zip viewer into the empty folder. Moved my ArduinoSys folder to C:\Program Files.

Somewhere along the line, maybe by me... not sure... an "Arduino" folder appeared in MyDocs. I think the Arduino program created it. I'd want things I'd written for the Arduino to be in a place like that. For the moment, I'm going with the flow... It is simple, and works well.

You DON'T need to run any "setup" type program, or installer. (For instance, you don't need to run the batch file "RUN.BAT) You probably should create a shortcut to the Arduino application (It is simply called "Arduino.exe", although the ".exe" part will not be showing on some people's systems.) Put that someplace "sensible". (It is a Bad Idea to routinely be going directly, i.e. not via shortcut, into anything in your Program Files folder or its subfolders.)

On Monday, I also created a connector so that I could run my Arduino from a 9v battery. This is not necessary, but can be fun. While it is connected to a turned-on PC, the Arduino draws the power it needs from there across it's USB connection.

The battery option is really simple. There's a guide at the LadyAda site.

The Arduino won't run VERY long on a 9v battery, but it WILL run from the 12v socket in your car, although car electricity can be a bit hostile... spikes and such. If you attach your Arduino to many LEDs, etc, they will further shorten the run- on- battery time... but if you want to amaze your friends at the pub, the battery is a neat option.

** Just be sure to wire the connector CORRECTLY: Pin positive. **

Don't be caught by the following Gotcha. Going to battery operation or back to USB-powered operation involves changing a link on the Arduino. Not hard. Just hard to remember. Happily, if you forget- no harm done, unless you leave the battery plugged in, and even then the "harm" is only needlessly using up the battery. The Arduino has a nice little LED to tell you that you have power... if you do! (The jumper is between the USB connector and the power connector, and helpfully labeled "PWR SEL". I really like how things are kept SIMPLE and TIDY with this great little microcontroller.)

Tuesday morning: My Arduino arrived! It took my PC more time to boot up than it took me to get my first Arduino program running!

BEFORE you plug your Arduino in for the first time....

Get the unzipped contents of the Arduino software in the place you want to keep it. At least the Drivers folder.

You also need a Java run time engine. You may well have one already. Have a look in C:\Program Files for a folder called Java. If you find that, look in it for one or more folders with names starting "JRE", which comes from "Java Runtime Environment", which is all you need.

If you don't already have Java on your machine, head on over to java.com and make the download. You don't need to get into the SDK, or NetBeans, or anything complicated. (It is a bit like getting the Adobe Acrobat Reader without bothering to get anything else from Adobe.... although it is better, because neither the Java people nor the Arduino people will pester you, or try to send you things beyond what you asked for, wanted. (Rant concludes.)

That's it! You're ready! Remember, with a Diecimila, there's no need for a power supply while the device is connected via USB.

The following IS covered in the "official" documentation, covered well... I just want to offer a second "take" on getting started, from one Arduino novice to another! (I've have had my first Arduino for three hours as I write this! (And it is still working MANY hours later, as I edit it!))

Plug it in. The first time you do, you should get Windows' New Hardware wizard (NHW).

Tell it you DON'T want it to search the internet for drivers. Tell it you'll show it where the drivers you want are; browse down to the "Drivers" folder from what you unzipped, and to the FTDI USB drivers folder within that.

Click "Next" as many times as it takes to complete the NWH once....

... and don't be alarmed when it starts again! You have to go through it twice. I think that the first pass connects your PC to something inside the Arduino, and the second pass sets up something that the thing in the Arduino uses. (You are creating a virtual serial port which is actually accessed across your USB hardware.)

If, as things were in my case, you have the official Arduino "Getting started" documentation open on your screen, don't be alarmed, as I was, to see a THIRD, and UNRESPONSIVE (!) "instance" of the NHW after the first two NHW windows came and went. I mistook the screenshot of the NHW in the documentation for another run of the NHW.... :-) (Color the smiley face red.)

Onward!

Fire up "Arduino.exe" via the shortcut discussed above.

I can't remember whether "Blink" was loaded automatically the first time I ran Arduino.exe, or whether I loaded it. If it isn't loaded, load it! It's in the Digital folder of the Examples folder. The Edit item on the menu bar doesn't have a "Load" item. You access what I would call "programs", some would call "applications", and Arduino seems to call "Sketches" via the Sketchbook menu item under the "Edit" main menu entry. Don't do any saving (yet).

Try "File | Upload To I/O Board", or the equivalent speedbutton.

If all is well, the little yellow LED marked "L", above the pair marked TX and RX, will start a slow on/ off/ on/ off winking. (1 second on, 1 off).

You may well get an error message about choosing your serial port. If you have no other serial devices plugged into your machine, you can probably find what port you need by trial and error. If you DO have other serial devices, it would be as well to go into the Device Manager (I hope you know how! Not hard to do. Just hard to explain!) Look under Ports for USB Serial Port, and note the port's number. On my machine it was COM4. (It doesn't appear in the list, by the way, if your Arduino isn't plugged in to your PC at the time, or if the Arduino has no power because the link for Battery Operation is in place but the battery isn't.) You set your Arduino.Exe, which I'm going to call "the Development Tool" from now on, to use the right port with the Tools menu item, sub-menu "Serial Port". Again... wonderfully simple, and as clear as it can be. If you don't have the background that I do, the years of banging a head against unclear prompts and systems, then...

a) Don't worry. ANYONE can set up and use an Arduino
b) That's what this guide is for, to help you with "little" things
c) Be grateful you're starting now, when these things are EASY! :-)

Try to "Upload to I/O Board" again. Note that you don't have to do anything to "start" the program in the Arduino after it has been uploaded. That is taken care of for you by the (wonderful, friendly) system.

If you didn't get your Arduino working as easily as I am hoping, please email, tell me where your problem was, so that I can improve this guide?

At this point, do a File | SaveAs.

Save the demo program "Blink" in a folder called Arduino in your MyDocuments folder. If you like, you can make a "FirstTrials" folder in your Arduino folder in your MyDocuments folder. Save it as MyBlink, or some-such name.... I just want to be sure that we don't do anything to the ORIGINAL Blink demo.

I'm sorry: I don't remember if the Development Tool automatically moved to MyDocuments for the SaveAs, whether it created the Arduino sub-folder, etc. I'm sure you can take care of what's necessary, can't you? I hope so! (I will try to revisit this with a "new" machine someday.)

Now come out of everything.

Use Windows Explorer or "My Computer", whatever, to....

Make a COPY of the "Examples" folder from the Arduino distribution.
Put that copy in your "MyDocuments/Arduino" folder.
Right click on the Examples COPY.
Click on Properties.
Click on the box by "Read Only" to make the folder read-only.
Click "OK"
Select "Apply to all subfolders"

Done! Now re-start the development tool.

Under Edit|Sketchbook, you should have easy access to the protected copies of the "sketches" supplied by the Arduino team.

Explore! Enjoy!

I'd write more, but I think I'll go play with my lovely Arduino instead.

Since writing the above, I've played quite a bit. I've also started some tutorials to help you master programming the device.


Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, Sheepdog Software (tm), download something, and circulate it for me? At least (please) send an 'I liked the parallel port use page, and I'm from (country/ state)' email? (No... I don't do spam) Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.

Don't forget to check out the programs for controlling the state of the parallel port at my shareware site. There are two free programs there... one for toggling bits, the other for using the computer as a timer via the parallel port.


Here is how you can contact this page's editor.
Click here to go up to general page about electronics by editor of this page.
Click here to go up to general page about electronic projects by editor of this page.
Why does this page have a script that loads a tiny graphic? I have my web traffic monitored for me by eXTReMe tracker. They offer a free tracker. If you want to try it, check out eXTReMe's site. The Google panels and the search panel are also script based.

Valid HTML 4.01 Transitional Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org


....... P a g e . . . E n d s .....