E
E
Evgeny Sofonov2016-03-24 14:10:37
Arduino
Evgeny Sofonov, 2016-03-24 14:10:37

Arduino. How to organize a micro database for MK?

Let's go straight to an example. (so that without introductory water)
There is an Arduino (well, or any other microcontroller of the AVR family with a strapping), it collects data from sensors, let's say the temperature is "by time of day", from 9:00 to 10:00 the temperature is 60 degrees, from 10:00 until 11:00 45 degrees, etc. Micro DB is needed to create and store data "for the day", then "for the week" based on the analysis of daily data, and for the month based on daily and weekly data.
Are there any microdatabases (libraries), perhaps similar to SQLite, only for microcontrollers?
UPD:
please note that this is an "example", it is assumed that there may be 10-20 sensors, not only temperature but also gas, etc. with different set of parameters

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexander Volkov, 2016-03-24
@sofcom

timecode | source | value
This is good, or store it in the memory of the MK or write to a USB flash drive / memory chip according to the "as is" principle.
Further, if your system is autonomous, then make a selection and display it in the desired form on the display.
If you intend to connect to a PC for analysis - carry out the analysis on a PC.
A database on a microcontroller in the classical sense is a bad idea. Wrong hardware capabilities (for arduino and atmega controllers in particular).

A
Alexey Ukolov, 2016-03-24
@alexey-m-ukolov

The simplest thing is to write in csv to a USB flash drive.

A
Alexander Skusnov, 2016-03-24
@AlexSku

We have self-made controllers Access control systems (not Arduino) store events in memory, and when connected to a computer, they transmit everything. By the way, auto recorders also write to the video buffer (usually cyclic).

E
evgeniy_lm, 2016-03-26
@evgeniy_lm

Now I'm making a weather station, but such a question never even crossed my mind. SQLite is a complex data processing system, and you have several banal arrays of two-byte numbers.
Sampling for an hour every 10 minutes - 12 bytes
Average hourly rate per year - 17.16 KB
The RTC DS1307 clock has a memory of 32 KB.
The only caveat is that you need to somehow remember the initial time of the sequence, but this is also not difficult, for example, write at the beginning of the sequence

E
Eugene, 2020-07-22
@Jekshmek

Perhaps in json format, and the storage logic is all up to you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question