Data Gator
Hardware and software documentation for the Data Gator project.
Loading...
Searching...
No Matches
Teros10.hpp
1
9#ifndef TEROS10_H
10#define TEROS10_H
11
12#include <Arduino.h>
13#include <../../include/VWCSensor.hpp>
14
15class Teros10: public VWCSensor{
16private:
17 int analog_pin; // pin the sensor is connected to and can be read from
18 int pwr_pin; // pin that must be powered to read from the sensor
19
20public:
21
22 Teros10(int analog_pin, int pwr_pin);
23 Teros10(){}
24 float readVoltage(); // read just the voltage measured by the sensor
25 double getVWC(SoilMedia media); // read the sensor and return the VWC as a decimal which represents the VWC as a percentage
26 double getVWC(SoilMedia media, double voltage);
27
28 std::string toJSON(double voltage){
29 return "\"VWC_RAW\":" + std::to_string(voltage) + ", \"VWC\":" + std::to_string(this->getVWC(MINERAL_SOIL, voltage));
30 }
31
32 std::string getSensorType();
33 double apparentDialectricPermitivity(); // read dialectric permitivity which can then be converted to VWC using Topp equation
34};
35
36#endif
Definition Teros10.hpp:15
std::string toJSON(double voltage)
Convert data to JSON key value pairs.
Definition Teros10.hpp:28
std::string getSensorType()
Return brand+sensor model string for topic.
Definition Teros10.cpp:97
Interface for converting a voltage measurement from an analog sensor into a double,...
Definition VWCSensor.hpp:23
SoilMedia
Defines types of soil for which the volumetric water content calculation needs to be adjusted.
Definition VWCSensor.hpp:35
@ MINERAL_SOIL
Mineral-based soil. Dirt!
Definition VWCSensor.hpp:36
int reset_count
number of resets retrieved for NVS
Definition scheduler.hpp:31