Today I’m going to do a simple tutorial on how to convert your arduino powered with Ethernet shield into SD card reader and display the contents of the file into a web page…
first , let me show how the SD card works with the Ethernet shield. The communication between the microcontroller and the SD card uses SPI, which takes place on digital pins 11, 12, and 13 (on most Arduino boards) or 50, 51, and 52 (Arduino Mega). Additionally, another pin must be used to select the SD card. This can be the hardware SS pin – pin 10 (on most Arduino boards) or pin 53 (on the Mega) , I used pin 10 as an output with high voltage on it to initialize the SD Card . In this tutorial I used 2GB SD Card , Arduino mega , Ethernet shield and a network.
here’s the code
and here’s the output
The previous code initializes the SD Card , opens every file and displays it in a single web page . you can change the IP address due to your network . Also you can modify it if you want to read it through serial terminal – but think from another perspective as you can copy & paste the files through the network , with serial communication this process becomes more and more difficult but it can be done – .
This code has two missing feature which I didn’t figure it out how to do it till now . First , this way can’t deal with any type of files except text files . Second , if you want to show the content of every file as you can do it with your localhost … how it can be done ?
Be my guest and share it with us if you know the answer of the questions above 😀