a question of which microcontroller?

Started by mobile_bob, December 17, 2012, 06:42:54 PM

Previous topic - Next topic

mobile_bob

it would appear that the arduino is getting lots of press lately

and i have a question

whats the advantage(s) of this platform over other processors?

i know that it is open source and all that, but aside from that what is all the fuss about?

i am looking for someone to argue the merit of this controller, because i cannot see what all the fuss is about for my needs.

anyone using the arduino in a multiprocessor environment, master and slave?

bob g

Ronmar

#1
I am not sure about the master slave application, but the real appeal of the arduino may BE in it's availability.  I can get one of these at radioshack for I think $34.  Unless you write microcontroller code for a living, having everyone and their brother playing around with them, and all the tech related forums is a little more incentive to get one to learn and play around with...

The next advantage IMO is it's modular configuration, and all the modules already available.  For the alternator and generator controller build,  I can get a 30A PWM motor control "shield" for $55 I think, that will plug right together with the Arduino.  Then there is a Wifi shield that will allow me to interface my IPAD with the microcontroller so when needed, I can read sensor information, or make adjustments without having to have a display interfaced with the controller.  Yes, there is an APP for that:)  For someone who dosn't have a lot of time to learn and build something completely new from scratch, the ability to plug together off the shelf parts to accomplish my dream(hair brained scheme:)) is a real time saver...
Ron
"It ain't broke till I Can't make parts for it"

artificer

I agree with Ronmar.  Just take a look at this list of shields (daughterboards)  http://playground.arduino.cc/Main/SimilarBoards

You don't have to be an EE or advanced computer user to made a useful system with the arduino.  Want GPS?  there's a shield for that.  Code library is already written, so all you have to do is a little bit of glue code to get what you need.  Motor/servo control?  There's a shield for that as well.  How about cell phone communication for your project?

As for speed, there are several boards out there with varying performance.  If you need more, this is a silly idea: http://arduino.cc/forum/index.php/topic,6915.0.html  Don't know how practical it is, however.  They've also set Arduinos for master/slave as well.  http://arduino.cc/en/Tutorial/MasterWriter  You could even make a canbus network with the proper shields.  The slaves would be sensors/controllers, while the main arduino would provide overall control.  I don't think the discussion should be why you should use the arduino, but rather, will it work for you.  If it will work, then the various shields make interfacing with the real world very easy.

I think the excitement comes from the fact that the arduino is almost leggo like in its uses and ease of use.  Its a toy/hobby level system that almost anyone can use.  Did I mention cheap as well?

Michael

Mad_Labs

I agree with Michael, the buzz is because they are easy to use with a lot of products and projects based on them. They use an Atmel uC.

I use the uC that is best for the job I am doing. So I use PIC's, Propellers, Stamps and Atmels. It just depends on what I want to do. For example, I use a Propeller to run a touch screen and to communicate to the rest of my system. I use PICs for small jobs like reading a sensor and transmitting data. I use Stamps when I am teaching, etc.

Personally, I don't need the hype of the Aurdinio either.

Jonathan

mobile_bob

i have about 6 or 7 years (off and on) time in development of my system control
based on bs2's in the master/slave configuration.

i am convinced that this will accomplish everything that needs to be done very easily
and am not at all sold on the idea of moving onto a different platform.

now granted i won't be using vga screens to display cool stuff like volts/amps/temps and such, and i won't be connecting via wifi to my smartphone (mostly because i see no need for a smart phone, in an area where i don't even carry my dumb flip phone around anymore) and i don't have some of the other really kewl functions everyone is raving about,,, but ... so far i cannot really see a real need for any of that.

if i need to read volts/amps/temps and such, 10 buck digital or analog gauges would do just fine?  or they seem to work in systems that have been around for a very long time.

what i wonder about is this, maybe all the cool stuff soon loses its luster and one would simply not use those capabilities after a while?  sort of like having a lake view where for the first month you live there you stare endlessly at the view, second month not so much, and 6 months down the road you have the drapes pulled most of the time anyway.

having spent some time researching how industrial control systems work, with their programmable logic controllers (plc) its only been recently that video screens came available along with intra and internet connectivity (last 15 years or so).  literally millions of plc's have been built and deployed to do very complex functions that simply once programmed continue to do there jobs for the life of the equipment.  they use "ladder logic" as a programming language. 

i guess i really wonder if the "wants" exceed the real "needs" of a control system?

for instance does anyone really need to see a color screen tell them that the autostart has initiated a start sequence? when an indicator light and the sound of a starter engaging is a pretty clear indicator that the thing is beginning a start cycle?  do i need a fancy screen interface?  wouldn't the debug screen show me what the controller is doing in real time anyway, on the same laptop i use to program the controller with?

lastly, and this is a serious question

is the programming language really easier than the bs2 stamp "pbasic" to use? its hard for me to imagine anything being more intuitive or easier to learn?  seriously mastering fewer than a half dozen commands is all it takes to make a complete autostart controller, with everything from glowplug, water pumps, fans, start solenoid, etc.  it might take a few more to setup a master controller, but only if one wanted to do A/D inputs with conversion?  even that could be vastly simplified using temp switches (snap switches) to do the switching rather than use an analog sensor and an A/D converter with code?

i don't know, maybe i should just finish building the system, work out the kinks and then come back to see what others have done?

maybe we ought to have some sort of contest?  setup some criteria of what a power automation system should be?  maybe that is what it will take  for me to really get on board with the arduino? maybe if i actually saw someone put together a fully functioning power management system based on that controller and the hardware used with it?

rambling on, trying to get my head around all the buzz

thanks guys
bob g


Jens

One aspect that has not been talked about is raw processing power. When I built my system monitoring stuff, the biggest issue was temperature sensors. Everything was supposed to be initiated by temperatures and I had about a dozen or so sensors set up. The 'hard' system functions like over or under speed and over temperature where directly interfaced without going through any computer.
Anyway, the way I decided to sense temperature was via 'one wire' sensors which allowed me to run a single set of wires to the controller and all sensors were hooked onto that one set of wires.
The controller that I was using was running something similar or possibly identical to stamp basic. The processing speed was nowhere near fast enough to do direct monitoring of the temperature sensors. Instead, I talked to a dedicated controller that handled all the low level communications to the sensors. It used it's own PIC processor.
Besides not being able to handle low level stuff very well, I also ran into processing power issues with high level commands. It is just too much fun to add complexity and by the time you add interrupt driven events you can easily find yourself running out of time slots to do processing.

I never did get into PIC programming (tried but I am getting too old for that) and I never tried arduino stuff either. I can only speak to the reason why there is a reason for their existence.

Mad_Labs

Bob,

You can't beat the Stamp for ease of use, mature and easy programming language, free programming environment and they are tough to boot. However, they are slow, expensive and have limited program memory. In my system, I use a propeller because I would have to use multiple Stamps to get the same job done. The awesome thing about the Propeller is that it is 8 uC's in one. So there is no need for interrupts and it can do a lot at once, as it can really walk and chew gum at the same time, no time slicing. It's a lot quirkier and harder to use than a Stamp though.

And then PICs you can't beat for price, plus there are so many flavors with different hardware features. One thing about the Stamp is no ADC, comparators, etc. I use pic basic pro to program PICs , which is based on PBASIC. It's not cheap though.

As to gauges being just as good, I do like 'em for a back up but they aren't intergrated and smart like a uC sensor is. For example, in my system, say I am charging with the genny and the sun peeks out. If the battery bank is hungry and the voltage doesn't rise above the set point (14.4) the current into the bank may exceed the maximum rate that I like to charge at. A gauge will only show that it is happening. A uC based gauge can take steps to rectify the situation. Or another example, my water system keeps track of how long the pressure pump has been run and how often. If it exceeds pre-set limits, the system is locked out until I reset it. I then get a flashing red screen on my touch screen that tells me there is a problem and what kind of error it is. So in case of a leak and I am not home I won't return to a big puddle and a dead battery bank.

Jonathan

Thob

Often times the "best" tool is the one you know how to use.

I program in C#, C++, and C at work, so I'm not thrilled at learning a new language; that leaves out PIC and basic stamp (for me, although I've played at both).  The arduino is "C like", so it would be close.  I've actually bought a few of the TI launchpad systems, they program in C, development tools are free, and they only cost $4.30 each.  They have I/O, ADC, etc. so they will fit the need for my projects.  I haven't completed one yet, so I don't have proof that they will do the job(s) I have mind.  Too many other projects in the way, but if it gets cold this winter I should get at least one of the launchpad projects done.  I like the price of the launchpad compared to arduino.

I've been in software for quite a while, and it's amazing to me what you can get in a single chip these days.
Witte 98RC Gas burner - Kubota D600 w/ST7.5KW head.
I'm not afraid to take anything apart.
I am sometimes afraid I'm not going to get it back together.

Mad_Labs

Thob,

There are C compilers for everything these days, PICs and Propeller included. I hear ya on learning new languages, I have lost count of how many I have worked with. However, I do find that with each new language I do learn something new about programming in general. So, I sigh and dig in whenever I have to. While it is easier to stick with what you know it is also limiting.

Jonathan

thomasonw

Having recently selected a Microcontroller to use for my Engine Control and Alternator Regulator project - I can say I selected Arduino primary because of the fuss.

It is rather simple to setup the Arduino development board, it uses a C environment, has a wide range of hobbiest support, and hence tons of  libs and forums.  And the 'hand holding' running environment is easy.   One does need to be careful as the quality of some of the libs are not always the best. . . .

The CPU (Amtel) it self is an OK performer, is low enough cost (under $3 stand alone) for designing into hardware directly. (Which is what I ended up doing, just put an Amtel CPU down on the PCB as opposed to construction a 'shield')

As mentioned, there are several uCs to choose from, be they Stamp, Pic, Propeller. Amtel.   Depending on the situation, any one will address a wide range of problems and I can not say I see a stand out reason for Amtel vs. any of them.  The Amtel does not leap building in one single bound, it is not faster then a speeding bullet.  It is just a good solid uC, like many other offerings.   But to me, the answer to your questing: Why all the Fuss around Arduino, is exactly because of the Fuss...  Arduino has reached a critical mass :-)

-al-




BruceM

#10
Microchip does have a free C compiler for the PIC processors, Thob. I've used it and the free integrated development environment software with one of their low pin count USB development boards.  It works great, some very impressive free tools, professional quality. You have to pay for the version with greater code size optimization, but without that it's still competitive with AVR C.

I've used quite a few of the PICaxe chips, they are standard PIC 8 bit processors with flash memory, preprogrammed with a Basic interpreter.  I got started with them as a cheap, low risk trial to see if post-encephalitis I could manage to do some controller programming.  I figured if they were designed for kids to use, that was a good starting point. Arduino's weren't around yet.  I've gotten a lot of mileage out of the Picaxe chips ($3-$10 ea), and think they are great.  I did all my prototyping on PHanderson's PicAXE /wireless breadboard kit, with a total system (hardware and software) development cost of $25. They are much cheaper than Basic Stamps, with better real time support such as timeout for serial inputs, and more programmable input/output/analog pins. They also gave me a hardware and software upgrade path, since I could always opt to migrate to a faster PIC processor with the same pinouts and a wide range of C, Basic, Pascal, etc., compilers. Via PIC I also get the widest range of microcontroller processor and I/O options in the world.  So for a simple controller I still think PICaxe has a lot of merit as a great starting point.

I also like the AVR processors, and with the availability of daughter boards for the Arduino, I think someone picking new hardware and software today for a hobby project should look closely at them. Especially if you do need something like GPS or bluetooth, etc., that you can buy off the shelf.  I don't think you can go wrong picking Arduino for a hobby project as they have achieved a critical mass. I'm not thrilled with "C" or "C-like" languages, as I think "C" is a bad joke if readability and clarity are a goal, but you might as well get used to it in today's world.  

The need for greater processing power for a controller application is more often just bad design, such as using one wire devices with standard "wait for it" software. Some of the standard input/output routines (notably serial data, one wire, ) provided, for PIC, Arduino/AVR, etc., aren't really well designed for real time controllers (software language guys typically don't "get" real time), so the processor spends too much time in "wait for it".  Choosing a more expensive 16 bit processor will result only in more expensive "wait for it".  The solution in many cases is to use another small dedicated processor to handle such tasks (as Jens did to solve his one wire temperature sensor problem) or to avoid such problems by design or a bit of analog hardware.  

The Parallax Propeller is a rather brilliant design that addresses this problem in a very nice manner. Each built in processor can be programmed with"wait for it", simple software. The downside is having to learn their unique Propeller programming language. Alas, I wasn't that impressed with the language limitations and wanted more, programmable,  inputs and outputs.  In a pinch I would instead use the I2C serial bus to communicate between PIC or AVR processors.  Even the lowly PICaxe Basic supports master and slave I2C commands.

The time spent learning new software, languages, and tools is so tedious and time consuming that many older programmers will stick with whatever they are most familiar and/or comfortable with.  Thus you can still buy and use such ancient microprocessor/microcontroller fossils as Z80's, Z-8's, HC-11's, 6502's.  While it's easy to snicker at someone's oddball choice of hardware and software, if it's a hobby situation, then who cares, if it gets the job done and makes you comfortable and happy. So giggle all you want at my "grade school" Picaxes and Bob's Basic Stamps, we got the job done.   :)

Having managed expensive R&D hardware and software efforts professionally, I found that "other people's software" (OPS)  that was marketed  to solve all my problems and save me lots of time and money usually ended up in projects being way over budget and with big schedule delays. The problem is that you don't find out about the limitations or serious bugs of the other peoples software until too late in the project. Then it's too late to change and you've got huge "work around" problems.  For on-time and within budget R&D projects, I learned to avoid OPS at all cost.

So my advice is to take claims of "leggo-like" software and hardware with large and healthy amount of skepticism.
Keep things simple, avoid non-essential feature creep, roll your own, and you'll get it done on time.


sailawayrb

#11
I think Jens and Bruce pretty well captured the essential criteria in selecting a microcontroller...the required processing power to accomplish the design objective and your ability to program the specific microcontroller.  If you need to sample many sensors at several thousand times per second and run a sophisticated control law algorithm in order to control what would normally be a completely unstable system, you will need a lot of processing power, you will still have keep track of and optimize/minimize the control law algorithm math, and you will even accept programming in assembly language to get the job done.  

Another design issue can be reliability and criticality of failure modes.  Often times a control system has to be fail-safe.  To achieve this you may need to have three or more microcontrollers all doing exactly the same thing with three or more additional microcontrollers just monitoring the output commands of the first three to allow output command averaging and voting to select valid output commands should one or more of the first three microcontrollers go to sleep or fail.

So your microcontroller selection largely depends on whether you are designing a relatively trivial PID engine throttle controller or a fully autonomous air/space vehicle.  I view the Arduino as a great learning toy for a child or young adult interested in science and engineering, and it can likely be put to good use for simple around the home/shop projects where reliability and criticality of failure modes is not a concern.

Bob B

BruceM

#12
My experience with embedded 8bit PIC processors is that for reliability, they are fabulous. Even on my hand soldered point to point wired prototypes, I've had zero failures, zero glitches, zero reboots.  Even when part of my engine controller board (the opto- isolated current loop) got fried by lightning, the processor was unaffected.  That processor has been in service for about 4+ years now, also my remote fiber optic cell phone controller has been running continuously 24/7 for about 5+ years now, again on a hand wired prototype board, with never a glitch or reboot needed.  My battery bank processor has been running continuously for 3 years now, and it's also been totally reliable  (It's on a custom PCB.)   So I'm personally sold on Microchip's ability to make tough, reliable single chip controllers.  

I've worked on triple redundant military avionics gear. So glad to not have to deal with that crap for my hobby level projects.  After enough years in service they tend to work things out, but I remember early production fire control computers that would reliably "vote" themselves invalid (all three processors disagreed) and go into shut down over and over again. USAF test pilots are fortunately made of the best stuff, both fast brains (most are engineers) and hardened steel balls. My heart breaks when they get killed by glitchy new hardware and software. Almost every new aircraft kills some.







mobile_bob

man i love you guys!

this is the true value of this forum, that is the diversity of experience and hands
on how to do it.

reliability is job one in my opinion,  if i am to go to the trouble to design and build something, i want it to not only work as designed but do so without undue issues (preferably with zero issues) for a very long time.

the comment about "feature creep" makes a hell of a lot of sense.  i think having a clear and simple goal to start out with and not deviating from that path has a much higher success rate.   get it done right to start with, then add features later? maybe?

it looks to me that many get all wound up adding features, paint themselves into a corner and never get to the conclusion that they originally set out.

thank Guys

all great comments, and maybe folks will see where i was going with the question on how we engineer/design our projects.

bob g

veggie


I settled on an Arduino a few months ago.
Mostly because of the huge number of sample programs and example projects available for this unit.
As others have stated, the add-on boards are not expensive.
I just ordered a compatible relay card with 8 five amp relays for about $23.

For another side project, I also ordered temp, humidity, and soil moisture sensors for the greenhouse controller. Very cheap.

As more of us begin using the Arduino, I can see a lot of code and idea sharing.
I can program the unit, but I lack some basic electronics knowledge such as what size resistors or capacitors to use in various situations.
Hopefully you experts can keep me on the right track.  ;)

cheers
veggie