20 May 2020 - Conan MercerThis article was originally published in The Journal of Chemical Education - it can be cited from here</b>
Using JSON with ThingSpeak to upload data from sensors connected to the ESP-12E uses the same format as explained in the previous section.
The ESP-12E does not have a real-time clock, therefore the example in the code below uses the term "delta_t" as a relative timestamp. The term "TIME_STAMP" is the value assigned to "delta_t". The term "WRITE_API_KEY" is the ThingSpeak channel write API Key unique to each account.
The term "field1":"FIELD1_VALUE" is the ThingSpeak channel field, and the value to be sent to that field respectively, in the case of this project, temperature and light values.
The size of the JSON buffer determines how many values can be stored within it. This is important when considering data acquisition frequency. In this project, the reaction rate experiment, it is important to read light data every 500ms, it is therefore important to ensure the size of the JSON buffer is adequate. A JSON buffer size of 1500 is deemed sufficient for this purpose and can be found declared in the Bulk Update to ThingSpeak code at line 14. The entire JSON used in this project can also be found in here, where the JSON portion of the code is present between lines 49 and 78.