Enable Javascript

Gebruikerswaardering: 4 / 5

Ster actiefSter actiefSter actiefSter actiefSter inactief

Short but sweet and hopefully understandable!
Midea Group’s: Toshiba, Midea, Comfee, Eureka, COLMO, Beverly, Vandelo, Little Swan
Ewald  Kendziorra sr, 2020, www.kendziorra.nl

Use this Emitter module and you don't need a IR-library or ESP32 RMT-pulsing programming.

With this Midea protocol and the OPEN-SMART 38KHz Emitter module (shown above) you can easily develop your own emitter application, because there is no IR library or RMT pulsation required.
I get the outside temperature from openweathermap (free subscription) and measure the ambient temperature with a DS18B20 module and my own very small DS18B20 library (NO One-wire and Dallas library needed). My Midea Comfee AC now switches automatically ON and OFF according to the set times, temperatures and anti yo-yo time delays.
On my website you will find my Midea Comfee air conditioning Infrared WebSocket application myMidea.ino. You have also to download my simpleLib library map (~30 small libraries with corresponding examples).

It is a simple but logical IR protocol. It works fine with my Midea Comfee air conditioner. Timing is fairly flexible and error detection with inverted bytes is simple but effective. Using the following explanation, you can develop fairly simple your own application.
This Midea AC protocol is read and decoded with my receiverIR.ino, you can find it on my website.
Before you start, read my article:  DECODING INFRARED PROTOCOLS
On my website you will also find: myMidea.ino: split AC IR control with an Web Browser interface

 1   Arduino.../ESP... board (from UNO to ESP32 or any other type board)
 1   OPEN-SMART 38KHz IR Emitter (VCC 5V pin  -  there are also modules without 38KHz pulses)
 1   OPEN-SMART DS18B20 one-wire temperature censor (VCC 3.3V pin)
 7   DuPont female to female jumper wires (2xVCC, 3xGND-connect-oneTOtwo, 1xIR, 1xTemp)

IR modulation 38KHz is 26.31579µs(p).
We use T as a theoretical time/pulse unit.
Suppose one T is 555µs that's ~21 pulses (we see later that T can vary quite a bit, ~±50µs).
Timing has been analyzed by examining the received signals (see bellow by: MIDEA VALUES)

Theoretically we can work with multiplied T times (T, 3T, <n>T) but later on we see that we can better take separate values. By example T combined with a L(ow-line) label and an P(ulsed-line) label (TnL and TnP).
1T, 3T and <n>T provides sufficient space to accommodate time/pulse differences.
1T and 3T are often used as logic 0 and logic 1.

  LOW      T1L: 555            (µs)
  PULSED   T1P: 555, T3P: 1665 (µs)
Send a Logic 0 Bit: T1L + T1P
Send a Logic 1 Bit: T1L + T3P

stream: T1L,T3P,T1L,T1P,T1L,T3P,T1L,T1P
       |     1 |     0 |     1 |     0 |  duration send 0xA: ~6660µs/6.7ms

In a test with 10x the same command  (use my receiverIR.ino):
   the times measured differ a bit, so we take the average of the values found.
Change the T<n>L and/or T<n>P values as desired.

Average signal measured (from my receiverIR.ino, see below by MIDEA VALUES)

             µs:   1T    3T    8T   10T
Theoretical    :  555  1665  4440  5550
Measured values:  543  1592  4401  5184
Usable values  :  540  1600  4400  5200

A Midea command always contains 3 sets of 2 bytes (3x8=24 bits) by example: 0xB2, 0xBF, 0x00.
A command always consists of 2 x 100 time values: (see FORMAT EXPLANATION)
  for (i = 0; i < 2; i++) {  // Midea expects the same command stream twice
     send(T8L, T8P)  // Start
     for (j = 0; j < 48; j++) {
         // shift bits code here
         if (bit) send(T1L, T3P) else send(T1L, T1P)
            (we send Bit by Bit: 0xB24DBF4000FF = 48 Bits  -  48 Bits? see MIDEA FORMAT EXPLANATION)
    send(T1L, T10P)  // End
    send(T1L, T10P)  // extra: dummy time values

    One_Bit+inverted_Bit=2xT1L+T1P+T3P=3220µs (see MIDEA FORMAT EXPLANATION).
Total frame time: 8800+154560+5740=169100µs or ~169ms.

An command example: AC ON, fan AUTO, temp 17*C, mode COOL, the command bytes are HEX: B 2 B F 0 0
The 6 bytes are paired to three 8-Bits values HEX: B2 BF 00
Also as inverted transmitted every 8 bits HEX: B2 4D BF 40 00 FF
An 6-bytes commands (=12-bytes with the inverted) example: B24DBF4000FF (stdBytes, fan, dummy, temp, mode, inverted)
But that also twice, as one stream: <START>B24DBF4000FF<END><START>B24DBF4000FF<END><END>
Including inverted bytes is a simple way to detect receive errors!

MIDEA VALUES (download my receiverIR.ino to get the values)
Decoded after IR sent with my Midea Comfee remote control. Tested with a ESP32 and a OPEN-SMART IR Receiver.
1st: 100 µs values (every second value is 38KHz pulsed see by THEORETICAL TIMING).
2nd: repeat the "same" 100 µs values (values may vary within certain limits).
The Bits between START and END: T1L,T3P is a logic 1, T1L,T1P is a logic 0

    (  START   )(........1, .......0,                          ........1)(   END   )
1st: 4431, 4371, 556, 1593, 557, 518, (->6x8bits, 96 values->) 556, 1593, 557, 5184 (total 100 values)
2nd: 4407, 4371, 556, 1593, 557, 519, (->6x8bits, 96 values->) 557, 1593, 556, 5184 (total 100 values)
averages: 1T: 543 3T: 1592 8T: 4401 10T: 5184
Both byte sets must be equal:
    B24DBF4000FF first             (inverted)
    B24DBF4000FF second
The command byte set: |B2|B F|0 0| ( <-- byte set colors? B2:standard, B:fan, F:dummy, 0:temp, 0:mode)

STANDARD COMMAND VALUES (all values decoded with my Arduino/ESP receiverIR.ino)
(colors as used in the examples)

Start Value : B2
Fan speed   : 9, 5, 3, B, E (low, mid, high, auto, off)
Dummy       : F
Temperature : 0, 1, 3, 2, 6, 7, 5, 4, C, D, 9, 8, A, B, E (17, 18, 19->30*C and off)
Modes       : 0, C, 8, 4, F, D (cool, heat, auto, fan, ventilate, dehumidify)

SPECIAL COMMANDS (all values decoded with my Arduino/ESP receiverIR.ino)

Start       : continue (we use the last ON values)
Stop        : B2 7B E0
Sleep       : B2 E0 03
Deflector   : B2 0F E0
Oscillate   : B5 F5 B2
Turbo       : B5 F5 A2
Clean       : B5 F5 AA
Led         : B5 F5 A5
Eco on      : B5 F5 82
Eco off     : B5 F5 83
Ionize      : B5 F5 A9 ?? (not in my ac, value from WWW)
FollowMe    : BA 59 02

Steps and FollowMe:
    For that you have to be near your AC so you can use the standard remote control☺
    I have not tested the timer.

FORMAT AND SEND COMMAND (a simple Midea only proposal)
You can also download my simple and very minor
sMideaIR.ino example code with all the basic functions and values to easily create your own application. It is as example included in my simpleLib library.
On my website you will also find my my Midea Comfee AC application with a Web Browser interface
Only two command functions to full control a Midea AC:  stdCmd(fan, tmp, mode) and spcCmd(cmd).

//    This ultra short demonstration code and using my    //
//  sMideaIR.h (only ~55 code and ~50 declaration lines)  //
//   switch my Midea Comfee air conditioning ON and OFF.  //
// Only two command functions to full control a Midea AC. //
// WE DO NOT USE AN INFRARED or other third-party library //
#include <sMideaIR.h>  // included in my simpleLib library
const byte irPin = 4; 
void setup() {         // use the parameter labels to set a Midea AC command
//  spcCmd(onAC);      // only after mideaBegin(): start AC with the init values (autoFan, tmp24, coolMod)
//  delay(10000); 
  stdCmd(autoFan, tmp20, coolMod);  // this will send: 0xB24DBF4020DFB24DBF4020DF
      /* stdCmd(fan, tmp, mode)     STANDARD COMMAND parameter labels:
                fan:  lowFan, midFan, highFan, autoFan, offFan
                tmp:  tmp17, tmp18, tmp19, tmp20, tmp21, tmp22, tmp23, tmp24,
                      tmp25, tmp26, tmp27, tmp28, tmp29, tmp30, tmpOff
               mode:  coolMod, heatMod, autoMod, fanMod, ventMod, dehumMod     */
  spcCmd(offAC);                    // this will send: 0xB24D7B84E01FB24D7B84E01F
      /* spcCmd(cmd)                SPECIAL COMMAND parameter labels:
                cmd:  onAC,    offAC, sleepAC, deflectAC, oscilAC, turboAC, 
                      cleanAC, ledAC, ecoOnAC, ecoOffAC,  ionizeAC            */    
  spcCmd(onAC);  // (re)start AC with the last used STANDARD command stdCmd(fan, tmp, mode)
void loop() {;}