Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Real SD card locker based on Attiny85

You probably are familiar with SD card lock switch. It is supposed to write protect the contents of memory once switched to “Write Protect” position. But fact is that there are many SD readers and sockets that simply ignore this switch and no matter what position switch is on, you can write to this card. So this is not the best way to protect data. But there is a way out. SD card has an internal TMP_WRITE_PROTECT bit in CSD register. So if this bit is set, you cannot write to to card – just read.

sdlocker-tiny-sm

There are other protection layers here like PERM_WRITE_PROTECT bit in same CSD register which can be set once and you get permanent read-only SD card. This one probably is less practical as you are left with fixed data on card. In some cases this is great. Also there is a password protection possibility. Which allows setting 16-bytes password to protect from reading or writing until correct password is sent from host. As SD cards can be interfaces via SPI, this is pretty easy to manipulate protection bits. Originally Karl Lunt has built an SD locker device based on Atmega328p microcontroller. His device Was placed in side Altoids can. Lock/unlock operation can be done with single push button. LED indicates weather card is locked or unlocked. Another more elegant version was built by Nephiel, who replaced Atmega328p with Attiny85 microcontroller which is smaller in size but still has enough power to do the job. So if you are storing valuable information and don’t want it to be corrupted in some way – SD card locker is right choice.

[..Source link..]

Bookmark the permalink.

Leave a Reply