5 Myths Everyone Believes about Arduino (that aren’t true)

Having spent the past 6 years writing code for the Arduino platform, I’ve noticed a trend in myths from both new-comers and veteran users. Here are the Top 5 Myths I see come up on forums, in classes, and on IRC.

1. The Arduino uses its own Language

This myth isn’t helped by the Arduino.cc home page which says

“The microcontroller on the board is programmed using the Arduino programming language.

While it is true that the structure of an Arduino sketch looks unique, it is really just C++ with a tiny bit of preprocessing. Users writing “Arduino Code” are actually writing C++ with, what I call, the Arduino Library. Functions like digitalWrite() are just that, C++ functions.

So while the Arduino Library does a great job of making microcontroller programming very simple, it is not its own language.

2. Pin 13 Has a Resistor

Countless tutorials have lulled newbies into this trap. The very first Arduino board, of which something like 200 were produced, had a LED and series resistor on Pin 13. That’s the only board which did. So you should never never never connect a LED to Pin 13, without a resistor!

Update: Clarification. There *is* a resistor on Pin 13. However, it is only connected to the LED that is in series with it to ground. So that resistor does *nothing* to protect anything you attach to the pin, like your own LED.

3. Commercial products don’t use Arduino

Corollary: “real” engineers don’t use Arduino!

Okay. I try not to toot this horn, but I’m a “real engineer.”  You already know that: it’s in my twitter name and URL. Here’s a top secret piece of information:  I use Arduino. Now it is true. You aren’t going to go to Best Buy or your local big-box electronics store and find any products that have an “Arduino Inside” sticker. However, Arduino is a prototyping platform. You aren’t going to ship an Uno with every product. You might, however, develop a product with an Arduino and embed the ATmega328 inside of it. Or, more likely, you’ll prototype the idea, run it through a crowd funding effort and then redesign.

You have to define what “commercial” means, but there are plenty of products out there that started with an Arduino in the early stages.

Ever hear of 3D printers?

4. analogWrite() is Analog

This one catches a lot of people who don’t really understand Pulse-Width Modulation. With the exception of the “Due”, Arduino boards do not output “analog” signals. (Note, you might want to watch this video on the difference between Analog and Digital.)

PWM signals are actually digital signals, where you change the length of time between the “on” and “off” states.

5. The Header Spacing was a mistake (or it wasn’t.)

If you know anything about the Arduino pinout, you should know that the spacing between pins 7 and 8 isn’t 0.1″ (or 2.54mm). At one point the Arduino web site had this in the FAQ as an “eleventh hour” mistake. Then there was the explanation that it prevented shields being plugged in backwards. Now, I’m not sure if it was intentional, but it is true that a benefit of the spacing is that you can’t plug in a shield backwards.

The perceived downside to this decision is that it makes the board difficult to plug into a breadboard, or a shield into a breadboard. However, magic jumper wires do exist which solve this “problem.”

Okay, so those are the 5 Myths I encounter most.

Question: What other myths have you heard or helped to dispel? You can leave a comment by clicking here.

Long comments, URLs, and code tend to get flagged for spam moderation. No need to resubmit.

ALL comments submitted with fake or throw-away services are deleted, regardless of content.

Don't be a dweeb.

Leave a comment

62 thoughts on “5 Myths Everyone Believes about Arduino (that aren’t true)

  1. I don’t know if I agree that the Arduino sketches are just C++. Then again, I don’t know if it even matters. But for the sake correctly understanding what sketches really are, I think you have to start with how to define what C++ is. C++ is a defined language and the Arduino sketches do not adhere to that definition. If so, then by definition it is not C++. The Arduino sketches cannot be compiled with a C++ compiler. They have to be cross compiled as a first step. So that alone tells me it is not C++. If it was, I wouldn’t need the Arduino IDE to compile anything for me.

    If is C++, why can’t you create a class, why can’t you inherit, why can’t you have two programs call each other? Why can’t I create a constructor and destructor? C++ is an OO language, but sketches are not. These are all fundamental to C++. Without them, I don’t think you can call it C++. Using a C++ library doesn’t make it C++, as I can do that from VB.

    I don’t really know exactly what the Arduino language is. But it seems to be some some pseudo C language sitting on top of C++. The Arduino IDE does some cross-language compile from Arduino into C++, then it uses the AVR compiler to compile C++. That makes the Arduino IDE a cross-language compiler, I think that is the Processing compiler or a branch of it, right?

    I have actually written a few cross-language compilers professionally. So I can write a COBOL to C++ cross language. But that wouldn’t mean that COBOL is now C++. My compiler would not be C++ compiler. The same as the Arduino compiler based on Processing is not a C++ compiler. It seems to be a cross-language compiler from sketch to C++. If so, then by definition, it is not C++.

    Just my two-cents worth… as a previous C++ compiler developer and a current C# developer.

    • I am sorry but, everything you stated is incorrect. There is no cross-compiling happening. You can see the entire (AVR) Arduino library in this Github repo.

      I think you have to start with how to define what C++

      There are ISO/IEC committees that define both C and C++ (among other things.) The latest version of the specification C++20, however, avr-gcc is using an older version of the specification. And depending on the avr-gcc version, you can change which specification is used to compile the code. This fact alone is proof enough that the “Arduino language” is literally just a library for C++.

      The Arduino sketches cannot be compiled with a C++ compiler.

      Um, except that they already are being compiled with a C++ compiler. That is what avr-gcc is, an AVR-targeted version of GCC.

      They have to be cross compiled as a first step.

      Nope. I suspect you do not know what “cross-compile” actually means, though.

      If it was, I wouldn’t need the Arduino IDE to compile anything for me.

      You don’t need the IDE. It simply automates the compiling task, like any other IDE. There are multiple editors that implement their own toolchain, including Atmel Studio. These are (almost) all based on avr-gcc and related tools.

      If is C++, why can’t you create a class, why can’t you inherit, why can’t you have two programs call each other? Why can’t I create a constructor and destructor?

      Except, you can do all of those things. The Serial class inherits from the Stream class, as just one of many examples throughout the Arduino library.

      The rest of your argument in that paragraph is just nonsense.

      The Arduino IDE does some cross-language compile from Arduino into C++

      Again, nope. No cross-compiling. The IDE does do a little bit of pre-processing, but all if it is legal C++. It creates function prototypes, includes some default libraries, and then throws the code into a template with a main() function. It is no different than someone automating a compile with a make file driving their toolchain.

      • A cross-compiler is not the same as a cross-language compiler. I did not say that Arudino was a cross-compiler. Well, actually I said that I didn’t know what it was but that it looked like a cross-language compiler, meaning a source-to-source compiler of some sorts. Oh, I just read what I posted again… and sorry I did say cross-compiled. My mistake! I meant cross-language compiled, as I mention later down in the post. My point was that it looked like any of the thousands of cross-language or source-to-source compilers or syntax-translators that just flip things around a bit before passing the code off to the compiler.

        >>Nope. I suspect you do not know what “cross-compile” actually means, though.
        I have written many of them over the past 30+ years. I know what it means. I meant cross-language compiled as I mention later in my post.

        >>The rest of your argument in that paragraph is just nonsense.
        >>>>The Arduino IDE does some cross-language compile from Arduino into C++.
        Not sure why you think that is nonsense. Cross-language compilation is taking one high level language and using a compiler to output another high-level language. Compared to just a syntax-translation that does not use a compile process… and compared to being compiled to an intermediate or machine language.

        >>Um, except that they already are being compiled with a C++ compiler.
        The sketch is not compiled with the C++ compiler. It is preprocessed and the results passed into avr-gcc for compiling. I get that it is just semantics here, but it is important to me when trying to understand what the Arduino IDE and sketch is actually doing.

        One of my complaints with Arduino as a learning tool for software is that I cannot teach students things like classes, object, inheritance, constructors, destructors, overloading, etc. Based on what you said, setup() and loop() are function prototypes that are then dropped into a template and compiled with avr-gcc. Thanks for explaining that, as that is the key to understanding how it works.

        Based on what you are saying, I should be able to take a sketch program and use Amtel Studio and a template and compile it with avr-gcc. So at that point, it would just be like any other ATMega chip. Can I do that?

      • I went back and read all of this again to see if I am misunderstanding something, as I get what you are saying and after you explained how the Arduino IDE works, I do not disagree with you in regards to it being fully C++. I get that now.

        However, Arduino says that their language is Sketch. From what I have seen, you cannot do all of things I listed earlier such as creating two classes, having one class use the other, have them inherit from each other, create a constructor, destructor, create a library, etc.. If you can, I would like to know. I spent a lot of time on their forum where they say you cannot. It is my understanding that to do any of that, you have to leave the Arduino IDE and Sketch and build a C++ library that you can call from a sketch.

        I’m coming from the point of view of using Arduino to teach beginning level software development and I am frustrated that after investing so much time into Arduino, I really cannot use it without having to jump over to C++. I think it is a common frustration. If there is a better way, I’d love to know.

  2. I was reading about the header spacing issue some days ago, and there is a post on the arduino forums which confirms it was a mistake, the actual arduino “founder” himself confirmed he screwed up in the design and that they had no time to check the files, as the board manufacturer for the first batch had told them he needed the files next morning or they would be delayed for the next month.

  3. Real engineers now have the ability to make custom lab equipment for data measurement and acquisition that 10-15 years ago would have required an expensive license and data acquisition board from the 800 pound gorilla of data acquisition. As soon as another competitor for low cost boards popped up, they bought them and poof, no more inexpensive competition. For those of us engineers in experimental R&D, the explosion of low cost boards with modest data acquisition rates is nirvana. Sometimes you don’t have an undergrad/ grad student to sit and watch the test for time x logging temperature, or they can do higher level work actually analyzing the other data, or working out how the next step can be done. Now I can put together a miniature controlled environment chamber with a couple thermocouples, a thermoelectric cooler/heater, an Arduino and the PID library some kind soul worked out and shared with the world. It fits my sample! It compensates when the university shuts off the chillers in the fall and we have a heat wave! It slices and dices! Well, not yet, but the next version could!

    Real engineers use the technology that fits the requirements, and if you’re too snooty to use a low cost board that fits the actual needs, you may find yourself looking for another job, when the kid that can design and test within an order of magnitude finishes the proof of concept prototype at half the cost or half the time.

  4. about pin 13 it depends if you sink or source the pin 13 it will use the leds resiser if your using the pin as ground,ive never used resistor on that pin and its fine,if i do its verry dim lit as its usinf two tesistors,the other pins work brighter with the resistor wich seems to back up my theory,i could be totaly wrong of cource,this ive been told by arduino makers,

    • I’m not sure your statements make sense.

      From the Diecmila to the Uno R2, there was a current limiting resistor for the LED on the board. However, that has no effect on limiting current to an LED connected at the pin header. From the R3 on, an op-amp circuit was used to reduce loading that the LED and Resistor presented to the pin. Again, has no effect on what you attach to the pin.

      Your “experiment” would be better down with measurements, not a visual comparison.

  5. Four(ty) years ago I coont evn spel injuneer, now I are won. No offense intended to anyone. Maybe you hear the line also, “Really. You don’t look like an engineer.” Still never figured that one out, what are we supposed to look like? If I might paraphrase point number 3 thus allowing it’s removal from the myth list;

    Real engineers aren’t afraid to use Arduino.

  6. QUOTE: The very first Arduino board, of which something like 200 were produced, had a LED and series resistor on Pin 13. That’s the only board which did.

    Actually ALL current Arduino boards DO have “a LED and a [series] resistor” connected from pin 13 to ground.

    There is no SERIES resistor between the Atmel chip and the pin 13 connector.

    Regards, Terry King …In The Woods In Vermont

  7. -First of all thanks for the post.

    -Second, if I get it right, these statements below are all true:

    1) Let’s go on through an example. Let’s say I want to produce a rgb mood light and sell it commercially. And my product is something that does not need firmware upgrade or sth like that…

    I have an arduino board, rgb led and arduino sketch. I connect the rgb led with arduino and upload my skecth to it and it works when I power it. So this is basically a prototype.
    Now let’s say I want to sell it as a commercial product. Since using an arduino board in every product might cost a lot I decided to use an atmel chip instead. I programmed my atmel chip with arduino board and arduino ide. So my final product will have a chip and a led. And a casing.
    So I’m free to sell this product locally, worldwide or online without any copyright etc. restrictions? It does not have an arduino inside right?
    And I do not have to open up my sketch/circuit to public?

    2) Let’s say I’ve made a complicated device which needs to have an arduino inside to run. And some other components.
    I can make an arduino based on the open source diagram and use it inside my device. Add other components etc.
    And I do not have to mention that the device uses an arduino inside?
    And I do not have to open up my sketch/circuit to public?

    3) Same situation as number 2 but instead of making one, I buy arduino compatible boards and use them.
    And I do not have to mention that the device uses an arduino inside?
    And I do not have to open up my sketch/circuit to public?

    4) I use a sketch with gpl (without changing/modyfyng any codes) in my device.
    And I do not have to open up my circuit to public?
    And I do not have to mention the code inside is open source?

      • I would like to point out that the majority of 3D Printers are made with some form of Arduino (using RAMPS shield) or are an off shoot Arduino + RAMPS rolled into a single board. Marlin is one of the more popular firmwares and is programed using the Arduino IDE.
        So yes you can use Arduino commercially and yes engineers do use Arduinos that do go to market.

        • I get the point of what people are saying… it is not necessary to use an Arduino prototyping board in a commercial product. Sure you can by a $50 board and use it in a commercial product, but you can produce a $1 pcb and upload your Arduino code to a $1 chip and save your $50 Arduino board for prototyping. But if you use the Arduino IDE to program that chip, technically it is an Arduino compatible board… and sure you can and people do and have taken products like this to market.

          Besides, Banzi is an engineer and millions of Arduino boards have been sold. So it is certainly a commercial product that has done very well. The fact that people are even arguing the point, proves it.