Can I stack multiple shields?

Hey, so I'm new to Arduino and building up a project that requires expansion.

I read in one place that "Arduino shields can be stacked, of course!" and then other places that says some cannot be stacked due to fighting for the same resources (I/O or serial pins, etc)

Is there any way to understand what shields are compatible anywhere or how to make one shield work with another?

Specifically, for my case right now, I have a Uno Wifi R2 Arduino for a Braccio Robot with the Braccio shield.

Now I need an ethernet connection for an external controller to share data with the Arduino vi an ethernet network.

SO, I've added an ethernet 2 shield between the Uno and the Braccio. But the Braccio no longer works.

So, how to resolve this issue and have an ethernet port?

Why do you need an Ethernet connection when you have WiFi ?

I wanted a direct connection between a controller (Siemens S7-1200) and the Arduino.

The S7 doesn’t have WiFi but I might have to connect it to a router to gain a WiFi connection.

You have to consult the documentation for each shield and compare the pin assignments.

OK, I'm struggling to convert modbus over ethernet to modbus over wifi from the Arduino.

I've gotten modbus to work from ethernet to the S7 PLC but now I need to remove the ethernet shield and get modbus working over wifi. Most things I find on the internet are referring to using the ethernet shield and I'm having difficulty getting it to work over wifi.

Any pointers on modbus over wifi???

I'm disappointed that I cannot use the ethernet shield to do this. Ideally I'd love to have this as a wired solution and not reliant on wifi.

Have you done as suggested in reply #4?

Yep, I’ve looked into it. The Braccio shield data I was struggling to find but found something. Hence why I can only use one or the other, not both.

The schematic for the Braccio shield can be fouund in the Arduino Store here:

The schematic shows that some of the pins used to control the motors are also the same pins that the SPI interface uses. That would probably explain why your setup isn't working with the additional ethernet board.

If you are looking at a wired solution, could you use RS485 for your modbus comms?

The schematic shows that some of the pins used to control the motors are also the same pins that the SPI interface uses. That would probably explain why your setup isn't working with the additional ethernet board.

Thanks for verifying this. I have obtained a W5500 ethernet board which I thought I might try. Just trying to work out what pins are what. (Pins 22/32/33/44???)

If you are looking at a wired solution, could you use RS485 for your modbus comms?

I also have a Siemens CM1241 RS422/485 module for the PLC. Looking up RS485 comms with Arduino, I keep seeing I need a converter (Max485 board)?

Yes. It's a small simple MAX485 (or equivalent) breakout board. They are very cheap to buy, and it's not a shield.

The ones I use look like this:

1 Like

This is on it's way... Back to it tomorrow. Thanks for your input @markd833 (All Mark's are great people! I'm also a Mark! :+1: :+1: :+1:)

One bit of advice, many drawings on the web will suggest you use those "with only two wires, A+ and B-, between the nodes. What they don't mention is that in less than ideal conditions, you really have to provide a common reference between the power of the two systems being connected, and that it should NOT be connected via the shield of the RS485 data wires. We've had horrid reliability problems with these when that little detail is omitted. (you may know all this, in which case I'm mentioning it for the benefit of those 'reading along').
Here's a link to a very good article about the RS485 do's and don'ts:
RS-485 Guide
C

1 Like

per Section 9:

Grounding and Shielding
Although the potential difference between the data-pair conductors determines the signal without officially
involving ground, the bus needs a ground wire to provide a return path for induced common-mode noise
and currents, such as the receivers' input current. A typical mistake is to connect two nodes with only two
wires. If you do this, the system may radiate high levels of EMI, because the common-mode return current
finds its way back to the source, regardless of where the loop takes it. An intentional ground provides a
low-impedance path in a known location, thus reducing emissions.
Electromagnetic-compatibility and application requirements determine whether you need a shield. A shield
both prevents the coupling of external noise to the bus and limits emissions from the bus. Generally, a
shield connects to a solid ground (normally, the metal frame around the system or subsystem) with a low
impedance at one end and a series RC network at the other. This arrangement prevents the flow of DC
ground-loop currents in the shield.

The way it was explained to me, and the way I read that,

  • you need a common low-impedance reference between systems
  • shielding should not be direct-connected at both ends, only one end("RC network" at the other end)
    The two statements can't be reconciled with a single shield wire.
    I've not a lot of experience with this, but I have successfully implemented two low-node-count RS485 networks using this philosophy. Whether it applies in your case I leave to you to find out, but at least you know about it.
    C

Also, if you're not familiar with RS-485, have a read of the section on terminations in that document. You'll probably find that that RS-485 adapter has a 120 ohm resistor soldered on the board(it was present by default on the ones I've used). If you're only connecting a couple of units it won't matter, but if you were to hook up 15 or 20 of them in a small network, the effective termination resistance is hard on the drivers, as the resistors are all in parallel.
C

1 Like

But, a DC ground loop would be created by either a solid ground conductor or a shield, if it is connected to the circuit ground on both ends. So, it makes me skeptical about the mentioned difference.

Thanks @camsysca

Whilst in this instance it’s just a short run between the Arduino and the PLC, I’ll probably get away with some rough wiring!

But in an industrial wiring scenario, everything you mention is important and great reference for those reading.

I have wired up many units required to communicate over time. Whilst I’ve always accepted that, as long as the wiring is correct, these comms have always worked, I’ve never understood the fundamentals of how these communication methods work.

This project is becoming a great method of deeper learning for me!

I don't see that a ground loop is formed with a single reference wire; unless, of course, you wish to create a loop by involving the two driven wires as well. However, I have no detailed training or background in that area. What I do know is the techniques have worked. Sorry, can't fire up the argument.
C

Another factor is the increasing use of systems that are completely electrically isolated, no ground reference at all. In one such application, with an isolated portable computer on one end with USB-485 adapter, and an isolated DC supply to several devices at the other end, I could influence(degrade) transmission quality by simply touching the ground on the Max485 circuit; my theory was, I was coupling in some form of RFI(LED lighting was involved), but we never did sort it out, we just added the reference wire between the USB metal shell and the target system's common, and all was well. Again, this is just anecdotal.
C

Generally, ground loops don't cause a problem even if they exist ohmically, unless there are significant currents from multiple sources transmitted on a single wire. That shouldn't happen on a shield or a reference conductor.

Devices that are widely separated and/or connected to different AC safety grounds, shouldn't have currents on the grounds because an AC safety ground (when it is working properly), conducts no current at all.

Perhaps this is the basis for discouraging the use of the shield for a common return. Yet, a wire as a common return is forgiven. This puzzles me as I don't see a major difference as it would affect ground loop problems. The ideal would seem to be, a shield grounded at only one end, and also a common return wire that goes to the common on both transceiver circuits.

As long as the return wire is used as a transceiver common only, and the common does not develop any ohmic voltages as the result of loop currents in the devices at both ends, there should be no ground loop currents in that wire.

That would be achieved by connecting the common to the physically closest available common connection to the transceiver in the device (i.e. not just to the case, or something dumb like that).

That is what I suggested earlier, aarg. The only difference is, my common reference would connect supply commons, while yours goes directly to the transceivers. My suggestion was done that way to avoid someone adding a second, or third, common reference inadvertently; it's obvious if the reference is there, if it goes from supply common to supply common.
C