SD card reader connection to Arduino Uno

Hello everyone I have problem with card reader module connection to Arduino Uno.
The problem is no matter what I do (checking wiring, changing pin from 4 to 10 or change arduino uno board) SD library example "CardInfo" doesn't work.

I use:

  • SD card module HW-203

  • Arduino Uno

  • Micro SD card for 2 Gb formatted to FAT16 / FAT32

  • Wires

  • SD library version 1.2.4

I tried:

  • Changing pin from 4 to 10 and vice versa
  • Define chip select pin as an output and digital write to high
  • Changing from 3.3 V to 5 V and vice versa
  • Changing arduino boards (also I tried Arduino nano)

I would be happy to any help!!!)))
Thanks in advance

Welcome to the forum

Your topic was MOVED to its current forum category as it is more suitable than the original as it nothing to do with Installation and Troubleshooting of the IDE

How did you wire up your SD card module? Did you wire it up as shown in this tutorial:
https://create.arduino.cc/projecthub/electropeak/sd-card-module-with-arduino-how-to-read-write-data-37f390

  • Stick with pin 10 as the SD card module CS signal. I think that's the default for an UNO with the SD card examples in the IDE.
  • You should power the module from the 5V pin (not the 3.3V pin).
  • You shouldn't need to define any pin as an output or use digitalWrite as the library should do all this for you.

Why this random wiring? 5 volt devices should be powered by 5 volt and 3.3 volt devices by 3.3 volt. Connecting different devices like that call for level shifters.

1 Like

How was the SD card formatted? It is important that formatting be done properly. See this thread.

Hi, thanks for your answer)
The module allows connection either 5 V or 3.3 V.
I though, may be one line is not working so tried both.
The wiring presented on the picture below.
I know I shouldn't define it, but I found some solutions in internet that say it worked, so I tried.
Nevertheless, It didn't work.

Thanx

Hi, thanks for your answer)
I tried both windows formatting and this application that you attached to the thread.
Thanx)

The HW-203 appears to be designed for 3.3V devices like Raspberry PI. SD cards expect 3.3V SPI signals.

The Uno outputs 5V on MOSI and SCK which will cause the SD to fail.

You need an SD module with 5V to 3.3V level shifters. Here is a link to a module for a microSD.

51CM9pSHS8L.AC_SX679

Note the U1 chip.

Hi, thank you for your answer.
I don't know if I am wright or wrong, but on the module there are 2 pins for V3.3 and V5. So I assumed, that it is either or. It doesn't meter, because I tried both 3.3 and 5 volts and it didn't work.
Thank you for link, I will try with new module.
If you have any other suggestion I would be happy to hear.

The two pins allow use of 5V or 3.3V but does not change any signals. The 5V goes through a voltage regulator to produce 3.3V for the board.

The board always runs on 3.3V and does not handle shifting the 5V Uno SCK and MOSI to 3.3V for the SD.

I'm confused. In your first post you said you were using a microSD card. But the HW-203 SD module you are using is for full-size SD cards. If you have a microSD card, then the module recommended by fat16lib in post #8 is what you need. Your HW-203 module, for full-size cards, only works with 3.3V Arduinos, not 5V. The problem is not the power supply voltage, but rather the voltage on the CS, MOSI and SCLK lines output by the Arduino. The HW-203 has no voltage translation, so you would be sending out 5V on those lines when the card is powered by 3.3V, which you shouldn't do.

Hi, thank you for your answer.
Sorry, to hear that I confused you. Let me explain my self.
You are right. The module is designed for full size SD card. I used microSD card with adapter.
I think the difference between SD and microSD is only the size. Please , correct me if I wrong.
Also, the module, as I understand it, can work from both 5 and 3.3V.
I tried 3.3 V it also didn't work.
Regards

Okay,
I am not sure what should I do with it.
If I connect to 3.3 V it should work.
I did, it didn't.
I am not familiar with arduino or any other platform. I only start to use it.
I though that this module should be very simple.
May be you can give some advice where to fined problem or how to "debug" circuit.
Thanks a lot

Your HW203 module will never work with Uno. The Uno has a 5V CPU The HW203 is designed to work with 3.3V CPUs. Connecting the HW203 power pins to 3.3V or 5V will not change the Uno's SPI levels to 3.3V.

The problem is with the SPI logic levels. The Uno has 5V levels, the SD requires 3.3V levels. You must use an SD modules that translates levels. The SD module must have level shifters. The HW203 has no logic level shifters.

1 Like

Thanks a lot !!!!!
I mean a looot!!
Now I get it.
You just saved me hours of time and effort )))
I will use module that you advised in post earlier.
I have to ask:
Will it work if I use resistor to reduce voltage from 5 to 3.3 V? For all connection pins.
Best regards)))

You will probably be happier with a microSD card module like the one recommended. But if you have three 1N4148 diodes, there is a fix for the full-size module that might work. Pictures below.

You cut the existing traces and insert the diodes. With that, the Arduino can only bring the lines low. When not brought low, the lines will be pulled up to 3.3V by the module's 10K pullup resistors.

Only try this if your module looks like the one in the picture.

Edit: One other possibility for your problem is insufficient power going to the SD card module. It might be helpful if you could show how your Arduino is powered, and where the 5V (or 3.3V) for the module comes from.

1 Like

Thank you tor possible solution.
The arduino is powered by USB cable connected to PC.
I am not sure why there are diodes and not resistores. Is it because of nature of spi protocol? Like it is not a simple DC so we need diodes.
Also I don't really have diodes, so it is easier just to take other module.
Regards

I'm not an expert, but isn't it wrong that he connected 5 volts to the digital pin and not to the 5 volts itself as well as sending 5 volts to the 3.3 volt input as shown in the picture? As someone mentioned wouldn't these things even without the other things on destroy the board? There are exact instructions for the board.

Hi. You can have a look here about why it doesn't (usually) work with resistors

TLDR, they might slow down the signal speed too much. They might work (especially if your library supports half speed), but no guarantee

I have done it in the past and it worked, but your mileage may vary

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.