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 > Default hardware

Default hardware

The unicontrol lets you take advantage of a wide variety of hardware configurations with an ESP8266 board at the core.

Compatible boards

In essence, the unicontrol software is compatible with any ESP8266 board with Flash memory of 4MB or more. This software has been tested and verified on multiple boards as follows (not exhaustive):

Development boards and chips Compatibility
Assumed Tested
ESP-03/05/07 (4MB)✓
ESP-07S✓
ESP-12 (ESP8266MOD)✓
ESP-12E/F✓✓
ESP-12S/Q✓
ESP-202✓
ESP-WROOM-02D/U (4MB)✓
Wemos D1 Mini* / Mini Pro / Pro all versions✓✓
Wemos D1 R1✓
NodeMCU v0.9✓✓
NodeMCU v1.0✓✓
NodeMCU v2✓
Adafruit HUZZAH ESP8266✓
Modules Compatibility
Assumed Tested
ESP-12E/F/S Relay Module 2/4/8 Channel✓✓
*Be careful when buying the Wemos D1 Mini. The market is flooded with questionable-quality counterfeits of this particular version of ESP8266 which not carry real CH340G converters. While they are generally functional, you will need an external USB-TTL converter to succesfully flash these boards, which may be significantly inconvenient.

The unicontrol is capable of controlling the full hardware capabilities on any ESP8266 - based development boards, applying individual boards' limitations. In the basic configuration, you may control the following I/O:

Pin GPIO Default function
D016Digital OUT
D15Display - SCL
D24Display - SDA
D30Digital OUT
D42System LED
D514Digital IN
D612Digital OUT
D713Digital IN
D815Digital OUT
A0ADC0Analog IN
*In version 1.07 the default setting for pins D1 and D2 was changed to Display (SCL/SDA).

Please check the Peripheral page to find out more about hardware setup possibilities.

Basic I/O

Following the listings above, in the basic configuration you may use the available on-board GPIOs as:

  • Plain digital output,
  • Plain digital input, and
  • Analog input.

Plain digital (logical) output

The first and most obvious capability of unicontrol is connecting a basic HIGH / LOW-output type device to the ESP8266 board and control it via turning a GPIO pin on and off according to a pre-set timer, external command or any measurable event. With a minimum set-up (using a relay, mosfet or nothing at all) you may for example:

  • open or close a house gate or garage door,
  • turn any light (including LED) on and off,
  • dim an LED/LED stripe, or
  • switch a fan, water pump, or any other 100/230V device on and off.
No special software treatment is necessary in those cases, as full control is achieved by simply writing a HIGH, LOW, or specific PWM output on a predefined pin.
In the basic configuration all 9 digital pins (D0-D8) can be used as digital output, all capable of PWM. This may, however, be expanded using the Shift Register to a total of 18 independent digital output pins, 6 of which retain the PWM capability.

Plain digital (logical) input

All ESP8266 GPIO pins are capable of reading a basic HIGH/LOW-input type signal and using this information either to control an output or post it online. With a minimum setup (using a resistor or nothing at all), you may, for example, read the logical state of:

  • PIR movement sensor,
  • capacitive touch sensor,
  • shock or sound sensor,
  • mechanical switch or a button, or any other low voltage HIGH/LOW-based input.
No special software treatment is necessary in those cases, as these devices only return an easily readable HIGH or LOW value to a connected pin.
In the basic configuration, all 10 accessible pins (D0-D8 and A0) can be utilized as a logical input.

Analog input

The A0 pin holds a special place among the ESP8266 capabilities as its built-in A-D converter allows it to measure not only a HIGH or LOW state, but also a full range of input voltage from 0 to 3.3. By connecting a suitable sensor to the A0 pin in a correctly chosen voltage divider configuration, you can measure:

  • potentiometer,
  • water level in a flower pot,
  • light brightness,
  • soil moisture,
  • temperature, or
  • any other analog input measurable with a resistance-based sensor.
Although A0 is the only pin with a built-in ADC on any ESP8266-based board, you may increase the available input channels to 8 using an Analog multiplexer.

System Button

The System button is a pre-programmed ESP8266 GPIO button functionality, which serves exclusively for the most basic system commands, depending on how long it is pressed:

  • Short press (shorter than a second with display in screensaver mode): Temporarily disables the screensaver mode.
  • Screensaver mode was introduced in version 1.16. In this mode, the display only renders alerts but is dimmed otherwise to prevent its excessive wear resulting in loss of brightness or burn-in. The screensaver mode is initiated automatically after 5 minutes of uninterrupted operation, but only if the Display is in use and the System Button is assigned to I1 or I8. This timer resets with each press of the System Button. Starting with version 1.17, the display in screensaver mode continues to show status information by briefly flashing a single, double, or triple status dot every 10 seconds, corresponding to one, two, or three flashes of the status LED, respectively.
  • Short press (shorter than a second without display in screensaver mode): Toggles between the Wi-Fi modes Station, Access point, and Off.
  • Starting with version 1.17, the Wi-Fi mode automatically reverts to its default mode after 5 minutes.
  • Medium press (between 1 second and 10 seconds): Reboots the device.
  • Long press (longer than 10 seconds): Performs a factory reset of the device, replacing ALL settings with the factory defaults and reboots the device.

By default, the System Button is assigned to the I8 analog input, only accessible with the Analog multiplexer. However, users can change this to any digital pin from D1 to D7, or the I1 or I8 pins of the Analog multiplexer, or even disable the button entirely.

It is not possible to have multiple pins serve as the System Button.

Using the System button on any ESP8266 board other than NodeMCU* will require adding the designated hardware button first. To do so, connect the System button pin (D4 by default) to one leg of the button, and the GND pin to the other as per the schematic below:

Connection scheme of the system button.
System button wiring diagram example
*Standard NodeMCU development boards are already equipped with the on-board FLASH button connecting its D3 pin to GND, which is also usable as the System button.
Actions performed by pressing the System button are notified by the System LED.
The sensoraya control module has a dedicated on-board System Button connected via the Analog multiplexer's I8 pin. Alternatively, the same button can be wired via solder-jumper also to the D3 (GPIO0) ESP8266 pin.

System LED

The System LED is a pre-programmed ESP8266 on-board LED functionality, which serves exclusively for the most basic system diagnostics. The information provided by the device can be inferred from the LED sequence as per the table below:

LED Sequence Interpretation
System LEDLED is on (for up to 10 minutes)The device is booting and, if requested, resetting to factory defaults.
System LED10 fast flashes over the course of 2 secondsThe device has booted succesfully.
System LED1 short flash every 10 secondsThe device is running without an active STA Wi-Fi connection.
System LED2 short flashes every 10 secondsThe device is running and has successfully connected to Wi-Fi (STA).
System LED3 short flashes every 10 secondsThe device is running and has successfully connected to both Wi-Fi (STA) and MQTT broker.
System LED1 long flash every 10 secondsThe device is running in the Wi-Fi AP mode or has just been switched to this mode by short-pressing the System button.
System LED1 very long flash every 10 secondsThe Wi-Fi is off.
System LEDRapid flashing over the course of 2 secondsReboot and reset to factory defaults is following.
System LED4 rapid flashes every secondThe System button is pressed and held.

By default, the System LED is assigned to the D4 pin on the ESP8266 board. However, users have the option to change this assignment to any digital pin from D0 to D8 or even disable the System LED entirely if not required.

Multiple pins can be selected to serve as the System LED. Please note that any choice other than D4 will require adding a hardware LED, including an adequate resistor.
The sensoraya control module has an extra, dedicated Shift Register pin for the System LED, not using up any usable peripheral. Alternatively, the same LED can be wired via solder-jumper also to the D8(GPIO15) ESP8266 pin.
© 2024 ayatec.eu • Found a mistake?  Let us know!