Database

Hi,

(microphone ---- arduino ---- database ---- output via PHP)

This is how my project looks.
Basically i’m trying to find out the right database to use for my small project. The readings i get from the microphone will go into the arduino and then that data will be sent to the database.

I have researched mySQL and Microsoft access as databases, and i gather that files such as csv, xml and .txt files go into that database… correct me if i’m wrong.

I was just wondering if i can create a database that deletes the information (csv files) after a certain period of time (say 1 hour) as i don’t want to store a load of level readings. or delete it after it has been used.

I just need a small database for a small project. What would be the best approach?

mrears92:
I just need a small database for a small project. What would be the best approach?

Define 'small'.
1 record, 100 records or 1,000,000 records?

A date stamp field and SQL will allow you to selectively delete data. Databases are slow and complex, do you really need a database?

your post is rather confusing.

you want to find a database..
but you want the readings from the mic to go into a database
you thing csv, smp and txt go onto a data base, yes, you are wrong
you want to create a database that deleted csv files
you need a small database.

this is worse than Whose on first !

if you want to send data out to a PC, then you look at the input and send it as output.
the PC grabs each line and saves it to a file.
that file is the database. once the PC has it, you can do anything you want tiwth it.

if you have an SD card, you can save the data to the card.
the saved file is a database.

if you do not want to record empty space then you use your 'program' to ignore empty space.

say there is no sound for 5 seconds, it would just stop storing lines of no value.
no need to delete. but, if you did, 'program' would delete the file.

Hi,

Could anyone tell me what the best database would be for my project. Microphone level readings will be going from my arduino into the database, then the information from that database will be displayed on a webpage.

XML? SQL? CSV?

Didn't we already do this? Same poster, same question.

All databases can handle that equally depending on the underlying computer.

XML? SQL? CSV?

you cannot compare those 3

XML and csv is a data format where SQL is a query language.

How many records per second do you want to store? # transactions?
what is the content of one record?

If you want to store real time audio, do not use a database for the RT data but only for metadata.

MySQL (or its descendant mariaDB) is a free to use database which can do 100's of transactions per second on a state of the art PC.

Think you should describe your project requirement in far more (tech) detail to get better answers.

moderator: topics merged.

For any small project SQlite is very convenient. It is very widely used and performs well.

...R

mrears92:
Microphone level readings will be going from my arduino into the database, then the information from that database will be displayed on a webpage.

So its just level readings. Not digital audio recordings? How often is the level to be recorded?

The database you choose will be determined by what's available. Most commercially available web server hosting services give you access to mySQL, so you can use that to create a database. If the data is very simple, maybe just a text file.

You can write a php script to receive the reading when the Arduino sends it, perhaps using a GET request, and store the reading in the text file or in a table on the database by using an SQL INSERT command.

A second php script can query the database table with an SQL SELECT command, or read the text file, and create a web page for viewing.

There are various sites (and some are free, for the moment anyway) which can receive readings from your Arduino based sensor and store them, and allow you to view them online as graphs, tables etc,

Paul

Paul

"So its just level readings. Not digital audio recordings? How often is the level to be recorded?"

Just the level readings (70dB, 73dB, 72dB). recorded about 1-2 times a second

mrears92:
"So its just level readings. Not digital audio recordings? How often is the level to be recorded?"

Just the level readings (70dB, 73dB, 72dB). recorded about 1-2 times a second

You seem to want to keep the data for an hour, so in an hour you'll have 3,600 * 1.5 [= about 1 -2] = about 5,400 records.
Once you've stored the records, what do you want to do with the data?
You may not even need a database. A spreadsheet (Excel) may be sufficient for your needs.

Henry_Best:
A spreadsheet (Excel) may be sufficient for your needs.

There's no need for the complexity of an XML or Excel file format. All that is needed is a very simple format such as CSV (which is essentially a text file).

Unless MySQL is used, a PHP script will be needed to deal with writing and reading data; also with deleting old data.

Archibald:
There's no need for the complexity of an XML or Excel file format.

As we don't yet know what the OP wants to do with the collected data, how do you know this?
Say he wants to draw a graph. How could he do that from a text file?
Excel can accept data in CSV format, no special files needed.

Henry_Best:
As we don't yet know what the OP wants to do with the collected data, how do you know this?
Say he wants to draw a graph. How could he do that from a text file?
Excel can accept data in CSV format, no special files needed.

The information is to be displayed on a web page.

I am not clear whether a graph is needed or just a table of sound level readings.

If a graph is needed, consider using PHP to create scalable vector graphics (SVG).

It's also possible to open a CSV file within HTML and get JavaScript to plot a graph within a canvas element.

Another option could be to use ActionScript to draw the graph within Flash.

I don't know whether the graph has to be updated every time a new reading is recorded while a website visitor is viewing the page.