Postby Mechanist » Fri Mar 09, 2018 7:18 pm
As an engineer, I have mixed feelings about the Arduino and its clones.
On one hand, it can be quite convenient for prototyping, or some quick'n'dirty hacks - where something simply needs to be made to work with the least amount of time and effort, and it's of little or no consequence how (in)efficient it is in terms of size/weight/power/complexity etc.
Especially if it's something that is intended to be ultimately implemented using dedicated hardware.
On the other hand, precisely because it lowers the barrier to entry, it results in PC programmers picking up this fancy toy and trying to make it do ludicrous things, without realizing or even caring about the hardware aspects and limitations. "Hey, it uses a very common programming language!"
Using floating-point numbers where integers would entirely suffice is the most common mistake I've seen. Throwing divisions left and right is probably the 2nd. Using vastly, excessively large data types - likely the 3rd. The list is long.
(both of these 2 first things have absolutely no hardware support on the 8-bit AVR's; the compiler has to do it in software, which takes thousands of clock cycles for every operation!)
Same with the most basic hardware - ie. "how to connect a button/LED to the Arduino/Raspberry" is a frighteningly common type of question.
Or people doing dumb crap such as connecting LED's or pushbuttons to the I/O pins with no series resistor to limit the current, thus destroying the LED and/or the I/O pins.
As recently as a decade ago, this kind of nonsense wasn't nearly as much of an issue - having to build such systems from scratch meant that those lacking in the required skills were naturally excluded from participating.
Put this way, it may sound cruel - but really it's a case of having to learn to walk before attempting to sprint.
So now we have plenty of n00bs trying to undertake challenges way above their skill level, and complaining that they keep getting their butts handed to them.
Also, the times have changed greatly, in general.
When I was starting out, things such as a good bench power supply, or a signal generator, or frequency counter, were all unaffordable luxuries. There was no cheap Chinese crap floating around.
Back then, it totally made sense to build your own tools - both due to the prices, and also because it was a good learning experience.
Nowadays it makes very little sense to reinvent the wheel.
Most of such common tools can be bought off the shelf for a small fraction of what it would have cost a hobbyist to build them, even if their time was worth absolutely nothing (but that is never the case).
Especially since the problem with microcontrollers is not the cost of the micro itself - it's the cost of writing, testing and debugging the firmware; a subset of what's known as non-recurring engineering costs.
It's not a problem if you are making 10's of thousands of identical devices, because then the costs of NRE vanish in the noise. But on a one-off basis it's quite prohibitive - easily the largest single cost in many otherwise simple projects, frequently far exceeding the value of the hardware.
Thus when building a new project, I always first look for canned off-the-shelf solutions. They are usually considerably more expensive, but in most cases it turns out that my time is worth far more than the cost difference.
Failing that, my next course of action is to try and put something together out of commonly available building blocks, usually DIN rail mounted: ie. power supplies, relays, timers, thermostats, PID controllers, or even PLC's if absolutely required. None of those parts are exactly cheap, but I'd still have to be insane to try and make my own at those price levels.
Only in the most demanding, high-stakes cases do I find it at all worthwhile to try building something all the way from scratch.
All this might sound downright crazy to the average DIY'er - but those are the cold, hard facts; backed up by years of experience.
Re. component salvage - yes, I used to do it too, but those times were different. Also, long gone.
At one point last year I went over my workbench, tossing out anything which I considered to have no further use, to clear up the clutter and free up some room.
Many things got binned that day, but primarily - yep, you guessed it - a whole assortment of salvaged parts, and also entire old PCB's from abandoned/failed/obsolete projects.
I did keep a modicum of the most promising (more like "least useless") parts for prototyping purposes, but still that's probably just postponing the inevitable until the next cleanup time comes.