datalog_format 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. * DATA LOG FORMAT FILES
  2. TSV format is used to separate data types in files.
  3. ** FILENAME
  4. Due to the FAT32 library using filename must be of
  5. 10 characters [1]. The filename format I'm going to use is:
  6. DATE.l (contains human readeable information)
  7. DATE.r (contains RAW [2] output from sensors)
  8. It is a total of 10 characters per filename.
  9. .l comes form "log"
  10. It cannot be .tsv yet because of the length [1].
  11. *** File .l (log human readeable)
  12. This type of file (.l extension) contains the sensors response
  13. information *after* being processed by the Microcontroller,
  14. it is *human readeable information*.
  15. Some sensors send their readings as RAW so it is not human
  16. readeable, The microcontroller does the calculations to
  17. present the sensor's response as human readeable information.
  18. The loggin format goes this way:
  19. BT PHYSICAL_PHEN_1 UNITS1 PHYSICAL_PHEN_2 UNITS2
  20. TIME SENSOR_N1 ... SENSOR_NM SENSOR_R1 ... SENSOR_RS
  21. TIME1 DATA1_N1 ... DATA1_NM DATA1_R1 ... DATA1_RS
  22. TIME2 DATA2_N1 ... DATA2_NM DATA2_R1 ... DATA2_RS
  23. ...
  24. ...
  25. TIMEQ DATAQ_N1 ... DATAQ_NM DATAQ_R1 ... DATAQ_RS
  26. *Every 3 blank spaces represents a TAB '\t' character*
  27. *BT* = 8 ' ' (blank spaces) for time column
  28. Notice that there may be many sensors and everyone is calssified
  29. according to the physical pehnomenon it measures, a TAB separates
  30. each cell and to keep different physical phenomenon separated *two TAB characters* are used.
  31. Every time a row is filled with a complete row of the sensor's response.
  32. *** File .r (RAW sensors response)
  33. This type of file (.r extension) contains the RAW sensors
  34. response.
  35. Not every sensor send their data as RAW, for the ones that
  36. do it, that RAW response is stored in this file.
  37. If a sensor does not respond RAW data, then the RAW data
  38. corresponding to the sensor is blank.
  39. The logging format is the same as in .l format (see below), the only
  40. difference is that DATA is the RAW response of each sensor.
  41. ** DATE
  42. DD-MM-YY
  43. day-month-year
  44. In the file the DATE is logged only once a day.
  45. ** PHYSICAL PHENOMENA
  46. Specifies the physical phenomena being measured, for instance
  47. temperature, relative humidity, wind speed, etc.
  48. ** UNITS
  49. The measurement units being used, for instance Celcius,
  50. percent, rpm, etc.
  51. ** SENSOR
  52. Each column specifies the sensor's name.
  53. ** TIME
  54. HH:MM:SS
  55. hours:minites:seconds
  56. The time interval when the data was taken.
  57. ** DATA
  58. Each column is a sensor's reading corresponding to the name
  59. in the column.
  60. ** RAW_DATA
  61. Each contains the correspondig sensor RAW response.
  62. ** EXAMPLE
  63. IF you open any logging file using a calc sheet software
  64. like libreoffice calc or excel, follow this steps:
  65. 1. Open the file logged file and tell the software to create
  66. tables from a TSV file.
  67. 2. Select the columns from TIME to the last SENSOR to see
  68. the data properly.
  69. 3. Press the button to create a graphic.
  70. 4. Use the first column as a label.
  71. 5. Use the first row as a label.
  72. 6. Use data series in columns.
  73. You'll get a graphic showing data logged as time has passed.
  74. Here how it will look the table for three different sensors:
  75. Time DHT11 LM35 DSXX
  76. 11:16:32 12,33 13,2 12,46
  77. 11:17:32 12,34 13,4 12,48
  78. 11:18:32 12,55 13,6 12,67
  79. 11:19:32 12,41 13,5 12,61
  80. 11:20:32 12,29 13,4 12,39
  81. After following the steps below the graphic will look like:
  82. ^
  83. | | | B | | |
  84. 13.5 | | | | B | |
  85. | | B | | | B |
  86. | | | | | |
  87. | B | | | | |
  88. 13 | | | | | |
  89. | | | | | |
  90. | | | C | | |
  91. | | | | C | |
  92. 12,5 | | | A | | |
  93. | C | C | | A | |
  94. | A | A | | | C |
  95. | | | | | A |
  96. 12 | | | | | |
  97. ----|----------|----------|----------|----------|----------|->
  98. | 11:16:32 | 11:17:32 | 11:18:32 | 11:19:32 | 11:20:32 |
  99. Where A, B, C are representing points int he graphic
  100. corresponding to sensors DHT11, LM35 and DS1308.
  101. - The Y axis is the *temperature* in celsius.
  102. - The X axis is the time when a temperature sample was taken.
  103. ** Extra Notes
  104. When logging a file, the system will first establish the filename
  105. which is DATE.l or DATE.r.
  106. If that file already exists in the SD_card then new data is appended.
  107. A file is never overwriten or deleted, the system only adds up
  108. new data.
  109. * Footnotes
  110. [1] Filename is a string of 10 characters only because '\0' counts
  111. as a character and it indicates end of string. (It seems to be
  112. like that in FAT32 library, because of a normal short filename )
  113. [2] RAW, generally shows the voltage sensor response or other
  114. not preprocessed data.