Keller Nanolevel topic

Classes for the Keller Nanolevel capacitive level sensor.

These are for Keller Nanolevel capacitive level sensors.

Sensor Datasheet

Sensor Constructor

KellerNanolevel::KellerNanolevel(byte modbusAddress, Stream* stream, int8_t powerPin, int8_t powerPin2 = -1, int8_t enablePin = -1, uint8_t measurementsToAverage = 1)

Construct a new Keller Nanolevel instance.

Parameters
modbusAddress The modbus address of the Nanolevel.
stream An Arduino data stream for modbus communication. See notes for more information on what streams can be used.
powerPin

The pin on the mcu controlling power to the Nanolevel. Use -1 if it is continuously powered.

  • The Nanolevel requires a 9-28 VDC power supply.
powerPin2 The pin on the mcu controlling power to the RS485 adapter, if it is different from that used to power the sensor. Use -1 or omit if not applicable.
enablePin The pin on the mcu controlling the direction enable on the RS485 adapter, if necessary; use -1 or omit if not applicable.
measurementsToAverage The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.


Example Code

The Keller Nanolevel is used in the menu a la carte example.

1#include <sensors/KellerNanolevel.h>
2
3// NOTE: Extra hardware and software serial ports are created in the "Settings
4// for Additional Serial Ports" section
5
6// NOTE: Use -1 for any pins that don't apply or aren't being used.
7byte nanolevelModbusAddress = 0x01; // The modbus address of KellerNanolevel
8const int8_t nlAdapterPower = sensorPowerPin; // RS485 adapter power pin
9const int8_t nanolevelPower = A3; // Sensor power pin
10const int8_t nl485EnablePin = -1; // Adapter RE/DE pin
11const uint8_t nanolevelNumberReadings = 5;
12// The manufacturer recommends taking and averaging a few readings
13
14// Create a Keller Nanolevel sensor object
15KellerNanolevel nanolevel(nanolevelModbusAddress, modbusSerial, nlAdapterPower,
16 nanolevelPower, nl485EnablePin,
17 nanolevelNumberReadings);
18
19// Create pressure, temperature, and height variable pointers for the Nanolevel
20Variable* nanolevPress = new KellerNanolevel_Pressure(
21 &nanolevel, "12345678-abcd-1234-ef00-1234567890ab");
22Variable* nanolevTemp = new KellerNanolevel_Temp(
23 &nanolevel, "12345678-abcd-1234-ef00-1234567890ab");
24Variable* nanolevHeight = new KellerNanolevel_Height(
25 &nanolevel, "12345678-abcd-1234-ef00-1234567890ab");

Classes

class KellerNanolevel
The Sensor sub-class for the Keller nanolevel sensor.
class KellerNanolevel_Pressure
The Variable sub-class used for the gauge pressure (vented and barometric pressure corrected) output from a Keller Nanolevel ceramic capacitive level transmitter.
class KellerNanolevel_Temp
The Variable sub-class used for the temperature output from a Keller Nanolevel ceramic capacitive level transmitter.
class KellerNanolevel_Height
The Variable sub-class used for the gauge height (water level with regard to an arbitrary gage datum) output from a Keller Nanolevel ceramic capacitive level transmitter.

Sensor Timing

The sensor timing for a Keller Nanolevel

#define NANOLEVEL_WARM_UP_TIME_MS = 500
Sensor::_warmUpTime_ms; the Nanolevel warms up in 500ms.
#define NANOLEVEL_STABILIZATION_TIME_MS = 5000
Sensor::_stabilizationTime_ms; the Nanolevel stabilization takes about 5s (5000ms).
#define NANOLEVEL_MEASUREMENT_TIME_MS = 1500
Sensor::_measurementTime_ms; the Nanolevel takes 1500ms to complete a measurement.

Pressure

The pressure variable from a Keller Nanolevel

  • Range is 0 to 300mbar
  • Accuracy is Standard ±0.1% FS, Optional ±0.05% FS

KellerNanolevel_Pressure::KellerNanolevel_Pressure(KellerNanolevel* parentSense, const char* uuid = "", const char* varCode = "kellerNanoPress") explicit

Construct a new KellerNanolevel_Pressure object.

Parameters
parentSense The parent KellerNanolevel providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "kellerNanoPress".

#define NANOLEVEL_PRESSURE_RESOLUTION = 5
Decimals places in string representation; pressure should have 5 - resolution is 0.002%.
#define NANOLEVEL_PRESSURE_DEFAULT_CODE = "kellerNanoPress"
Default variable short code; "kellerNanoPress".

Temperature

The temperature variable from a Keller Nanolevel

  • Range is 10°C to 50°C
  • Accuracy is not specified in the sensor datasheet

KellerNanolevel_Temp::KellerNanolevel_Temp(KellerNanolevel* parentSense, const char* uuid = "", const char* varCode = "kellerNanoTemp") explicit

Construct a new KellerNanolevel_Temp object.

Parameters
parentSense The parent KellerNanolevel providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "kellerNanoTemp".

#define NANOLEVEL_TEMP_RESOLUTION = 2
Decimals places in string representation; temperature should have 2 - resolution is 0.01°C.
#define NANOLEVEL_TEMP_DEFAULT_CODE = "kellerNanoTemp"
Default variable short code; "kellerNanoTemp".

Height

The height variable from a Keller Nanolevel

  • Range is 0 to 120 inches
  • Accuracy is Standard ±0.1% FS, Optional ±0.05% FS

KellerNanolevel_Height::KellerNanolevel_Height(KellerNanolevel* parentSense, const char* uuid = "", const char* varCode = "kellerNanoHeight") explicit

Construct a new KellerNanolevel_Height object.

Parameters
parentSense The parent KellerNanolevel providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "kellerNanoHeight".

#define NANOLEVEL_HEIGHT_RESOLUTION = 4
Decimals places in string representation; height should have 4 - resolution is 0.002%.
#define NANOLEVEL_HEIGHT_DEFAULT_CODE = "kellerNanoHeight"
Default variable short code; "kellerNanoHeight".

Define documentation

#define NANOLEVEL_WARM_UP_TIME_MS = 500

Sensor::_warmUpTime_ms; the Nanolevel warms up in 500ms.


#define NANOLEVEL_STABILIZATION_TIME_MS = 5000

Sensor::_stabilizationTime_ms; the Nanolevel stabilization takes about 5s (5000ms).


#define NANOLEVEL_MEASUREMENT_TIME_MS = 1500

Sensor::_measurementTime_ms; the Nanolevel takes 1500ms to complete a measurement.


#define NANOLEVEL_PRESSURE_RESOLUTION = 5

Decimals places in string representation; pressure should have 5 - resolution is 0.002%.


#define NANOLEVEL_PRESSURE_DEFAULT_CODE = "kellerNanoPress"

Default variable short code; "kellerNanoPress".


#define NANOLEVEL_TEMP_RESOLUTION = 2

Decimals places in string representation; temperature should have 2 - resolution is 0.01°C.


#define NANOLEVEL_TEMP_DEFAULT_CODE = "kellerNanoTemp"

Default variable short code; "kellerNanoTemp".


#define NANOLEVEL_HEIGHT_RESOLUTION = 4

Decimals places in string representation; height should have 4 - resolution is 0.002%.


#define NANOLEVEL_HEIGHT_DEFAULT_CODE = "kellerNanoHeight"

Default variable short code; "kellerNanoHeight".