One of our customers recently noticed that the description page of our temperature, light, humidity, and pressure sensors mentions the capability of recording data to a flash memory. The documentation however does not cover this topic, and there is nothing about it in the programming library either. It is now time to fix that...
Don't worry, this is no marketing lie : the Yocto-Temperature, Yocto-Meteo, and Yocto-Light modules do indeed feature a flash memory to record measures. If you want to see it by yourself, look for that specific chip:
The flash memory found on Yoctopuce sensors
This chip is a flash memory from SST. It can store approximately 500'000 individual measures. But then, how can you use it ?
Well, until now, you couldn't. Oops... Indeed, we did not finalize that part of the programming API at the time we released the software stack, and rather than botching it in a hurry, we decided to deliver this feature through a firmware update once it would be ready. After a small priority increase, the built-in data logger is now ready. This article gives you a preview of what you can expect from it.
What is it, exactly ? In a few words, the purpose is to provide within our small modules the same function as this machine:
A recording barometer from the end of the 19th century
It is an autonomous data logger, able to record the history of pressure (barometric recorder), temperature, and humidity (humidity monitor, typically used in museum for painting conservation) or any other measured parameter. Most of the time, one simply wants the data logger to work on its own, without requiring any support infrastructure. The mechanical version above has the advantage of not even needing electricity, but it periodically requires some fresh ink, paper, and tension on its spring. The Yoctopuce version only requires an electric plug.
Yoctopuce version of a temperature data logger
The 100 point question is to know how long one can record measures before the memory is filled up completely, and at which frequency the measures are sampled. The base behavior of the data logger is to store one measure per sensor and per second, which is the maximal available recording rate, suited for applications requiring a close monitoring of the evolution of measures. But this fills in the memory quite fast. Unless some kind of automated processing takes care of it, this would require to empty the flash memory to a computer very regularly.
Thankfully, the data logger is able to do better. Once the recording memory is full, the data logger automatically archives the oldest data at a lower sampling rate (keeping only one sample per minute), while continuing to store new measures at the highest rate (one per second). In order to get useful archived data, the data logger not only keeps one value out of sixty, but stores the smallest, average, and highest values recorded during each minute. In the same way, when the flash memory used by the minute-based samples reaches approximately 30% of the total capacity, the data logger archives them, keeping only the minimal, average, and maximal values for every hour, until this occupies approximately 20% of the total flash capacity.
This built-in archival process makes it possible for all Yoctopuce sensors to store every measure taken during the last 24 hours, as well as every minutes for the last week, and every hour for the last year. For modules including less than three sensors, the storage capacity is even higher. The outcome of this process is that the sampling rate that you find in the datalogger memory depends on the frequency at which you download the recorded data from the sensors.
There is another very interesting way to use the data logger. If a USB sensor is connected to a computer behind a powered USB hub, the sensor stays powered when the computer is shut down.
USB sensor connected behind a powered USB hub, to allow data recording regardless of the state of the controlling computer.
When the data logger is enabled, it stores data even when the computer is shut down. In this way, it is possible to provide a continuous recording even when the control computer is in maintenance mode, or even to keep the control computer shut down most of the time to save energy, and to wake up the computer only once in a while to download the data and to handle it.
Are you interested ? The new API making it possible to drive the data logger and to download recorded data is currently in beta-test. It will be officially available within a week, for all programming languages supported by Yoctopuce.