Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Resource icon

SD Card Data Logger PIC16F1827 2025-01-09

No permission to download
Logging temperature from sensor DS18B20 -55 to 125 deg C. Logs up to 65,000 readings to a TXT file on a SD Card formatted FAT32, SDHC (up to 32GB). This PIC16 is short on RAM to write 512 bytes (full sector) to the card, so it cannot create a file, instead it modifies a file on the disk. The code finds the file reads the name and uses it to set the log interval time. At the end of logging the length of the file is updated on the disk FAT descriptor.
To create a text file to copy to the SD take any file (for example mp3 file) size 1MB or larger and rename it. The name has to be 3 digits number that is the interval time and txt extension, for example 031.txt for 31 seconds.
When the code reads 72 bytes of 36 temperature readings it calculates the temperature and convert it to text and writes it into single sector on the card. It repeated for up to 65,000 readings.
Button LOG starts the logging and button STOP resets the logging. Interval time is 1 to 255 seconds, it is set by the text file name. The name must have 3 numbers for example 031 (31 seconds) and txt extension.
Code is provided.

TO SETUP THE CARD
Format the card with FAT32.
On your PC take any file with the size of 1MB or larger and rename it to 3 digits number (001 to 255) that are the interval time in seconds between readings and txt extension, for example "031.txt" (31 seconds) .
Copy the file to the root directory of the card with no other files added.

Circuit and image of Micro SD Card Adapter.
log_sd_1827.gif
microsd.jpg

Text file
log_sd_1827.jpg
Author
zahwi
Downloads
0
Views
192
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from zahwi

Latest threads

Back
Top