📜 ⬆️ ⬇️

MP8036multi: example of a timer

Recently, Master Kit has a new product: 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. However, programming this module for any specific task should not cause any difficulties. Based on the MP8036multi, you can automate the lighting system, control the heating, emergency power supply at home or summer house, automate watering and ventilation of the greenhouse, as well as implement many other solutions.
')
As a first simple example, we will describe 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 a button: the lights turn on in the house, and nice music starts playing at the same time. But after some time, the calm melody is replaced by an alarming alarm, the general illumination goes out, and the exposure begins to illuminate with blinking bright red LEDs - an imitation of the fire has begun!

The facilitator tells why the fire started, how it could be prevented and what emergency measures need to 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 is 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 for even an unprepared user to understand. The operating time is indicated conditionally, if necessary, the values ​​need to be changed to the required values.

TEXT OF THE PROGRAM “DIORAMA MANAGEMENT”

Diorama controls and displays

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

CONFIGURATION RESET

OUTPUT1. MODE_PO_MULSE = 1
OUTPUT1. MODE1. STATUS = 0

OUTPUT1. MODE2. STATUS = 1
OUTPUT1. MODE2. DELAY = 4 (s)
OUTPUT1. MODE2. TIME_ACTION = 28 (s)
OUTPUT1. MODE2. CONDITION1: INPUT1 = 0
OUTPUT1. MODE2. LOGIC_OUTIONS = U1

//T.k. for identical events, different operating modes are required, an additional OUT1 is involved. This output creates an additional event, which selects the desired mode of operation.

RELAY 1. MODE_PO_MULSE = 1
RELAY 1. MODE. STATUS = DISABLED

RELAY 1. MODE. STATUS = ENABLE
RELAY 1. MODE 2. TIME_ACTION = 10 (s)
RELAY 1. MODE2. CONDITION1: INPUT1 = 0
RELAY 1. MODE 2. LOGIC_OUTIONS = U1

RELAY 1. MODE 3. STATUS = ENABLE
RELAY 1. MODE. TIME_ACTION = 10 (s)
RELAY1. MODE3. CONDITION1: RELAY2 = DISABLED
RELAY1. MODE3. CONDITION2: OUTPUT1 = 1
RELAY 1. MODE. LOGIC_OUTIONS = U1 and U2

RELAY2. MODE_PO_MULSE = 1
RELAY 2. MODE. STATUS = DISABLED

RELAY 2. MODE 2. STATUS = INCLUDED
RELAY 2. MODE 2. DELAY = 3 (s)
RELAY 2. MODE 2. TIME_ACTION = 20 (s)
RELAY2. MODE2. CONDITION1: INPUT1 = 0
RELAY 2. MODE 2. LOGIC_OUTIONS = U1

PWM2. MODE_PO_MULSE = 1

PWM2. MODE2. FUNCTION = PWM
PWM2. MODE 2. FREQUENCY = 5 (Hz)
PWM2. MODE2. DURABILITY_IMPULSA = 50 (%)
PWM2. MODE2. CONDITION1: RELAY1 = DISABLED
PWM2. MODE2. CONDIT2: OUT1 = 1
PWM2. MODE 2. LOGIC_OUTIONS = U1 and U2

PWM2. MODE1. FUNCTION = DISCRETE_OUT
PWM2. MODE1. STATUS = 0
PWM2. MODE1. CONDITION1: RELAY2 = DISABLED
PWM2. MODE. LOGIC_OUTIONS = U1

PWM3. MODE_OUT_MISSION = 1

PWM3. MODE2. FUNCTION = PWM
PWM3. MODE2. DELAY = 100 (ms)
PWM3. MODE 2. FREQUENCY = 5 (Hz)
PWM3. MODE2. DURATION_IMPULS = 50 (%)
PWM3. MODE2. CONDITION1: RELAY1 = DISABLED
PWM3. MODE2. CONDIT2: OUT1 = 1
PWM3. MODE2. LOGIC_OUTIONS = U1 and U2

PWM3. MODE1. FUNCTION = DISCRETE_OUT
PWM3. MODE1. STATUS = 0
PWM3. MODE1. CONDITION1: RELAY2 = DISABLED
PWM3. MODE1. LOGIC_OUTIONS = U1


Wiring diagram

To be continued …

Source: https://habr.com/ru/post/367361/


All Articles