Using Ethernet Module and SD Module Problem / Help Me Please!


I want to make a web server, data logger with ultrasonic sensor and, i2c lcd, rtc module, sd module, enc28j60 module and arduino mega 2560. However, i have a big problem of my code. My ide v. 1.8.13.

I am very sad about my problem. If you can help me, i will so so happy.

Please help me about this problem.

I want to use sd card module and ethernet module together. My code works fine if i remove miso or vcc pins of my SD module from the board. However, if they are connected, my code doesn't work. My lcd ekran shows the requirements of my code until arrive this line "if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0)". Then, lcd screen freezes.

My pins;

Arduino Mega 2560

Rtc module:
Clk: 24, dat: 26, rst: 28, vcc: free

Ultrasonic modül:
Trig: 34, echo: 32

Sd kart modül:
Mosi: 51, miso: 50, sck: 52, cs: 4

Lcd i2c ekran modül:
Scl: 21, sda: 20, gnd and 5v vcc

Ethernet modül:
Cs: 10, and icsp pins

Most probably the hardware of your SD card module is your problem. If it doesn't set the MISO signal high impedance if CS goes HIGH, it blocks all other SPI slaves.

Most of the cheap Chinese modules have this problem. Many can be fixed with some soldering skills (there is a bunch of online tutorials for this) but the easiest way is to buy a serious SD adapter board (p.e. from Sparkfun or Adafruit).

Hi Pylon,

Thanks a lot. I will buy a new sd card module and try again.