petercohen:
Hello, I am new to Arduino. I heard that the Arduino Uno is the latest. Lots of books also use the Uno as a board in their examples. I guess this is the one to go. However, I may need several shields. Somebody suggested the Mega. is Mega 2560 probably what he suggested?
If you've never used an Arduino, then jumping straight to the Mega without understanding it's differences to the Uno (and there are a few) will probably only confuse you. For the majority of tutorials and projects out there, the Uno is what is used and referenced. Also, most shields are designed only with the Uno in mind.
petercohen:
- Is the Mega 2560 (or whatever other Mega you recommend) fully compatible with the Uno? If I follow some books and use the examples, shields described in those books, will I get the same results without any modifications of the software and hardware?
No. Most shields will plug in properly, but the pins required to control them may need to be re-mapped, as certain pins on the Mega (at the same location as the Uno) don't match the same function as on the Uno, so you would need to change the software to accommodate this. For some shields, this is easy (just a software change), for others, you may need to make significant mods to the board to re-map pins, plus change the software. For some boards (like the Nootropic Video Experimenter shield) - it is impossible, because the Mega lacks the required hardware. You would need to contact the vendor or manufacturer of the shield to know whether it is compatible before you buy, and/or do a lot of research to figure that out.
petercohen:
2. What is the maximum number of shields one could add on top of Uno and Mega? How to determine that?
That depends on more than one thing. The first thing that comes to mind with shields is the fact that some shields may share or use the same pin as another shield. Since they stack and share such pins, it can cause communications difficulties (or worse - like when on one shield the pin is used as an output and on another, an input). Again, the only way to fix this would be to modify the shield and interface software. For some boards this is possible, for others it would take a lot of work (or maybe take so much so it would be "impossible" unless you were really dedicated). Sometimes the manufacturer or vendor can help you figure it out, or you can ask here on occasion (if the boards are fairly common and many have used one or both or more). Note that there are lists of boards and what pins they use, and how they potentially conflict with other boards. These lists can be helpful in figuring out if you'll have a conflict, and how difficult it may be to remedy.
Another dependency is how much current each shield uses, and how much current the on-board regulator of the Arduino can supply. Once you know the latter, you can figure out the former - and so the number of shields will vary, because not every shield uses the same amount of current (and you have to take into account how much current a shield uses while in operation, vs at idle levels too).
petercohen:
3. Somebody mentioned that if I use a high current motor shield, the number of shields I could add will be reduced. Is this true? That is why that person suggested choosing the Mega.
Again, see above; that said, such a shield shouldn't use an inordinate amount of current than any other shield, because you only really care about the logic portion - but it may; again, you need to research this to know. I don't think going with a Mega will help, though - at least not in the area of current consumption. I believe that the same regulator is used on the Mega as on the Uno - and thus current supply availability will be the same.
What may have been meant - and another potential reason shield count can only go so high - would be the amount of memory needed for libraries (both flash and sram for variables). Some libraries needed for some shields are very memory intensive, and you may run out on an Uno - or have nothing left for your own code. Using a Mega will allow you to overcome that, as it has both more sram and program flash space than the Uno. But you still have to contend with all of the above caveats. And in some cases of a memory nature, even a Mega won't help. For instance, in the aforementioned Video Experimenter shield (as well as the TVOut library - which the VE uses) - the greater memory of the Mega would be an excellent fit for that shield, as it needs a lot of sram for the video buffer it can use - plus a larger buffer means a greater resolution available. But because the Mega doesn't have a specific needed piece of hardware that the Uno does, the VE shield just plain won't work with the Mega.
Finally - pin re-mapping can be more easily accomplished by not using shields as shields. Instead, wire them directly and don't stack them. If the issue is a simple remap of pins, then doing it this way - while it might make for a larger overall project - it will be simpler to implement. Furthermore, you can bypass the power supply issue this way, by giving each board it's own regulated supply using a simple 5 volt regulator circuit (or by supplying a larger current source of 5 volts).