Create database, save records, read, etc

Hello everyone,

I will be creating a project where I have to create a database and 3+ tables in it. A SMARTGPU screen will be attached to an Arduino UNO board. The user must enter some data and the program must go and look for some data in the tables based on the entered data.

The database must be there all the time, from time to time, some information will be updated in it.

Here are my questions:

  • Can a database be saved to Arduino or do I need to save it in the SD card?
  • How can I create it?
  • How can I read/write data in it?

There is a library in the Arduino Playground, but it seems that the database will only be there until I reset the board.

I have strong programming skills, but never had to work with a board before.

Thanks in advance for the help.
Ivan

How big is the database and how dynamic is it?

And, what is this database for? Three or more tables?

The only ways to persist data are using EEPROM (you don't have much; it has limited write cycles) or SD cards.

Your choice should depend on the type and amount of data this database will handle. Can you give us some info on that?

In my college days, I create a random access database using files in Pascal and also in C. There was no SQL involved: everything was done using file operations (open, close, rewrite, reset, read, etc). It was pretty neat. I guess the same techniques can be used with Arduino in a SDcard.

However, if your database is small and has only very simple types, then EEPROM might be a good choice, since there is no need for extra hardware.

Well, there will be no write operations, only read instructions. The database will be defined by the programmer (in this case me).

User will enter a number, the program will define how big the number is, for example:

  • between 1 and 5 = low
  • between 6 and 10 = normal
  • between 11 and 15 = high

Based on this rule arduino must go to the database and pull all the information for the given value.

The amount of data will be:

  • table A with about 5 rows and 4 columns: 3 numeric integers, 1 varchar[20]
  • table B with about 100 rows and 2 columns: 1 numeric integer, 1 varchar[20]
  • table C with about 100 rows and 2 columns: 1 numeric integer, 1 varchar (very long, size of a recipe aprox)

Table A has some user information.
Table B has the title name of a recipe, for example: pancakes
Table C has (for example) the detailed instructions on how to make pancakes

As you can see the data must be persistant and available every time the device it is turned on.

Sorry, I'm very new at this hehe,

Thanks again :wink:

Put it in PROGMEM.