Edited 02/2024: Over the time I wrote this around 5 years ago, things have really moved on. Now many low volume IoT solutions do ship from what’s effectively Arduino, mbed, or similar. I was proven right and even native chains have all moved toward simplified builds with CMake and helpful starting points. PlatformIO is heavily used and productionizes Arduino builds amongst other things, with a good CLI.
My next prediction is that exceptionally costly compilers and IDEs will fall out of favour and Visual Studio, Visual Studio Code and CLion will make up the lions share, using “gcc” as the compiler along with the CMake build tool. Unlike the last prediction, this is not far off at all, and could be the case for nearly all workloads by 2025.
There is a common misconception in the electronics industry that Arduino is unsuited for professional development. As a result many companies try to use different, more complex tool chains to develop software with far fewer ready-made libraries available. There are many low-volume cases where performance is not quite as critical that Arduino fits very well indeed.
What I would recommend however, is to carefully check all libraries that you are using, to ensure their license is OK for your project. Basically, for any commercial development where you intend to keep the source closed, do not use any GPL libraries (LGPL is fine as it has a linking exception).
In some cases, as unbelievable as it sounds, I’ve heard of consultants suggesting that the code is written in assembler, when the code is not even that time critical. That comes with staggering costs. Personally, I’m shocked by some of the things I’ve heard and would like to tackle a few misconceptions right here:
True and False at the same time, Arduino is nothing more than a series of libraries and standard practices sat on the top of the standard AVR / SAMD / ESP tool chain. You can do anything within the Arduino framework that you can do with the underlying tool chain, as it’s built on the top of it. Although the core API can sometimes limit functionality, there is nothing whatsoever stopping you from accessing these extra functions directly. Look at some of our libraries for examples of this.
Again, repeating what I said in the last paragraph, Arduino is nothing more than a set of libraries. AVR / SAMD / ESP chips are very cheap and easily programmed over ISP. Carefully written Arduino code can even run on an ATTINY chip; with this chip having an inbuilt oscillator, the minimum extra components would be decoupling capacitors and a 6 pin programming header. Here’s a few chip costing examples from Jan 2018:
Package | Chip | Per 100* | Per 1000* |
---|---|---|---|
Thru hole | ATTINY84 | 0.76GBP | 0.74GBP |
SMD | ATTINY84 | 0.54GBP | 0.53GBP |
SMD | ATMEGA328 | 0.92GBP | 0.90GBP |
SMD | SAMD21 | 2.07GBP | 2.00GBP |
BOARD | NODEMCU | 5.00GBP | Not Known |
* as of Jan 2018 - indicative only.
For low volume, there are many cheap professional boards that are small form factor (think NodeMCU, ESP32 and Teensy); which when purchased in bulk become another cost-effective option for some projects Especially if the microcontroller was a late addition to the project.
The basic IDE is great for beginners writing their first sketch, but unsuited to hardcore C++ dev. However, you don’t need to use it, there are now several very good alternatives. A few that stand out:
Wrong: Although out of the box the loop method of programming keeps power usage high, it’s actually very easy to make Arduino programs event based, in fact I’ve got code that does exactly that, and makes it very easy to reduce power consumption significantly. For example AVR chips can be set to a low power state until a timer or interrupt occurs. This won’t solve all cases, but will meet the 90% / 10% rule where it fits most cases.
If you see through the above issues, the platform provides a lot of plus points, there’s an unparalleled number of libraries available that work with many peripherals out of the box. Want to use a 20x4 parallel LCD display, sure just use LiquidCrystal, want a shift register, sure support is built right in, want i2c or serial, helper classes readily available. Although, over the years, as it happens, we’ve provided all the above on IoAbstraction, so the case is not quite where it used to be.
If you are new to development, or already have prototyped on Arduino, and your deployment is fairly low volume, think carefully before stepping over the Arduino platform.