Quantcast
Channel: Firedancer Unleashed!
Viewing all articles
Browse latest Browse all 84

Beginning Arduino for Software Engineers

$
0
0
While exploring the realm of electronics, I discovered that, like in the software industry, there were many camps and one of the camps that caught my attention was Arduino. It is an open source hardware company that existed for more than 10 years, much longer in existence than the Raspberry Pi. Its most successful and famous products to-date are the Arduino UNO and MEGA.

The main difference between the Arduino boards and Raspberry Pi is that the Arduino boards are Microcontrollers (MCU), whereas, a Raspberry Pi is a Single-Board Computer (SBC). It is often seen that both Arduino and Raspberry Pi can complement each other in an IoT solution, with the Arduino boards communicating with sensors, motors and the environment, while the Raspberry Pi acts as a gateway to consolidate telemetry data from the Arduino and sends them to the Cloud.



Being a MCU means that the Arduino board doesn't have enough processing power or storage capacity for you to load an operating system onto it (Yep! You can't load Windows 10 IoT onto it). You program directly onto its chip which makes it perform more efficiently without all the overheads of an operating system. 

One good thing about Arduino is that it is open source hardware. You maybe wondering what does that mean? It simply means that all the designs and schematics of the hardware are published (in what is known as Eagle files) and available to the public. Any interested manufacturer (or even yourself) can use the designs to come out with own versions of Arduino boards and that's the reason why, you see a lot of Arduino boards out there with names like something-something-uino, especially from China which I think contributed to the popularity and wide-spread of the UNO and MEGA boards.

In my perspective, Arduino is like Android where everything is open-source and everyone is free to create their own version and sell it, creating lots of fragmentation and confusion, whereas, Raspberry Pi is like Apple, everything is controlled by a single organization and not to mention having lots of expensive accessories.

So far, we have just been talking about Arduino as the hardware. Arduino also comes with an IDE that we can use to develop our programs. The programming language of choice is Arduino C, a variant of C which is not too difficult to learn. I somehow have difficulties in mastering the C programming language - so I'm still struggling with it right now. >_<


Compared to Visual Studio (the best IDE on the planet), the Arduino IDE looks very primitive but it gets the job done. You just need to tell yourself that you are using a slightly better notepad and that you are debugging like Classic ASP. You can immediately learn a lot of things from the samples that comes with the IDE (provided you know how to wire-up the electronics part first). You also need to know that there are no emulators for you to work on unlike mobile development, so every time you make a coding mistake, you need to burn your program again to the chip. (After too many burns, the chip will meet its end-of-life).



Adding more confusion to Arduino is that the founders are currently fighting over legal trademarks and the rights to use the Arduino brand. There is actually an Arduino LLC that runs Arduino.cc and Arduino SRL that runs Arduino.org. Both of them used the same logo. Arduino.org also forked the Arduino IDE creating a lot of confusion to people. To me, I just think that the founders should just be friends and not fight - fighting is bad for consumers.

You will realized that the UNO and MEGA are like 6 years old boards and after their release, the other boards like DUE, ZERO and etc. do not have much uptake. Anyway, some people said that it is because the newer boards are all 3V3 (like the Raspberry Pi) and the UNO/MEGA boards are still 5V which is easier to work with and has more compatible components out there. There are also some who said that maybe China has not gotten their hands on the Eagle files yet (i.e. the ZERO). 

Nevertheless, I hope the Arduino folks can get their act together and focus on their innovation because I'm quite interested in the Arduino PRIMO and OTTO by Arduino SRL. Hopefully, everything will be settled and we will have better toys to play with.

[Update: On 1st October 2016, both the Arduino companies have reached a settlement with each other and have agreed to bring their innovations to the market together.]

OK, after all that long introduction, I would like to say that it is pretty difficult, confusing and quite expensive to get an Arduino board in Malaysia. Also, since we are outside the US market, we are supposed to get Genuino boards. You can get them from some local online sites if they carry stock.

Most of the people I know, get those cheap unbranded version from ebay or AliExpress for less than RM15 (a.k.a Cinanos). Those usually come with CH340G chip (instead of the ATMEGA chip) which you may need to go through some installation acrobatics to get it working. I have not heard complaints from anyone yet but I think they serve as a good platform for learning - you know, just in-case you plug something in wrongly and see blue smoke coming out.



For me, I bought my UNO and MEGA from SainSmart (also China). The reason I bought from them is because they are still using the ATMEGA chip, uses same USB port-type as the original and they have put in some modifications onto the board by providing (minor) extra features and pins which is good for my learning. The board also look very stylish but the cost is higher than the Cinanos though.


Whatever Cinano version that you are getting, just make sure that there is a poly-fuse beside the USB port to protect your PC from overcurrent. Older versions do not have them and you will risk frying your PC's USB port if you plug in something wrongly. 

In my opinion, I felt that it is much easier to work-on and pickup electronic concepts with the Arduino as compared to the Raspberry Pi. The only challenge with the Arduino right now is the complexity you need to go through to enable it for IoT. There are WiFi shields (ESP8266 and YUN) and modified boards that you can use, but they all look like "patches" or "add-ons" instead of a truly integrated system. However, this may change in the future with the PRIMO.

I hope I gave you enough insights to get started on Arduino. 

Viewing all articles
Browse latest Browse all 84

Trending Articles