Wiring multiple SPI devices

Hello,

I’m very new to Arduino and electronics so please bare with me. :slight_smile:

I have these components:

Both the ethernet module and the SD board uses the SPI bus. I understand that this means they should be connected to pin 11, 12, 13 and should have individual slave select pins.

I’m stuck at the very beginning. How can I wire these together using a breadboard?

Please see the attached image. Is this approach fundamentally wrong? If so, how can I make it work?

(Briefly about the project I’m working on: data (collected by a DHT11 sensor) will be stored on the sd card and the Arduino will respond to requests from a web interface, i.e. grab the latest sensor data or a set of data which is stored on the sd card.)

Thanks,

Peter

leno_inc:
Hello,

I'm very new to Arduino and electronics so please bare with me. :slight_smile:

I have these components:

Both the ethernet module and the SD board uses the SPI bus. I understand that this means they should be connected to pin 11, 12, 13 and should have individual slave select pins.

I'm stuck at the very beginning. How can I wire these together using a breadboard?

Please see the attached image. Is this approach fundamentally wrong? If so, how can I make it work?

(Briefly about the project I'm working on: data (collected by a DHT11 sensor) will be stored on the sd card and the Arduino will respond to requests from a web interface, i.e. grab the latest sensor data or a set of data which is stored on the sd card.)

Thanks,

Peter

looks good,
only possible problems, Bread boards usually split the power rails into 4 sections, between pin row 30 and 35 there is usually a wide gap between the power rails, this gap is insulated. Therefor no power or ground connnection. verify that the Arduino Vdd is actually present on the MicroSd Card.

Are your two modules 5v tolerant? I see you are powering them from 3.3v, but, the Arduino will drive the SPI bus and the SlaveSelect pins to 5V?

Chuck.

Thank you for your reply Chuck.

The SD Card module is 5V tolerant, quote from its documentation: 'There's an onboard ultra-low dropout regulator that will convert voltages from 3.3V-6v down to ~3.3V (IC2). There's also a level shifter that will convert the interface logic from 3.3V-5V to 3.3V. That means you can use this board to interact with a 3.3V or 5V microcontrollers.'

The Ethernet module's description is quite vague. It has a 5V pin (as well as 3.3V picture). However, only the 3.3 V power supply pin is mentioned its description.

So does this mean I can (or should) power them from 5V instead of 3.3V?

Thanks,
Peter

leno_inc:
Thank you for your reply Chuck.

The SD Card module is 5V tolerant, quote from its documentation: 'There's an onboard ultra-low dropout regulator that will convert voltages from 3.3V-6v down to ~3.3V (IC2). There's also a level shifter that will convert the interface logic from 3.3V-5V to 3.3V. That means you can use this board to interact with a 3.3V or 5V microcontrollers.'

The Ethernet module's description is quite vague. It has a 5V pin (as well as 3.3V picture). However, only the 3.3 V power supply pin is mentioned its description.

So does this mean I can (or should) power them from 5V instead of 3.3V?

Thanks,

Yes, If they have onboard voltage regulators, they probably have signal voltage level converters, If you don't power them with 5V, the converter circuits may not function correctly. I would pass 5V to them.

Chuck.

OK, I'll give it a go tomorrow.

Thanks very much.

Peter

As said previously, as long as both devices are 5V tolerant, your proposed circuit should work fine. The Adafruit breakout works fine with 5V or 3V3 logic, I have one and have used it with both logic levels. As the Uno's 3V3 power supply isn't that strong (50mA), I would power it with 5V applied to the 5V pin (the Uno's 5V power supply is rated for 800mA, only a small portion of which is used to run the board itself). SD cards can draw up to 100mA or so just by themselves when writing, and I bet your ethernet board draws a fair bit of current too. If the ethernet board has a 5V power port, use that one. It is pretty likely it has level-shifters or 5V safe inputs if it has a 5V power pin. Double-check its datasheet (if you can find it) to be sure though.

Check your wiring on the DHT11. I don't have experience with them, but a quick check on the Adafruit page for such a sensor shows a slightly different wiring setup.

Thank you for your explanation madmattd!

The wiring on my actual breadboard is correct, however I messed it up on the attached image. :slight_smile:

I'm still waiting for the ethernet module to arrive, I'll let you know how I get on.

Thanks,

Peter

Just a quick update:

I got the module a few days ago, connected them all together. I've spent a couple of days on making the program for it and finally I've made it.

It worked. The data had been logged onto the sd card, in the meantime, the current sensor data was accessible via a web interface. All good.

Then this afternoon I've realized my sd card is dead. Proper dead. Neither the sd card board, nor my computer recognizes it. I haven't a clue what did I do wrong, but that's another subject (will post the details in another forum thread soon).

Peter