LCD 16x2 data pins and sd card module on the same pins?

Since i don't have anymore pins left on my uno so... Can i use the 4 data pin of LCD16x2 connected to Arduino uno also for the 4 pins of sdcard module both at the same pins?... I have this idea that while the LCD Enable pin is LOW i could use the data pins for sd card as well??? Will it work or any damage could occur? I'm new to Arduino , thanks.

No, that will not work. Are you using the analog input (A0-A5) pins for anything? Those pins are by default digital pins.

You can buy LCDs that have I2C interfaces requiring only 2 pins (A4 and A5).

Also it is fairly easy to add pins with shift registers and I2C expanders.

We can offer better help if you would describe your project.

Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
We may be able to help with pin allocations you have already made.

Thanks… Tom… :slight_smile:

The SD card must be connected to certain pins: MOSI, MISO, SCK (and one other pin which you can choose). These pins make up the SPI Bus. A bus is a collection of pins which can be shared by several devices.

Using this library and a 74hc595 shift register, you can control the LCD with MOSI and SCK (MISO will not be needed for LCD). Only one extra pin will be needed to control your LCD.

So you can control the SD card and the LCD with a total of 5 pins.