ayatec logo
Home Store Blog Contact
unicontrol user guide by ayatec
Home Store Blog Contact

Topics

  1. Welcome
  2. Getting started
    1. What is unicontrol
    2. How it works
    3. Connectivity
    4. Integration options
    5. Basic I/O
    6. Special I/O
    7. Special inputs - Digital sensors
    8. Special outputs - RGB driver
    9. Special outputs - Audio driver
    10. Network API - HTTP
    11. Network API - MQTT
    12. Network security
    13. Downloads
  3. Web Interface
    1. Processes
      1. Process
      2. Name
      3. Main state
      4. Initial state
      5. Display
      6. Constraints
        1. Process timer
        2. Variable contraints
        3. Force output
      7. Input
        1. Input source
        2. Channel
        3. Control period
        4. Value
        5. Publish
        6. Frequency
        7. Subtopic
      8. Events
        1. On/Off event
        2. Condition
        3. Idle/running time
        4. Delay on/off
        5. Fade in/out
        6. High/low input
        7. Mid point/Tolerance
        8. Out on when
      9. Output
        1. Primary output
        2. Action
        3. Type
        4. Invert
        5. Duty cycle
        6. Mem value
        7. High/low output
        8. Folder/Track
        9. RGB mode
        10. RGB color
        11. RGB brightness
        12. RGB speed
        13. Publish
        14. Subtopic
        15. Secondary outputs
      10. Cycle
        1. Cycles
        2. High/Low phase
      11. On/Off button
    2. Peripheral
      1. Hardware
      2. Type
      3. Calibration
      4. Mapping (edit)
      5. IR remote (edit)
      6. Impulse_counter (edit)
      7. RGB driver (edit)
      8. DS18B20 (edit)
    3. Device
    4. Network
    5. System
    6. License
  4. Tutorials
    1. First boot
    2. First process
    3. Connect to MQTT
    4. Process sequencing

    5. DIY Project: Bath Fan

In this article

  • Introduction
advert
unicontrol > Web interface > Peripheral > Mapping (edit)

Mapping (edit)

The native ADC measurement returns a 10-bit value in the range of 0-1023 which is not sufficient for measurements where the desired value is not a linear function of the voltage reading, say, an NTC Thermometer:

Example of a simple linear approximation.

Value Mapping consists of pairs of Analog-Digital Converted (an) and Target Unit (vn) values and serves to improve the approximation when transforming readings from ADC to other units by breaking down the total curve into a maximum of 49 smaller segments within which the linear interpolation leads to a sufficiently small error:

Example of a mapping approximation.
ADC Value Target Unit Value
a1v1
a2v2
a3v3
a4v4
a5v5
......
a50v50
Maximum number of an-vn pairs is 50 but user may define any number of pairs smaller than that, leaving the remainder unused.
It is a good practice to only define a range of values that are known to be practically obtainable.

Editor

While you may choose a defined Mapping directly within the Peripheral page, you need to visit the Mapping editor to define them. This is achieved by clicking the Edit button below the chosen map in the Peripheral page:

Open the mapping editor.
Please note that the "Edit" button only shows once the relevant input/map is chosen and saved.

Once in the Mapping editor, the user needs to provide following:

  • Name - user-defined name of the Mapping for better orientation,
  • Sign - symbol representing a unit of measurement (e.g. °C, °F, % etc.), and
  • Pairs of ADC/Mapped values - up to 50 combinations of ADCn value with their Mapped counterpart constituting the whole curve. The ADCn series does not need to be regular, but it must be an increasing series, and it is recommended to provide only a range of values that can be practically obtained. If the ADC reading falls outside of the provided range, it is considered an invalid reading and a Safety Shut-down is initiated.

All of this can be provided either by manually filling in the input areas within the Mapping editor or by providing it in the JSON form. This is done as follows:

  1. Click on the "JSON Import / Export" button - this will unhide the JSON textarea
  2. Paste the JSON into the textarea
  3. Click on the "Load from JSON - this will feed the JSON data into the input areas above

JSON needs to be in the following structure:

  • {
  • "name":"[MAPPING_NAME]",
  • "sign":"[MAPPING_UNIT_SYMBOL]",
  • "a1":[a1],"v1":[v1],
  • "a2":[a2],"v2":[v2],
  • ...
  • "an":[an],"vn":[vn]
  • } , with n anywhere between 2 and 50

Example

Consider a following Mapping example for an NTC Thermometer and an instantanous voltage reading corresponding to an ADC value of 562. The nearest lower and upper mapped ADC values as per the example are 554 and 577, respectively. These are corresponding to the Mapped values of 23.3°C and 21.3°C, respectively. The raw transformed value (prior to Calibration) is then calculated as a linear interpolation of the range 23.3°C - 21.3°C based on a relative position of the ADC value of 562 in the range of 554 and 577, which results in 22.6°C.

Example of mapping editor for an NTC Thermometer.
© 2024 ayatec.eu • Found a mistake?  Let us know!