So often when electronics need to be added to a project, you hear "we'll just add an Arduino". Many sensor and other breakout boards are labelled "for Arduino", even if they work just as well (or better) with any other microcontroller. Arduino sure has built up a brand that few in this space can match. Is it deserved?

Maybe when Arduino first came on the market, it was. Personally, I don't think it is deserved any more, and makes me cringe every time I hear the name "Arduino" (which is quite often). My (unpopular) opinion on Arduino is that it either should get with the times, or just die. Because it is the default options in many people's minds, it is holding them back in the past. Worse, since it is presented as the easiest way to get started with microcontrollers (which it isn't), its archaic tools may actually turn people away from embedded systems, when they might have been able to enjoy the experience with a more modern tool just fine.

Here's a list of my issues with Arduino:

1. The vast majority of Arduinos still run at 5V. It makes people cling to the past. The electronics world has long moved on to 3.3V and below, requiring level shifting to connect to just about any interesting new component or sensor. 5V logic still has some use in hostile environments, but other than that, it has been put to rest by the industry at large a long time ago. Arduino makes people cling to it unnecessarily, because you get punished with less speed if you use a 3.3V Arduino. Why? Because it's based on old chips that work slower at low voltage, which brings me to the next point.

2. Arduino makes people stick to old, obsolete parts. Not sure when the ATMega series first came out, but it must have been over 10 years ago. Imagine using a PC from over 10 years ago. Embedded technology has made even larger improvements in 10 years. As of this writing, an ATMega328P sells on Digi-Key in quantity at $1.84 a piece. You can get a modern ARM Cortex M0 part (STM32F030C6T6TR) with the same amount of flash and double the RAM on Digi-Key in quantity at $0.77 a piece! Instead of an obsolete 8-bitter running at up to 20 MHz at an obsolete 5V supply voltage, you get a modern 32-bitter running at up to 48 MHz at 3.3V. For the same price as an ATMega328P, you get 32-bitters with 4 times the flash and 8 times the RAM. Even Atmel itself (the manufacturer of the chips used in Arduinos) has such parts, such as the ATSAMD20E17A-MUT. There are literally thousands of better, lower cost parts available.

3. Arduino encourages a one-size-fits-all mentality. People that only know about a hammer pound on everything as if it's a nail. Some chips with less resources, and even cheaper than some of the low-cost powerhouses mentioned in the previous point, have application specific peripherals that make them work beautifully for particular applications. The peripherals of the ATMega series are as aged as its core and are mediocre at best, resulting in a lot of messy software solutions for things that would be much better if implemented with modern micro peripherals.

Case in point. If you run your Arduino at 8 MHz because you want to be compatible with a 3.3V BLE module such as the RN4020, the ATMega328P cannot generate the 115.2 kbps baud rate needed to communicate with this part. When you tell it to initialize the serial port at 115.2 kbps, it will silently fall back to 111.1 kbps instead, leaving you to wonder why you can't communicate with the BLE module. Most modern microcontrollers have fractional baud rate generators which do not suffer from such issues.

4. The AVR core was great when invented in the late '90s but is showing its age. It's 8-bit, resulting in lots of data shuffling if you write code with 16 or 32 bit data types (any time you need values over 255, which is all the time!). Similar algorithms implemented on 32-bitters often require less code space. On top of that, the core exposes its Harvard architecture to the user, requiring different instructions to be used to access flash and RAM, making it necessary to waste large amounts of RAM for constant tables and strings that in a better architecture with a flat memory space could be directly accessed from flash. Arduino is turning the AVR core into the 8051 of this generation: people start with it and never get past it, always having to deal with nasty implementation details that nobody really needs to deal with any more in this day and age.

5. So maybe the hardware is aged, but there's the wonderful Arduino IDE? Actually many micro manufacturers provide a free IDE for their parts, plus there are open source tools available that are lightyears beyond the Arduino IDE. They allow you to actually *gasp*--debug your code! What a novel and awesome idea, when you can actually step through your code and see what it's doing! So much better than dumping in some code and praying it works, which is the Arduino way.

6. But the wonderful software library and all the code available? That's good to some extend, but there are two problems with that. First, a lot of the code you find on the internet is hacked together by kids that barely know what they're doing. It sort of works but be ready to debug the problems in someone else's code (always fun). Definitely not the kind of code you want to design into your product, so better carefully review the libraries you use. Second, using ready-made libraries makes you think you don't need to look into the details, because there are these magic objects that just take care of things, while many times that is just not the case. As brought out in the example mentioned in point 3, the Serial object just hides the fact that the chip can't do 115.2 kbps. Only looking into the datasheet or measuring the generated signal will tell you why communication isn't working, so conveniently hiding the details actually proves to be counterproductive in this case.

As a side note, most micro manufacturers provide API libraries now that make development much more Arduino-like by calling functions instead of accessing the low-level registers directly. Only, they often have checks built-in to make sure you don't shoot yourself in the foot.

7. The above mostly deals with the technical side, how about the educational side? Isn't Arduino helping many people to get in to electronics and embedded systems? First, in light of the above, I wonder how many people get turned OFF from embedded electronics because of the archaic systems and tools! It's basically showing what embedded systems development was like 10 years ago. Second, I feel like it teaches very bad habits for anyone who wants to get into embedded systems engineering. Good embedded systems design is all about using the available peripherals wisely, responding to events and interrupts, and sleeping or giving control back to the OS for the rest of the time. The Arduino framework with its setup() and loop() functions encourages bad practices like polling and sitting in loops, plus it completely hides the peripherals and interrupts.

8. If Arduino was the only option out there for beginners in the embedded systems field, I would not be against it. But there are better options out there that don't get the exposure they deserve because all people ever hear is "use an Arduino"! On the high end, there's the Raspberry Pi (and other board like it). Conceived for learning to program, you can use pretty much any language you want, and it has the GPIO port which makes it usable for embedded systems. On the lower end, more at the level of the Arduino, there are the mbed and the Espruino. The mbed is C++, pretty much like the Arduino but on a modern micro, and the Espruino uses Javascript. The beauty of Javascript is that many people learn it in school, and it naturally encourages an event-driven programming style, which is the right thing to do for embedded systems. Plus it manages to keep things simple by hiding the low level interrupts that drive the event system. There are many other options, plus there is the option to just use a microcontroller demo board from a manufacturer with their free IDE, such as an MSP430 Launchpad or an STM32 Nucleo.

As I've said before, my opinion is not popular. But I think Arduino needs to make some big changes in their hardware lineup, software library and development tools to be relevant again in teaching embedded systems. If not, the damage they cause will only get greater as time goes on.

1 Response to "Why NOT use Arduino?"

ChrisTian

April 18th, 2015, 8:26 a.m.

Thanks for this interesting post. I agree with many points. However I just checked Espruino and mbed and both are just below $50. A chinese Arduino Nano clone (3.3V) costs less than $2 with free delivery. I think it depends on how serious you are taking your projects.

Leave a Comment

Name (required):

Email (not published):

Website:

Comment:

You can use bbcode in the comment: e.g.
[b]This is bold[/b], [url]http://www.achanceofbrainshowers.com[/url], [code python]import this[/code]