Tanklevel
Tank level meter | |
---|---|
Status | Stable
|
menuconfig | Applications->Tank level meter |
Pinning | yes |
Ecmd | yes |
Depends on | ECMD, Clock, ADC, Cron (optional) |
Code | https://github.com/ethersex/ethersex/tree/master/services/tanklevel |
Tanklevel provides an application for measurement of tank levels by hydrostatic pressure.
Contents
Internals
You need an aquarium air pump, some kind of pipe/tube, a Freescale MPX5050DP pressure sensor and an relay for the pump. Parameters are configurable by ECMD and stored in EEPROM.
Configuration
│ │ (0) ADC channel │ │ │ │ [ ] Measure on system startup │ │ │ │ [ ] Measure at 12 am and 12 pm │ │ │ │ [ ] Inverted pump output │ │ │ │ [ ] Check lock input │ │ │ │ [ ] Inverted lock input │ │ │ │ [ ] Inline tank level │ │
- ADC channel - ADC channel that is connected to the MPX5050DP pressure sensor.
- Measure on system startup - Start initial measurement at system startup.
- Measure at 12 am and 12 pm - Start measurement at fixed time. Can be changed in services/cron/cron_static.c.
- Inverted pump output - Output pin for pump is inverted.
- Check lock input - Check lock pin before measurement and wait if needed. This is used to delay the measurement e.g. if the oil burner is running.
- Inverted lock input - Lock input pin is inverted.
- Inline tank level - Inline a page to query the tank level.
Pinning
Example pinning from pinning/hardware/netio.m4:
ifdef(`conf_TANKLEVEL', ` pin(TANKLEVEL_PUMP, PC3, OUTPUT) ') ifdef(`conf_TANKLEVEL_LOCK', ` pin(TANKLEVEL_LOCK, PA2, INPUT) ')
Meaning:
- TANKLEVEL_PUMP - output pin for driving the pump relay
- TANKLEVEL_LOCK - optional pin for external lock signal (see Configuration)
Mechanical setup
+-------+ |Sensor | +---+---+ | +--------+ +---------------+-+ Pump | | +--------+ +------+------+ | | | | | | |------|------| | | | | | | | | | +-------------+ Tank
See the following example:
Electrical setup
Electrical setup is quite simple. Connect the TANK_PUMP port with an relay (usually via an Transistor as current amp) and the output of the Sensor with the selected ADC channel (have a look at the datasheet for power supply decoupling and output filtering). Select a optimal Vref for the ADC if possible. Schematic could look like this:
Parameters
Parameters can be viewed/set by ECMD commands:
- sensor_offset - zero offset of the pressure sensor in mV
- med_density - medium density in g/ltr (default of 840 for fuel oil)
- ltr_per_m - Ltr per meter tank level
- ltr_full - Tank capacity in ltr
- raise_time - Pump time (in 1/50 secs)
- hold_time - Hold time before measurement (in 1/50 secs)
SNMP support
If SNMP is enabled the level can be queried by this OID's:
- .1.3.6.1.4.1.39967.4.0 = INTEGER: current level in ltr
- .1.3.6.1.4.1.39967.4.1 = INTEGER: tank capacity in ltr
- .1.3.6.1.4.1.39967.4.2 = INTEGER: timestamp of last measurement (unix date)
- .1.3.6.1.4.1.39967.4.3 = STRING: timestamp of last measurement (clear text)