Introduction: Use ATmega328 Chip As a Storage Device and Store Text and Images in It

Hi everyone! In this instructable, I am going to show you how to store text and images in a small ATmega328P chip. Lets get started!

This article is also available on Jordan's Lab Notebook!

Step 1: Things Needed

Things Needed:

- Arduino Uno

- ATmega Chips (Optional, you can use the original chip of the arduino uno)

- Arduino IDE

- Internet Access

Step 2: [Optional] Replacing the ATmega328 Chip of the Arduino Uno

To replace the ATmega chip you want to store things in, just simply remove the original chip, then insert the new chip. Please be noted that the small circle should be in the right upper corner when you insert the chip.

Step 3: Storing Text Into the ATmega Chip

To write text into the chip, first, we have to open arduino IDE. Then, paste the code below into the Arduino IDE. Before uploading the code into your arduino uno, replace "Text Here!!!" in Line 5 to the text you want to store into the chip:

void setup()

{

Serial.begin(9600);

while (! Serial);

Serial.println("Text Here!!!");

}

void loop() { }

In the code above, we used the 9600 baud serial to display the stored text in the chip. To display the stored text, plug your arduino uno (with the chip that stored the text) into your computer, open Arduino IDE, and click on Serial Monior. Your stored text will be shown on the serial monitor. If it didn't shown up, check if the data rate was set to 9600 baud. It should work fine.

Step 4: Storing Images Into the ATmega Chip

Storing images into the ATmega328p chip is quite the same as storing text. The difference is we have to convert the image into a base64 string.

http://base64.wutils.com/encoding-online/image-to-...

This is a free online image to base64 convertor. First, we need to upload our image. Note that the image cannot be too big, because the atmega has only a limited storage. After you uploaded the image, click the Convert button. Then a bunch of base 64 codes will be shown up. Copy that code to Line 5 of the code:


void setup()
{

Serial.begin(9600);

while (! Serial);

Serial.println("Base64 Code Here!!!");

}

void loop() { }


Just like storing text, we also used a 9600 baud serial to display the base 64 codes. To decode the base64 codes, paste the code into this website:

http://base64.wutils.com/encoding-online/base64-de...

This is the base64 decoding tool.

Step 5: That's All!

Now you can save text and images in a small atmega328p chip!

If you like this Intructables, please like and share!

Feel free to ask below if you have any problems :)

Thanks for Reading this Instructable!

Comments

author
AnishJ5 made it! (author)2016-07-06

Nice concept!

Is there any way I can save values dynamically, as in during the execution of the code?

author
u971 made it! (author)2014-08-21

Interesting project,will try myself thanks for the info.

author
seamster made it! (author)2014-08-20

Cool! Nice project!

About This Instructable

3,877views

29favorites

License:

Bio: Jordan Fung is a 14-year-old entrepreneur and programmer from Hong Kong. He is also the founder and lead developer of Pedosa Innovation. He had been ... More »
More by jordanfung:Android Wear Apps with an iPhone: A Comprehensive Guide to Installing 3rd Party Applications onto Android Wear Watch Paired with an iPhone[DEPRECATED] Arduino-Based Smart Glasses by a 13-year-old - Jordan Fung's Pedosa GlassHow to Format or Partition a Drive in Mac OS X
Add instructable to: