logo elektroda
logo elektroda
X
logo elektroda

CBU restart after switching Earu EAKCB-T-M 1 Din 63A relay to 12V - looking for clues

przemsi_ele 3294 23
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20723065
    przemsi_ele
    Level 11  
    I tried in the previous post but something doesn't seem to be editing.
    I have a device as in the subject
    WiFi relay EAKCB-T-M labeled with EARU, showing technical specifications.

    the template fits from this topic
    https://www.elektroda.pl/rtvforum/topic3934580.html

    only the relay is on 12V

    CBU restarts after switching the relay, on Tuya was ok.
    After disconnecting the relay, there is no restart and the CBU remains connected to the wi-fi.
    Maybe someone can suggest something ?
  • ADVERTISEMENT
  • #2 20725151
    p.kaczmarek2
    Moderator Smart Home
    I assume you are talking about OpenBeken - in which case you must add the following phrase to autoexec.bat (or to the short startup command):
    
    PowerSave 1
    

    This will activate the power-saving mode, which is perhaps needed on this device because otherwise when the relay is switched on, there is a temporary lack of power and everything restarts.
    Helpful post? Buy me a coffee.
  • #3 20725248
    przemsi_ele
    Level 11  
    Yes it's about the openbk, again I was imprecise, I will check today, and I wanted to add a capacitor under the Vcc CBU for testing.

    And if I may ask one more thing on the subject of the device.
    This switch in tuya had a temperature
    in the photo under the ADC there is a voltage divider and probably a thermistor, am I thinking right ?
    Electronic module with CE and RoHS markings and circuit components. .
  • Helpful post
    #4 20725263
    p.kaczmarek2
    Moderator Smart Home
    Try setting the role of P23 to ADC and give this a separate channel then we will see what the readings are:
    ADC I/O ADC, which corresponds to P23 on the internal IC (Correspond to Pin 17 of the IC)
    .
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20725346
    przemsi_ele
    Level 11  
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Earu_63A_1/2/get
    Info:MQTT:Channel has changed! Publishing 1311 to channel 2 
    Info:MQTT:Publishing val 1311 to Earu_63A_1/2/get retain=0

    temperature after opening the case on the workshop about 23 degrees

    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Earu_63A_1/2/get
    Info:MQTT:Channel has changed! Publishing 761 to channel 2 
    Info:MQTT:Publishing val 761 to Earu_63A_1/2/get retain=0

    and now after heating by hand with a heat gun, slightly warm air


    
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Earu_63A_1/2/get
    Info:MQTT:Channel has changed! Publishing 1315 to channel 2 
    Info:MQTT:Publishing val 1315 to Earu_63A_1/2/get retain=0

    and now on a human blast


    And when it comes to
    Quote:
    PowerSave 1

    the reboots still occur
    once I managed to switch on and off, then reboots, I disconnected the relay and the CBU does not reboot.
    I wonder what's wrong with this power supply ???? I think I will throw in a capacitor
  • #6 20725364
    p.kaczmarek2
    Moderator Smart Home
    It's strange, I've only had reports saying that PowerSave helps in this situation. And how many months old is this device? Maybe the capacitors have already flopped, like here:
    https://www.elektroda.pl/rtvforum/topic3898805.html
    Does the relay have a protection diode?
    Circuit diagram of a relay with a flyback diode.
    You could try with a capacitor...

    But it could also be a matter of how the bridge is used there, as it's probably not a typical relay there? I didn't have the device and haven't delved into how it works yet, the Bridge driver was made by @valeklubomir

    What about the ADC, now what do you want to do with that value? If you need to parse it somehow or put some pattern in the code then I can help.
    Helpful post? Buy me a coffee.
  • #7 20725483
    przemsi_ele
    Level 11  
    The equipment is new, on tuya it was ok. , but with Chinese capacitors it is known that it is sometimes different.
    I have seen implementations with relay 5V and 12V , I have an Earu for 12V and a Tongou for 5V, in addition to the performance of the electronics themselves I have seen two versions at home and one on the web.
    in both cases the relay is bistable and switched by a momentary change of polarity and left unpowered, I look at the photos and the diode is not seen, and probably should not even be there because in one direction would short circuit and the relay would not work at all, what happens to the impulse from the coil after disconnection of power supply do not know, maybe this bridge hardware somehow extinguishes it.

    Earu differs from Tongou by the board and the fact that additionally it has this thermometer.

    I have some ESR meter on atmeda, I will call the capacitors.

    When it comes to the temperature I can put it in some conditions with a thermometer and give the ADC values for a given temperature, then some calibration and a template could be made, I have not seen that there is one. In obk is the temperature conversion done by some eventhandlers or deeper in the code ?
  • #8 20725493
    p.kaczmarek2
    Moderator Smart Home
    I would love to investigate this further, maybe e.g. the pulses on the bistable relay are too long, but I only know that there is a driver from Valk here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/driver/drv_bridge_driver.c
    Maybe it would be possible to improve the behaviour with the command BridgePulseLength ?

    With ADC it is either possible e.g. via addChangeHandler to listen for changes or I can just write you some simple driver in C for this, no problem with that. I just need to have specifics on how it should work. Maybe e.g. call it adcTemperature and add some calibration system (what? Multiplier and offset?) and then hook it up to Discovery or something....
    Helpful post? Buy me a coffee.
  • #9 20725555
    przemsi_ele
    Level 11  
    With this adjustable pulse time it could work.

    about the temperature, when I collect the data I'll send

    Fast, because I'm angry, I broke the via when I pulled out the capacitor
    they are missing 10% of the capacitance but it seems that it is not bad, one 4.7u/400V (low ESR), the other ordinary 470u/16V.
    100u/25V soldered to Vcc CBU - it gave nothing


    Temperature comes out linear, with the increase of its value, the value of ADC decreases, so rather will not be a problem to run it.

    Tomorrow I'll upload tables with values and graph, and hopefully repair the via to run the contraption


    I have the values from ADC in relation to temperature change.

    
    stopnie C	ADC
    22		1437
    33		1273
    34		1182
    35		1103
    36		1081
    39		939
    45		862
    50		720
    61		614
    64		504
    


    Graph showing the relationship between ADC values and temperature in degrees Celsius.



    #### as for restarts
    With the pulse length there may be something to it, on the original Tuya there were no resets.

    I soldered 2.2u/400V - still the same
    I soldered 220u/35V - still the same
    I unsoldered both capacitors
    I started to measure the original ones: 4.3u and 415u - so-so
    I soldered them back
    then I switched pins
    "24": "BridgeFWD;1",
    "26": "BridgeREV;1"
    on
    "24": "Rel;1",
    "26": "Rel_n;1"
    the relay started to be powered all the time , not just at the moment of switching
    the power supply became loaded in continuous mode, I had a pyrometer and thermocouple at hand
    I measured the 470u/16v capacitor in the configuration for bridge operation had about 30 deg.C
    Close-up of the interior of an electronic device with a highlighted capacitor. Capacitor tester display showing ESR and Vloss values.
    with the relay continuously energised, after a few minutes of lying around and my deliberation it warmed up to 50 deg.C and voilà
    interesting fact I soldered 220u to it and the device continued to make resets when switching on the relay, I threw it out completely because I found that it has a small internal resistance, I had 2x220u on hand, which I soldered briefly and the restarts stopped
    now I'm waiting for a new capacitor, unfortunately it must be fi8 x 8mm high

    if I manage to do something with this temperature reading after the ADC , then it will be possible to make a template
  • #10 20727860
    przemsi_ele
    Level 11  
    p.kaczmarek2 wrote:
    Maybe e.g. call it adcTemperature

    And in this controller maybe implement some kind of command tempThresholdSwitchOff 1 50 , so that at overheating the relay would switch off if something wanted to light up ? I think it was like that in Tuya
  • ADVERTISEMENT
  • #11 20727886
    p.kaczmarek2
    Moderator Smart Home
    PowerSave 1 and a good quality capacitor, low ESR, and it should work.

    I see that the temperature measurement controller from the ADC will probably have to have lookup table support due to the non-linearity of the measurements. This will need to be implemented.

    No problem you can then do event triggering with temperature changes.
    Helpful post? Buy me a coffee.
  • #12 20727913
    przemsi_ele
    Level 11  
    p.kaczmarek2 wrote:
    I see that the temperature measurement controller from the ADC will probably need to have lookup table support due to the non-linearity of the measurements. This will have to be implemented.

    With this temperature it can be weird, I will try again to measure to eliminate linearity or not

    While the capacitor was heating up the ADC value changed quickly and the capacitor is about 3-4 cm away from the temperature sensor.
    I measured on the open casing, heated to 70 degrees C and watched it drop noting the temperature and ADC values.
    Maybe I should close the casing, put the temperature sensor inside, cool the device in the fridge beforehand, turn on the power and watch it grow.

    I will think more and get back to you.
  • #13 20727929
    p.kaczmarek2
    Moderator Smart Home
    Just make the driver have a lookup table of any (within reason) size and function:
    
    addSample [Voltage] [Temperature]
    

    And it will work too.

    I will try to sit down to this tomorrow, today I have various other requests to deal with, e.g. this .
    Helpful post? Buy me a coffee.
  • #14 20728658
    przemsi_ele
    Level 11  
    I managed to do something like this, but I haven't yet figured out how to make a data table out of it (export from HA to table :) ).
    Into the electrical box I put the guts from the switch and DS18B20 from another thermometer , then slowly heated the closed box. The only thing was that I multiplied the reading from the ADC * 0.01 and then added 10, so that the ADC values and the real temperature were not so scattered along the Y axis of the graph.

    Temperature chart showing Temp_ADC and PZEM4 CWU Temp readings over time.
    Temperature graph from Temp_ADC and PZEM4 CWU Temp sensors over time.
    Graph displaying temperature changes recorded by Temp_ADC and PZEM4 CWU Temp sensors.


    from this graph I will manage to do some mapping of ADC values to temperature
  • ADVERTISEMENT
  • #15 20773642
    przemsi_ele
    Level 11  
    I returned to the topic, temporarily there was no time.

    I replaced the new capacitor, but this did not have a positive effect, the CBU still manages to reset, I have run out of ideas.

    Tongou behaves better than the Earu , and if anything, I recommend Tongou.
  • #16 20773653
    p.kaczmarek2
    Moderator Smart Home
    Would you perhaps be able to connect another, tested power supply to this device in a safe and artful way? Locate where that 12V (or 5V there - you need to check how much) is in front of the LDO, disconnect the device from the mains, and plug in your voltage (the correct one)?

    And then, when you power from a more powerful power supply, does the CBU also reset?
    Helpful post? Buy me a coffee.
  • #17 20774295
    przemsi_ele
    Level 11  
    I'll have a look
    the relay coil in this model is for 12V
    I have to take it apart and see
    It would be good to shoot directly behind the AC-DC power supply , so that everything is powered from one source


    I bought on ali ESP8685-WROOM-06 , I wanted to replace the CBU.
    Well, I did not manage to tear out the CBU without damaging the pads on the board, CBU I can you p.kaczmarek2 :) send by mail as you want (as it looks), when I buy UV varnish, I will try to "repair" the tracks and pads with wires and insert ESP
  • #18 20832607
    przemsi_ele
    Level 11  

    I bought on ali ESP8685-WROOM-06, I wanted to swap it for the CBU.
    Well, I couldn't get the CBU out without damaging the pads on the board, the CBU I can send you p.kaczmarek2 :) send by post if you want (it looks good), when I buy UV varnish I will try to "repair" the tracks and pads with wires and insert ESP
  • #19 21179205
    p.kaczmarek2
    Moderator Smart Home
    I'm assembling this relay from you, I've repaired the tracks, but maybe do you know where the plastic part was?
    Open relay with visible electrical components and a plastic clip nearby. .
    Helpful post? Buy me a coffee.
  • #22 21179251
    p.kaczmarek2
    Moderator Smart Home
    Thanks, that is indeed it.

    I fixed the paths and the unit started up, indeed, even with PowerSave 1 when switching the relay a reboot can happen. I will just look for the cause and check the capacitors. Maybe the pulse timing needs to be changed, although it works fine on other devices:
    [BK7231N - CBU] TONGOU TO-Q-SV1-JWT Wi-Fi switch for Din bus - firmware .
    Close-up of a circuit board with visible connectors, traces, and markings.
    The relay driver is by @valeklubomir and looks like this:
    https://github.com/openshwprojects/OpenBK7231...54742aa4a5/src/driver/drv_bridge_driver.c#L28
    Helpful post? Buy me a coffee.
  • #23 21179660
    przemsi_ele
    Level 11  
    >>21179251 .
    it's nice that it has started, I look forward to seeing some results :)
  • #24 21294856
    leśny_ziutek
    Level 12  
    Is anything known about this relay? Does it work?

    As far as I can see, this relay differs from the TONGOU TO-Q-SY1-JWT in that it has an adjustable overcurrent protection function (overcurrent) and the same for voltage (overvoltage). These two additional functions require a real-time response, so they are probably implemented by the TuyaMCU.

    This relay/fuse is interesting because of its dimensions, making it easy to replace a normal 'eska' in the switchgear with such a marvel if there is no space in the switchgear for another module (as long as the overcurrent function can be trusted).

    It is available under several brands:

    EARU EAKCB-T-M
    TOMZN TOB9S-VAP
    TONGOU TO-Q-SY2-JWT (here I am not sure if it is the same, but it differs from SY1 in its response to overcurrent and overvoltage)

Topic summary

The discussion centers on issues with the CBU module restarting when switching an Earu EAKCB-T-M 1 Din 63A bistable relay powered at 12V, unlike the original Tuya device which operated without resets. The relay is controlled by polarity pulses and lacks a visible protection diode, possibly relying on bridge hardware for coil impulse suppression. Power instability during relay switching is suspected as the cause of reboots, with suggestions to enable PowerSave mode (PowerSave 1) in OpenBeken firmware to mitigate power dips. Attempts to stabilize power with added capacitors (low ESR types) near the CBU power line showed no definitive improvement. The relay driver, developed by @valeklubomir, may require adjustment of pulse length (BridgePulseLength command) to improve behavior. Temperature sensing via an ADC channel (P23) connected to a voltage divider and thermistor was explored, with linear inverse correlation between ADC values and temperature confirmed through calibration against a DS18B20 sensor. Implementation of a lookup table for temperature calibration and event triggering was proposed. The Earu relay differs from the Tongou TO-Q-SV1-JWT and TO-Q-SY1-JWT models by including adjustable overcurrent and overvoltage protection functions, likely managed by a TuyaMCU. The Tongou relay showed better stability than the Earu in tests. Power supply quality and capacity, relay pulse timing, and hardware differences are key factors affecting CBU stability. Further hardware modifications, including replacing the CBU with an ESP8685-WROOM-06 module, were attempted but complicated by PCB damage. The relay's compact size and integrated protections make it a notable alternative to traditional fuses in switchgear, but its firmware and hardware integration require careful tuning to avoid resets.
Summary generated by the language model.
ADVERTISEMENT