MP8036multi: timer example

    Recently, Master Kit has a novelty: the MP8036multi module, which is a multifunctional configurable controller with simple and clear commands.



    The uniqueness of the MP8036multi module lies in the flexibility of its configuration: the state of the controller outputs may depend on various combinations of input states. At the same time, programming this module for any specific task should not cause any difficulties. Based on the MP8036multi, it is possible to automate the lighting system, heating control, emergency power supply at home or cottage, automate the irrigation and ventilation of the greenhouse, and also implement many other solutions.

    As a first simple example, we will tell you how to build a diorama control system.

    A diorama is an interactive painting or model. For example, consider such a model dedicated to the study of the basics of fire safety.

    Children see the layout of a beautiful house. The presenter presses the button: in the house the backlight turns on, at the same time pleasant music begins to play. But after some time, the calm melody is replaced by an alarm, the general illumination goes out, and the exposure begins to be highlighted with flashing bright red LEDs - an imitation of the fire that has begun is created!

    The host tells why the fire started, how it could be prevented, and what emergency measures must be taken to extinguish it. After some time, when the lecture comes to an end, the alarming red light turns off and the usual background light turns on - the fire has been successfully extinguished!

    All this task can be implemented using one MP8036multi module, which has two independent relay outputs, as well as two PWM outputs.

    Below is the text of the diorama control program, the algorithm of which is easy to understand even for an unprepared user. The operating time is conditional; if necessary, the values ​​must be changed to the required values.

    TEXT OF THE PROGRAM “DIOrama MANAGEMENT” Diorama

    control and indication bodies

    // INPUT1 - start button
    // RELAY1 - output “light”
    // RELAY2 - output “sound”
    // PWM2 - output “LED1”
    // PWM3 - output “
    LED2 ” // OUTPUT1 - timer

    RESET CONFIGURATION

    OUTPUT1. MODE_DEFAULT = 1
    OUTPUT1. MODE1.STATE = 0

    VYHOD1.REZHIM2.SOSTOYANIE = 1
    VYHOD1.REZHIM2.ZADERZHKA = 4 (c)
    VYHOD1.REZHIM2.VREMYA_DEYSTVIYA = 28 (c)
    VYHOD1.REZHIM2.USLOVIE1: INPUT1 = 0
    VYHOD1.REZHIM2.LOGIKA_USLOVY = U1

    //T.k. with the same events, different operating modes are required, an additional OUTPUT1 is involved. This output creates an additional event by which the desired operating mode is selected.

    RELE1.REZHIM_PO_UMOLCHANIYU = 1
    RELE1.REZHIM1.SOSTOYANIE = OFF

    RELE1.REZHIM2.SOSTOYANIE = ON
    RELE1.REZHIM2.VREMYA_DEYSTVIYA = 10 (c)
    RELE1.REZHIM2.USLOVIE1: INPUT1 = 0
    RELE1.REZHIM2.LOGIKA_USLOVY = U1

    RELE1.REZHIM3.SOSTOYANIE = ON
    RELAY 1. MODE 3. ACTION TIME = 10 (s)
    RELAY 1. MODE 3. CONDITION 1: RELAY 2 = DISABLED
    RELAY 1. MODE 3. CONDITION 2: OUTPUT1 = 1
    RELAY 1. MODE 3. LOGIC_TERMS = U1 and U2

    RELAY 2. MODE_DEFAULT = 1
    RELAY 2. MODE 1. STATE = DISABLED

    RELAY 2. MODE 2. STATUS =
    MODE 2 MODE =
    MODE 2. .ACTION TIME = 20 (s)
    RELAY 2. MODE 2. CONDITION 1: INPUT 1 = 0
    RELAY 2. MODE 2. LOGIC_CONTENT = U1

    PWM2.MODE_DEFAULT = 1

    PWM2.ME2.FUNCTION =
    FREQUENCY PWM2.
    MODE2.FREQUENCY. = 50 (%)
    SHIM2.REZHIM2.USLOVIE1: RELAY1 = OFF
    SHIM2.REZHIM2.USLOVIE2: OUT1 = 1
    SHIM2.REZHIM2.LOGIKA_USLOVY = y1 and y2

    SHIM2.REZHIM1.FUNKTSIYA = DISKRETNYY_VYHOD
    SHIM2.REZHIM1.SOSTOYANI E = 0
    SHIM2.REZHIM1.USLOVIE1: Relay2 = OFF
    SHIM2.REZHIM1.LOGIKA_USLOVY = U1

    SHIM3.REZHIM_PO_UMOLCHANIYU = 1

    SHIM3.REZHIM2.FUNKTSIYA = PWM
    SHIM3.REZHIM2.ZADERZHKA = 100 (ms)
    SHIM3.REZHIM2.CHASTOTA = 5 (Hz)
    SHIM3. REZHIM2.DLITELNOST_IMPULSA = 50 (%)
    SHIM3.REZHIM2.USLOVIE1: RELAY1 = OFF
    SHIM3.REZHIM2.USLOVIE2: OUT1 = 1
    SHIM3.REZHIM2.LOGIKA_USLOVY = y1 and y2

    SHIM3.REZHIM1.FUNKTSIYA = DISKRETNYY_VYHOD
    SHIM3.REZHIM1.SOSTOYANIE = 0
    SHIM3 . MODE 1. CONDITION1: RELAY2 = PWM DISABLED
    3. MODE 1. LOGIC_CONTENT = U1


    Connection diagram

    Continued ...

    Also popular now: