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. Default hardware
    6. Hardware extensions
    7. Special sensors
    8. RGB driver
    9. 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 > Getting Started > Special sensors

Special sensors

In addition to the basic digital and analog inputs described in the Default hardware, following extensions are also supported by unicontrol:

  • DS18B20 thermometer: An industrial-grade, precise thermometer that can operate in almost any environment. It has a measurement range of -55°C to +125°C and an accuracy of ±0.5°C.
  • DHT11/DHT22 sensor: A widely used temperature and relative humidity sensor for IoT applications.
  • 1838 IR Receiver: An infrared signal receiver that allows for remote control capabilities.
  • SR04 family of ultrasound sensors: Proximity sensors that accurately measure distances to the nearest physical obstacle from 4 centimeters to 6 meters.
  • Pulse sensors: A group of sensors that transform various physical parameters into electrical pulses measurable by an impulse counter, such as pulse water flow meters.
  • ENS160 + AHT21: A general-purpose air quality sensor, designed to measure the temperature, humidity, and concentration of CO2e and TVOC in ambient air.

The table below provides comprehensive information on the pinout available for each type of sensor:

Pin SR04 DS18-
-B20
DHT11
DHT22
Pulse sensor ENS160 /AHT21
Trigger Echo
D0✓✓
D1✓✓✓*✓✓✓**
D2✓✓✓*✓✓✓**
D3✓✓✓✓
D4✓✓✓✓
D5✓✓✓*✓✓
D6✓✓✓*✓✓
D7✓✓✓*✓✓
D8✓
A0
*Introduced in version 1.06
**Introduced in version 1.09

The sections below provide detailed information on each of the sensor options outlined above.

DS18B20 thermometer

The DS18B20 is a widely used, industrial grade digital temperature sensor with a measurement range of -55°C to +125°C and accuracy of ±0.5°C. It comes either as a bare sensor (TO-92 or surface-mount) or in a waterproof packaging suitable for outdoor and other harsh environment applications. The unicontrol can upport up to 12 independent units, differentiated by the Channel number. Measurement is performed on a pre-programmed maximum 12-bit resolution ensuring measurements with less than 0.1°C step. Wiring is done as per the schematic below.

DS18B20 dallas thermometer wiring diagram

The DATA pin can be assigned to any digital pin from D1 to D7 in the Peripheral window. However, it is important to note that only one pin can be used; all DS18B20 units must be connected to the selected pin.

If the DATA pin is connected to either the D3 or D4 pin, it is not necessary to include the 4.7k pull-up resistor.
Example of DS18B20 set-up in unicontrol
Please note that the value displayed in the Peripheral window is always the reading of the sensor assigned to the Channel 0. Sensors from other channels may be addressed in individual processes, but are never displayed in the Peripheral window of unicontrol set-up page.

Measurement begins as soon as the device is properly wired and the Data pin is assigned on the set-up page. Measurements are taken at predetermined intervals based on the chosen option:

  • DS18B20 Fast - a new reading is taken every 10 seconds
  • DS18B20 Slow - a new reading is taken every 5 minutes
On disconnect or any other reading disruption, the Safety Shut-down is triggered.

DHT sensors

The DHT11 and DHT22 are combined digital temperature and humidity sensors that are commonly used in a wide range of applications, including environmental monitoring, HVAC systems, and home automation. DHT22 is an accurate and reliable sensor that can measure temperatures from -40°C to +80°C and relative humidity from 0% to 100% RH, with an accuracy of ±0.5°C and ±2% RH, respectively. On the other hand, the DHT11 is a cheaper alternative to the DHT22, with a measurement range of 0°C to +50°C and humidity from 20% to 80% RH, with an accuracy of ±2°C and ±2-5% RH, respectively.

Both the DHT11 and DHT22 are compact and durable sensors that are available in various packages, including through-hole, surface-mount and external shield versions. The unicontrol can utilize up to eight devices independently, one per each digital pin D0 - D7, assigned in the Peripheral window.

DHT11/DHT22 sensor wiring diagram
Example of DHT22 set-up in unicontrol

Measurement begins as soon as the device is properly wired and the Data pin is assigned on the set-up page. Measurements are then taken every 2 seconds. Readings can be accessed in two ways based on Channel selection in the respective Process:

  • Channel 0 - latest temperature reading, in °C
  • Channel 1 - latest relative humidity reading, in %
On disconnect or any other reading disruption, the Safety Shut-down is triggered.

1838 IR Receiver

The 1838 sensor is an infrared receiver module commonly used in a variety of consumer electronics and industrial control systems. The unicontrol is adapted to utilize the 1838 module to receive user-defined commands from any standard IR remote control including a user-friendly learning procedure. The sensor typically has three pins for power supply and output signal, wired as follows:

1838 receiver wiring diagram

For the Signal pin, a user may choose any of the D1 - D7 pins in the Peripheral window. It is, however, not possible to use more than one unit of 1838.

Example of 1838 receiver set-up in unicontrol

The unicontrol can learn up to 8 separate codes differentiated by a Channel selection in the respective Process. Please check IR remote (edit) for a more detailed reference on the learning procedure and usage.

Example of 1838 receiver set-up in unicontrol

SR04 ultrasound sensors

The x-SR04 family of ultrasound sensors is popular, although they are highly situational sensors. They allow for the measurement of the physical distance to the closest obstacle and can be used to monitor the presence or the exact position of a selected object with relatively high accuracy. Common applications include parking sensors in cars, water level monitors, gate position indicators, and general proximity sensors. The unicontrol supports up to four idenpendent sensors per device and offers high flexibility in GPIO choice. As per the wiring diagram, you need to connect the Trigger and the Echo pins to your ESP8266.

From the version 1.16 the unicontrol supports up to four independent SR04 sensors.
These sensors must share a common Trigger pin, but each has its own independent Echo pin.
x-SR04 ultrasound sensor wiring diagram (resistors are optional)

For the Echo pins (up to four can be defined), a user may choose any of the D1 - D7 pins in the Peripheral window, with a separate item for the HC-SR04, JSN-SR04T, and AJ-SR04M, due to the slight differences between individual models. Although both options will read either of the sensors, choosing the correct menu item will lead to the application of the correct limitations. The Trigger pin is common for all sensors and can be assigned to any digital GPIO.

Example of JSN-SR04 set-up in unicontrol
Changing the Trigger pin may require a software reset to take effect, while setting the Echo pin should be reflected immediately.
Sensor Distance range
HC-SR044 - 500cm
JSN-SR04T25 - 600cm
AJ-SR04M25 - 600cm

Measurement begins as soon as the device is properly wired, and both the Trigger and the Echo pins are assigned on the set-up page. Measurements are taken every 0.2 seconds, and only the measured values within the predefined distance range, as per the table above, are considered valid, with all others being ignored. Readings can be accessed in two ways based on the Channel selection in the respective Process:

  • Channel 0 - Instantaneous reading, updated every 0.2 seconds
  • Channel 1 - Average of the last 25 readings, updated every 5 seconds

Values are processed, displayed and published in centimeters, rounded to one decimal place.

On disconnect or any other reading disruption, the Safety Shut-down is triggered.

Pulse sensors

A built-in impulse counter can be used to collect, process, and publish readings from a wide variety of pulse sensors, which generate impulses as physical parameters are measured. This enables monitoring of a range of physical attributes, such as flow speed or volume, distance or velocity of motion, vibrations, light or sound intensity, or counts of physical events or natural phenomena. A common utilization is found in industrial or commercial settings, where accurate measurement and monitoring of physical parameters is critical to operations. The unicontrol supports up to seven independent counters, tested on frequencies up to 1,000 impulses per second, with a theoretical capability of handling up to 10,000 impulses per second. Standard pulse sensors typically have three pins for power supply and output signal, wired as follows:

Pulse meter wiring diagram

The impulses can be counted independently on any of the compatible pins.

Example of an pulse water meter setup in unicontrol

For information on setting up and using the impulse counters, please see the Impulse counter (edit) page.

ENS160 + AHT21

The ENS160 represents one of the latest additions to air quality sensors, capable of measuring the concentration of carbon dioxide equivalent compounds (CO2e) and volatile organic compounds, both having an adverse effect on health and needing to be minimized in homes. The AHT21 is a complementary humidity and temperature sensor, providing supporting data to the ENS160 for its calculations. Each unicontrol device can support a single combined ENS160 + AHT21 sensor on the D1-D2 pin pair. The device needs to be wired to the ESP8266 as follows:

Pulse meter wiring diagram
Please use a sufficient power supply to meet the high power demand of the ENS160. A 5V supply with at least 1A rating is recommended. Providing insufficient power will result in highly unstable readings.
Example of the ENS160 + AHT21 combined sensor setup in unicontrol

Measurement begins as soon as the device is properly wired and the SCL and SDA pins are assigned on the setup page. Measurements are then taken every 10 seconds. There are four different readings accessible via the SCL (D1) pin, differentiated by the Channel selection in the respective Process:

  • Channel 0 - CO2e reading (ENS160), in particles per million (ppm)
  • Channel 1 - TVOC reading (ENS160), in particles per million (ppm)
  • Channel 2 - temperature reading (AHT21), in °C
  • Channel 3 - relative humidity reading (AHT21), in %
  • Channel 4 - air quality index (AQI):
Source: www.sciosense.com

For optimal results and user experience, please ensure that:

  • Soldering is performed quickly and without excessive overheating of the sensor. The ENS160 sensor is particularly sensitive to overheating when soldered.
  • There is sufficient airflow around the sensor. Restricting airflow may lead to more stable readings but at the cost of a slower response to changes.
  • The cable connecting the sensor to the ESP8266 is as short as possible (up to 20cm). The I2C protocol requires a stable connection without interference.
On disconnect or any other reading disruption, the Safety Shut-down is triggered.
© 2024 ayatec.eu • Found a mistake?  Let us know!