Serial wired remote

Well, direct electric approach is surely doable, just some probing and testing and soldering. But if you need to keep the original hardware and added hardware happy together, the circuit has to be carefully verified.

On the other hand if you got strings 1…5 for your 5 buttons, chances that they just happen to be 1-5 on completely misread data is very low.
Ascii 1 is not A8, neither 2 is 26. They should be 31 and 32. in hex. Something is off here, but my experience with uart debugging is next to nothing.
Try with this:

debug:
    direction: RX
    timeout: 20ms 
    sequence:
      - lambda: |-
          for (auto b : bytes) {
            ESP_LOGI("uart", "0x%02X", b);
          }

You could try with baudrates 600/1200/2400 as well.

Thanks for the picture. The board seems to be well designed and built.

I can’t quite make out the markings on U6 in the middle left area. It is probably the voltage regulator. Can you advise please.

What is JP1 for? Does it have any plug connected to it when installed? On the other side of the PCB, do the pins go direct to the adjacent PIC chip? It may be a diagnostic port, used to program the chip initially during manufacture and for firmware updates, and test it in a jig when repairs are done.

Those marked Handler and Handler1 on the PCB?

U4 is a 7 channel driver chip ULN2003A. Do any of the pins go to the Handler or Handler1 connectors? This may be partly getting used as the TTL to serial bus converter.

You may also need to monitor R7 and R14, which seem to being used for current monitoring, probably to sense motor overload, or an actuator reaching their limit of travel.

Any chance of a picture of the other side of the PCB too?

Is the cable plugged into the white three pin power connector on the top left two or three wires?

What are the markings on the power supply to the unit? A picture would be sufficient.

Are the connectors standard DIN sockets commonly used for tape recorders in a previous era? A side shot would also be appreciated, or a shot of the plug end.

On the remote control, what pins do the TX and RX connect to on the connector on the cable? On the other end, do they connect to R6, R9, R43, and R45, or to
R10, R41, R42, and R44?

Maybe leave that ESP32 yaml code till later till we more fully nut out the circuit functionality and voltage levels? We’re assuming serial UART protocol, highly likely, but may possibly not be the case.

Certainly. So close. I would bank on getting the correct replication of the control signals rather than control the motor drivers.
If only you could connect my oscilloscope or logic probe for analysis…

ST 063AC GK310 DC to DC voltage management.

Nothing plugs into JP1. They are pins for the PIC chip. They trace back to the programming pins for that chip. If I had the correct device, I could extract a bin from it at this point. The only thing missing from that is the +5v.

Yes, Handler is the remote and Handler1 is the sync cable. I can plug the remote into either of these and it will control the bed.

4 of these pins go up under the relays. Nothing seems to go from it to the Handlers. I can confirm they go to the coil part of the relays.

Nice catch. I was going off the assumption the linear actuators had limit switches built into them like some of the others I have.

Actually I have a few images I just took of it.










This only has 2 wires and it is supplied with 29v DC. This is the output spec on the power supply and I verified it with a meter.

I think that would be the correct connector.

I will have to get back to you on this one.

I totally agree with keeping the hardware and trying to communicate with it.

I tried the code you posted. Here are the results. I tried with a few different baud rates and none of them produced results as good as 1200. The others had constant running F0, FE, or FF without pushing any buttons.

My experience with this is making a CNC machine communicate with a computer. That was a lot easier and a lot cleaner signal communication.

I do have a USB to TTL on the way. I am hoping for a cleaner signal with that. Currently I am using the ESP32 30 pin version with ESPHOME and running it through Home Assistant and WiFi.

This is 3 presses of button 1 with a short pause between.

[16:32:53.039][I][uart:065]: 0x10
[16:32:53.040][I][uart:065]: 0x31
[16:32:53.040][I][uart:065]: 0x11
[16:32:53.041][I][uart:065]: 0x31
[16:32:53.042][I][uart:065]: 0x11
[16:32:53.042][I][uart:065]: 0x31
[16:32:53.042][I][uart:065]: 0x11
[16:32:53.042][I][uart:065]: 0x31
[16:32:53.042][I][uart:065]: 0x11
[16:32:53.049][I][uart:065]: 0x31
[16:32:53.049][I][uart:065]: 0x11
[16:32:53.049][I][uart:065]: 0x31
[16:32:53.049][I][uart:065]: 0x11
[16:32:53.049][I][uart:065]: 0x31
[16:32:53.049][I][uart:065]: 0x11
[16:32:53.061][I][uart:065]: 0x31
[16:32:53.061][I][uart:065]: 0x11
[16:32:53.061][I][uart:065]: 0x31
[16:32:53.061][I][uart:065]: 0x11
[16:32:53.061][I][uart:065]: 0x31
[16:32:53.061][I][uart:065]: 0x11
[16:32:53.065][I][uart:065]: 0x31
[16:32:53.065][I][uart:065]: 0x11
[16:32:53.065][I][uart:065]: 0x31
[16:32:53.065][I][uart:065]: 0x11
[16:32:53.065][I][uart:065]: 0x31
[16:32:53.065][I][uart:065]: 0x11
[16:32:53.065][I][uart:065]: 0x31
[16:32:53.065][I][uart:065]: 0x11
[16:32:53.065][I][uart:065]: 0x80
[16:32:53.069][I][uart:065]: 0x00
[16:33:04.762][I][uart:065]: 0x10
[16:33:04.762][I][uart:065]: 0x31
[16:33:04.763][I][uart:065]: 0x11
[16:33:04.764][I][uart:065]: 0x31
[16:33:04.764][I][uart:065]: 0x11
[16:33:04.766][I][uart:065]: 0x31
[16:33:04.766][I][uart:065]: 0x11
[16:33:04.766][I][uart:065]: 0x31
[16:33:04.769][I][uart:065]: 0x11
[16:33:04.769][I][uart:065]: 0x31
[16:33:04.769][I][uart:065]: 0x11
[16:33:04.771][I][uart:065]: 0x31
[16:33:04.771][I][uart:065]: 0x11
[16:33:04.771][I][uart:065]: 0x31
[16:33:04.773][I][uart:065]: 0x11
[16:33:04.773][I][uart:065]: 0x31
[16:33:04.774][I][uart:065]: 0x11
[16:33:04.776][I][uart:065]: 0x31
[16:33:04.776][I][uart:065]: 0x11
[16:33:04.776][I][uart:065]: 0x31
[16:33:04.779][I][uart:065]: 0x11
[16:33:04.779][I][uart:065]: 0x31
[16:33:04.779][I][uart:065]: 0x11
[16:33:04.781][I][uart:065]: 0x31
[16:33:04.781][I][uart:065]: 0x11
[16:33:04.782][I][uart:065]: 0x31
[16:33:04.785][I][uart:065]: 0x11
[16:33:04.785][I][uart:065]: 0x31
[16:33:04.786][I][uart:065]: 0x11
[16:33:04.788][I][uart:065]: 0x31
[16:33:11.705][I][uart:065]: 0x31
[16:33:11.705][I][uart:065]: 0x31
[16:33:11.712][I][uart:065]: 0x31
[16:33:11.712][I][uart:065]: 0x31
[16:33:11.712][I][uart:065]: 0x31
[16:33:11.712][I][uart:065]: 0x31
[16:33:11.713][I][uart:065]: 0x31
[16:33:11.713][I][uart:065]: 0x31
[16:33:11.713][I][uart:065]: 0x31
[16:33:11.713][I][uart:065]: 0x31
[16:33:11.713][I][uart:065]: 0x31
[16:33:11.713][I][uart:065]: 0x31
[16:33:11.713][I][uart:065]: 0x31
[16:33:11.713][I][uart:065]: 0x31
[16:33:11.715][I][uart:065]: 0x31
[16:33:11.717][I][uart:065]: 0x31
[16:33:11.717][I][uart:065]: 0x31
[16:33:11.721][I][uart:065]: 0x31
[16:33:11.721][I][uart:065]: 0x31
[16:33:11.721][I][uart:065]: 0x31
[16:33:11.724][I][uart:065]: 0x31
[16:33:11.724][I][uart:065]: 0x31
[16:33:11.724][I][uart:065]: 0x31
[16:33:11.727][I][uart:065]: 0x31
[16:33:11.728][I][uart:065]: 0x31
[16:33:11.728][I][uart:065]: 0x31
[16:33:11.731][I][uart:065]: 0x31
[16:33:11.731][I][uart:065]: 0x31
[16:33:11.732][I][uart:065]: 0x31
[16:33:11.734][I][uart:065]: 0x31
[16:33:11.736][I][uart:065]: 0x31
[16:33:11.736][I][uart:065]: 0x31
[16:33:11.740][I][uart:065]: 0x31
[16:33:11.741][I][uart:065]: 0x00

This is 3 presses of button 2 with a short pause between.
[16:33:19.061][I][uart:065]: 0x32
[16:33:19.070][I][uart:065]: 0x32
[16:33:19.070][I][uart:065]: 0x32
[16:33:19.070][I][uart:065]: 0x32
[16:33:19.070][I][uart:065]: 0x32
[16:33:19.070][I][uart:065]: 0x32
[16:33:19.070][I][uart:065]: 0x32
[16:33:19.070][I][uart:065]: 0x32
[16:33:19.070][I][uart:065]: 0x32
[16:33:19.070][I][uart:065]: 0x32
[16:33:19.071][I][uart:065]: 0x12
[16:33:19.071][I][uart:065]: 0x32
[16:33:19.071][I][uart:065]: 0x12
[16:33:19.073][I][uart:065]: 0x32
[16:33:19.074][I][uart:065]: 0x12
[16:33:19.074][I][uart:065]: 0x32
[16:33:19.077][I][uart:065]: 0x12
[16:33:19.077][I][uart:065]: 0x32
[16:33:19.077][I][uart:065]: 0x12
[16:33:19.080][I][uart:065]: 0x32
[16:33:19.080][I][uart:065]: 0x12
[16:33:19.080][I][uart:065]: 0x32
[16:33:19.081][I][uart:065]: 0x12
[16:33:19.081][I][uart:065]: 0x32
[16:33:19.081][I][uart:065]: 0x12
[16:33:19.084][I][uart:065]: 0x32
[16:33:19.084][I][uart:065]: 0x12
[16:33:19.084][I][uart:065]: 0x32
[16:33:23.102][I][uart:065]: 0x26
[16:33:23.105][I][uart:065]: 0x26
[16:33:23.105][I][uart:065]: 0x26
[16:33:23.105][I][uart:065]: 0x26
[16:33:23.106][I][uart:065]: 0x26
[16:33:23.106][I][uart:065]: 0x26
[16:33:23.108][I][uart:065]: 0x26
[16:33:23.108][I][uart:065]: 0x26
[16:33:23.108][I][uart:065]: 0x26
[16:33:23.109][I][uart:065]: 0x26
[16:33:23.109][I][uart:065]: 0x26
[16:33:23.109][I][uart:065]: 0x26
[16:33:23.113][I][uart:065]: 0x26
[16:33:23.113][I][uart:065]: 0x26
[16:33:23.113][I][uart:065]: 0x26
[16:33:23.116][I][uart:065]: 0x26
[16:33:23.116][I][uart:065]: 0x26
[16:33:23.116][I][uart:065]: 0x26
[16:33:23.119][I][uart:065]: 0x26
[16:33:23.119][I][uart:065]: 0x26
[16:33:23.119][I][uart:065]: 0x26
[16:33:23.122][I][uart:065]: 0x26
[16:33:23.122][I][uart:065]: 0x26
[16:33:23.123][I][uart:065]: 0x26
[16:33:23.123][I][uart:065]: 0x26
[16:33:23.123][I][uart:065]: 0xE6
[16:33:23.123][I][uart:065]: 0x00
[16:33:26.779][I][uart:065]: 0x12
[16:33:26.785][I][uart:065]: 0x32
[16:33:26.785][I][uart:065]: 0x12
[16:33:26.785][I][uart:065]: 0x32
[16:33:26.785][I][uart:065]: 0x12
[16:33:26.785][I][uart:065]: 0x32
[16:33:26.787][I][uart:065]: 0x12
[16:33:26.787][I][uart:065]: 0x32
[16:33:26.787][I][uart:065]: 0x12
[16:33:26.791][I][uart:065]: 0x32
[16:33:26.791][I][uart:065]: 0x12
[16:33:26.791][I][uart:065]: 0x32
[16:33:26.793][I][uart:065]: 0x12
[16:33:26.793][I][uart:065]: 0x32
[16:33:26.793][I][uart:065]: 0x12
[16:33:26.796][I][uart:065]: 0x32
[16:33:26.796][I][uart:065]: 0x12
[16:33:26.796][I][uart:065]: 0x32
[16:33:26.799][I][uart:065]: 0x12
[16:33:26.799][I][uart:065]: 0x32
[16:33:26.799][I][uart:065]: 0x12
[16:33:26.802][I][uart:065]: 0x32
[16:33:26.802][I][uart:065]: 0x12
[16:33:26.802][I][uart:065]: 0x32
[16:33:26.802][I][uart:065]: 0x12
[16:33:26.802][I][uart:065]: 0x32
[16:33:26.802][I][uart:065]: 0x12
[16:33:26.806][I][uart:065]: 0x32
[16:33:26.807][I][uart:065]: 0x12
[16:33:26.807][I][uart:065]: 0x32
[16:33:26.809][I][uart:065]: 0x12
[16:33:26.809][I][uart:065]: 0x32
[16:33:26.810][I][uart:065]: 0x12
[16:33:26.813][I][uart:065]: 0x32
This is 3 presses of button 3 with a short pause between.

[16:33:33.837][I][uart:065]: 0x00
[16:33:33.837][I][uart:065]: 0x9A
[16:33:33.837][I][uart:065]: 0x8A
[16:33:33.837][I][uart:065]: 0x9A
[16:33:33.837][I][uart:065]: 0x8A
[16:33:33.839][I][uart:065]: 0x9A
[16:33:33.839][I][uart:065]: 0x8A
[16:33:33.840][I][uart:065]: 0x9A
[16:33:33.840][I][uart:065]: 0x8A
[16:33:33.840][I][uart:065]: 0x9A
[16:33:33.840][I][uart:065]: 0x8A
[16:33:33.841][I][uart:065]: 0x9A
[16:33:33.841][I][uart:065]: 0x8A
[16:33:33.841][I][uart:065]: 0x9A
[16:33:33.844][I][uart:065]: 0x8A
[16:33:33.846][I][uart:065]: 0x9A
[16:33:33.846][I][uart:065]: 0x8A
[16:33:33.851][I][uart:065]: 0x9A
[16:33:33.851][I][uart:065]: 0x8A
[16:33:33.851][I][uart:065]: 0x9A
[16:33:33.852][I][uart:065]: 0x9A
[16:33:33.852][I][uart:065]: 0x9A
[16:33:33.852][I][uart:065]: 0x9A
[16:33:33.854][I][uart:065]: 0x9A
[16:33:33.856][I][uart:065]: 0x9A
[16:33:33.856][I][uart:065]: 0x9A
[16:33:33.859][I][uart:065]: 0x9A
[16:33:33.859][I][uart:065]: 0x9A
[16:33:33.859][I][uart:065]: 0x9A
[16:33:33.864][I][uart:065]: 0xFE
[16:33:33.864][I][uart:065]: 0x00
[16:33:38.011][I][uart:065]: 0x9A
[16:33:38.012][I][uart:065]: 0x8A
[16:33:38.012][I][uart:065]: 0x9A
[16:33:38.012][I][uart:065]: 0x8A
[16:33:38.012][I][uart:065]: 0x9A
[16:33:38.012][I][uart:065]: 0x8A
[16:33:38.012][I][uart:065]: 0x9A
[16:33:38.012][I][uart:065]: 0x8A
[16:33:38.012][I][uart:065]: 0x9A
[16:33:38.012][I][uart:065]: 0x8A
[16:33:38.012][I][uart:065]: 0x9A
[16:33:38.012][I][uart:065]: 0x8A
[16:33:38.013][I][uart:065]: 0x9A
[16:33:38.015][I][uart:065]: 0x8A
[16:33:38.015][I][uart:065]: 0x9A
[16:33:38.015][I][uart:065]: 0x8A
[16:33:38.019][I][uart:065]: 0x9A
[16:33:38.019][I][uart:065]: 0x8A
[16:33:38.019][I][uart:065]: 0x9A
[16:33:38.022][I][uart:065]: 0x8A
[16:33:38.022][I][uart:065]: 0x9A
[16:33:38.022][I][uart:065]: 0x8A
[16:33:38.024][I][uart:065]: 0x9A
[16:33:38.024][I][uart:065]: 0x8A
[16:33:38.025][I][uart:065]: 0x9A
[16:33:38.026][I][uart:065]: 0x8A
[16:33:38.026][I][uart:065]: 0x9A
[16:33:38.026][I][uart:065]: 0x8A
[16:33:38.031][I][uart:065]: 0xFE
[16:33:38.031][I][uart:065]: 0x00
[16:33:41.331][I][uart:065]: 0x31
[16:33:41.331][I][uart:065]: 0x33
[16:33:41.331][I][uart:065]: 0x31
[16:33:41.338][I][uart:065]: 0x33
[16:33:41.338][I][uart:065]: 0x31
[16:33:41.338][I][uart:065]: 0x33
[16:33:41.338][I][uart:065]: 0x31
[16:33:41.338][I][uart:065]: 0x33
[16:33:41.338][I][uart:065]: 0x31
[16:33:41.338][I][uart:065]: 0x33
[16:33:41.338][I][uart:065]: 0x31
[16:33:41.338][I][uart:065]: 0x33
[16:33:41.340][I][uart:065]: 0x31
[16:33:41.341][I][uart:065]: 0x33
[16:33:41.341][I][uart:065]: 0x31
[16:33:41.341][I][uart:065]: 0x33
[16:33:41.341][I][uart:065]: 0x31
[16:33:41.341][I][uart:065]: 0x33
[16:33:41.345][I][uart:065]: 0x31
[16:33:41.345][I][uart:065]: 0x33
[16:33:41.345][I][uart:065]: 0x31
[16:33:41.348][I][uart:065]: 0x33
[16:33:41.348][I][uart:065]: 0x31
[16:33:41.348][I][uart:065]: 0x33
[16:33:41.401][I][uart:065]: 0x31
[16:33:41.401][I][uart:065]: 0x33
This is 3 presses of button 4 with a short pause between.

[16:33:44.630][I][uart:065]: 0x14
[16:33:44.630][I][uart:065]: 0x34
[16:33:44.630][I][uart:065]: 0x14
[16:33:44.630][I][uart:065]: 0x34
[16:33:44.632][I][uart:065]: 0x14
[16:33:44.632][I][uart:065]: 0x34
[16:33:44.632][I][uart:065]: 0x14
[16:33:44.635][I][uart:065]: 0x34
[16:33:44.635][I][uart:065]: 0x14
[16:33:44.635][I][uart:065]: 0x34
[16:33:44.635][I][uart:065]: 0x14
[16:33:44.635][I][uart:065]: 0x34
[16:33:44.635][I][uart:065]: 0x14
[16:33:44.637][I][uart:065]: 0x34
[16:33:44.637][I][uart:065]: 0x14
[16:33:44.637][I][uart:065]: 0x34
[16:33:44.641][I][uart:065]: 0x14
[16:33:44.642][I][uart:065]: 0x34
[16:33:44.642][I][uart:065]: 0x14
[16:33:44.649][I][uart:065]: 0x34
[16:33:44.649][I][uart:065]: 0x14
[16:33:44.649][I][uart:065]: 0x34
[16:33:44.649][I][uart:065]: 0x14
[16:33:44.649][I][uart:065]: 0x34
[16:33:44.649][I][uart:065]: 0x14
[16:33:44.649][I][uart:065]: 0x34
[16:33:44.649][I][uart:065]: 0x14
[16:33:44.649][I][uart:065]: 0x34
[16:33:44.649][I][uart:065]: 0x14
[16:33:44.649][I][uart:065]: 0x34
[16:33:44.649][I][uart:065]: 0x14
[16:33:44.651][I][uart:065]: 0x34
[16:33:44.651][I][uart:065]: 0x14
[16:33:44.651][I][uart:065]: 0x34
[16:33:44.655][I][uart:065]: 0x14
[16:33:44.655][I][uart:065]: 0x34
[16:33:44.655][I][uart:065]: 0x14
[16:33:44.660][I][uart:065]: 0x34
[16:33:47.505][I][uart:065]: 0x13
[16:33:47.505][I][uart:065]: 0x13
[16:33:47.505][I][uart:065]: 0x13
[16:33:47.505][I][uart:065]: 0x13
[16:33:47.505][I][uart:065]: 0x13
[16:33:47.506][I][uart:065]: 0x13
[16:33:47.507][I][uart:065]: 0x13
[16:33:47.507][I][uart:065]: 0x13
[16:33:47.509][I][uart:065]: 0x13
[16:33:47.509][I][uart:065]: 0x13
[16:33:47.509][I][uart:065]: 0x13
[16:33:47.513][I][uart:065]: 0x13
[16:33:47.513][I][uart:065]: 0x13
[16:33:47.513][I][uart:065]: 0x13
[16:33:47.516][I][uart:065]: 0x13
[16:33:47.516][I][uart:065]: 0x13
[16:33:47.516][I][uart:065]: 0x13
[16:33:47.520][I][uart:065]: 0x13
[16:33:47.520][I][uart:065]: 0x13
[16:33:47.520][I][uart:065]: 0x13
[16:33:47.520][I][uart:065]: 0x13
[16:33:47.520][I][uart:065]: 0x13
[16:33:47.520][I][uart:065]: 0x13
[16:33:47.522][I][uart:065]: 0x13
[16:33:47.522][I][uart:065]: 0x13
[16:33:47.522][I][uart:065]: 0x13
[16:33:47.526][I][uart:065]: 0x13
[16:33:47.526][I][uart:065]: 0x13
[16:33:47.534][I][uart:065]: 0x13
[16:33:47.535][I][uart:065]: 0xF3
[16:33:47.535][I][uart:065]: 0x00
[16:33:47.535][I][uart:065]: 0x00
[16:33:49.822][I][uart:065]: 0x13
[16:33:49.825][I][uart:065]: 0x13
[16:33:49.826][I][uart:065]: 0x13
[16:33:49.826][I][uart:065]: 0x13
[16:33:49.826][I][uart:065]: 0x13
[16:33:49.826][I][uart:065]: 0x13
[16:33:49.826][I][uart:065]: 0x13
[16:33:49.826][I][uart:065]: 0x13
[16:33:49.826][I][uart:065]: 0x13
[16:33:49.839][I][uart:065]: 0x13
[16:33:49.839][I][uart:065]: 0x13
[16:33:49.839][I][uart:065]: 0x13
[16:33:49.839][I][uart:065]: 0x13
[16:33:49.839][I][uart:065]: 0x13
[16:33:49.839][I][uart:065]: 0x13
[16:33:49.839][I][uart:065]: 0x13
[16:33:49.839][I][uart:065]: 0x13
[16:33:49.839][I][uart:065]: 0x13
[16:33:49.844][I][uart:065]: 0x13
[16:33:49.844][I][uart:065]: 0x13
[16:33:49.845][I][uart:065]: 0x13
[16:33:49.845][I][uart:065]: 0x13
[16:33:49.845][I][uart:065]: 0x13
[16:33:49.845][I][uart:065]: 0x13
[16:33:49.845][I][uart:065]: 0x13
[16:33:49.845][I][uart:065]: 0x13
[16:33:49.845][I][uart:065]: 0x13
[16:33:49.849][I][uart:065]: 0xF3
[16:33:49.850][I][uart:065]: 0x00

This is 3 presses of button 5 with a short pause between.

[16:33:53.606][I][uart:065]: 0x35
[16:33:53.607][I][uart:065]: 0x15
[16:33:53.607][I][uart:065]: 0x35
[16:33:53.607][I][uart:065]: 0x15
[16:33:53.609][I][uart:065]: 0x35
[16:33:53.609][I][uart:065]: 0x15
[16:33:53.609][I][uart:065]: 0x35
[16:33:53.612][I][uart:065]: 0x15
[16:33:53.612][I][uart:065]: 0x35
[16:33:53.612][I][uart:065]: 0x15
[16:33:53.614][I][uart:065]: 0x35
[16:33:53.616][I][uart:065]: 0x15
[16:33:53.616][I][uart:065]: 0x35
[16:33:53.618][I][uart:065]: 0x15
[16:33:53.618][I][uart:065]: 0x35
[16:33:53.620][I][uart:065]: 0x15
[16:33:53.622][I][uart:065]: 0x35
[16:33:53.624][I][uart:065]: 0x15
[16:33:53.624][I][uart:065]: 0x35
[16:33:53.627][I][uart:065]: 0x15
[16:33:53.627][I][uart:065]: 0x35
[16:33:53.627][I][uart:065]: 0x15
[16:33:53.630][I][uart:065]: 0x35
[16:33:53.630][I][uart:065]: 0x15
[16:33:53.630][I][uart:065]: 0x35
[16:33:53.632][I][uart:065]: 0x15
[16:33:53.633][I][uart:065]: 0x35
[16:33:53.633][I][uart:065]: 0x15
[16:33:53.637][I][uart:065]: 0x35
[16:33:55.978][I][uart:065]: 0x35
[16:33:55.978][I][uart:065]: 0x15
[16:33:55.980][I][uart:065]: 0x35
[16:33:55.980][I][uart:065]: 0x15
[16:33:55.980][I][uart:065]: 0x35
[16:33:55.982][I][uart:065]: 0x15
[16:33:55.984][I][uart:065]: 0x35
[16:33:55.984][I][uart:065]: 0x15
[16:33:55.987][I][uart:065]: 0x35
[16:33:55.988][I][uart:065]: 0x15
[16:33:55.988][I][uart:065]: 0x35
[16:33:55.990][I][uart:065]: 0x15
[16:33:55.992][I][uart:065]: 0x35
[16:33:55.992][I][uart:065]: 0x15
[16:33:55.994][I][uart:065]: 0x35
[16:33:55.996][I][uart:065]: 0x15
[16:33:55.996][I][uart:065]: 0x35
[16:33:56.000][I][uart:065]: 0x15
[16:33:56.000][I][uart:065]: 0x35
[16:33:56.000][I][uart:065]: 0x15
[16:33:56.003][I][uart:065]: 0x35
[16:33:56.003][I][uart:065]: 0x15
[16:33:56.003][I][uart:065]: 0x35
[16:33:56.007][I][uart:065]: 0x15
[16:33:56.007][I][uart:065]: 0x35
[16:33:56.007][I][uart:065]: 0x15
[16:33:56.007][I][uart:065]: 0x35
[16:33:56.007][I][uart:065]: 0x15
[16:33:56.008][I][uart:065]: 0x35
[16:33:56.011][I][uart:065]: 0x15
[16:33:56.013][I][uart:065]: 0x00
[16:33:56.013][I][uart:065]: 0x00
[16:33:58.754][I][uart:065]: 0x35
[16:33:58.754][I][uart:065]: 0x35
[16:33:58.754][I][uart:065]: 0x35
[16:33:58.756][I][uart:065]: 0x35
[16:33:58.756][I][uart:065]: 0x35
[16:33:58.756][I][uart:065]: 0x35
[16:33:58.760][I][uart:065]: 0x35
[16:33:58.760][I][uart:065]: 0x35
[16:33:58.760][I][uart:065]: 0x35
[16:33:58.761][I][uart:065]: 0x35
[16:33:58.761][I][uart:065]: 0x35
[16:33:58.762][I][uart:065]: 0x35
[16:33:58.764][I][uart:065]: 0x35
[16:33:58.764][I][uart:065]: 0x35
[16:33:58.765][I][uart:065]: 0x35
[16:33:58.768][I][uart:065]: 0x35
[16:33:58.768][I][uart:065]: 0x35
[16:33:58.768][I][uart:065]: 0x35
[16:33:58.770][I][uart:065]: 0x35
[16:33:58.771][I][uart:065]: 0x35
[16:33:58.771][I][uart:065]: 0x35
[16:33:58.775][I][uart:065]: 0x35
[16:33:58.775][I][uart:065]: 0x35
[16:33:58.775][I][uart:065]: 0x35
[16:33:58.779][I][uart:065]: 0x00

Try with:

data_bits: 8
parity: EVEN
stop_bits: 1

I was looking for a jumper cable and actually found an old USB to TTL device. I hooked it up with the jumper set to 5v and opened putty to see what info I could log on button presses.

Baud 1200
Data bits 8
Stop bits 1
Parity None
Flow Control None

logged:
11111111111111111111111111111
2222222222222222222222222
3333333333333333333333333
4444444444444444444444444
5555555555555555555555555

All of them were clean.

I tried to send each number and no response from the control. To be fair, I really haven’t researched how to send the data. That’s my next topic to research.

That sounds like voltage missmatch or bad wiring (on esphome approach) to me.
Are your wire connections rock solid?

To send the code you can try:

button:
  - platform: template
    name: "Bed Button 1"
    on_press:
      - lambda: |-
          for (int i = 0; i < 10; i++) {
            id(bed_uart).write(0x31);  // ASCII '1'
            delay(8);                  // ~1 byte time at 1200 baud
          }
1 Like

Ok, the protocol issue seems to be solved - so basic! ASCII, Serial 1200,8,1,N. Just need to discover the voltage levels to drive everything, hopefully transparently so that there is no need to modify the remote or main board.

Tracing the connection from the remote, both TX and RX, through to the main board, what resistors and semiconductors it passes through till it gets to the PIC should be the final part of getting this reverse engineering process solved.

We’ve excluded the ULN2003A driver chip from the control chain from the remote, so the bridging of the two resistors on the remote going to the TX and RX pins become important.

Can we have a peek on the other side of the remote board if possible, especially for any semiconductors?

The power supply regulator, the MC34063AC, seems to support around 1 amp or so, so should be able to supply enough current to power an external addon ESP32 as well as the low voltage component needs of the controller board. This is supported by the decision to provide an external USB charging port on the end of the remote board - there’s obviously power to spare. The ESP32 will only need half an amp or so maximum, and will be in idle mode most of the time.

I envisage your final result will be a small box plugged into the spare Handler port using a suitable plug, powered by the USB 5v pins, containing a ESP32 and a transistor and a few resistors for voltage level matching and driving the TX and RX pins. Whether you go with ESPHome or Tasmota for the software side of the controls, going direct or via MQTT, will be another step.

Interesting use of PCB tracks on the rear for what appears to be heatsinking for higher current semiconductors and resistors. Obviously not a first generation version of the circuit board…

Basic question: When you press 1,2,3,4 or 5 via the remote buttons, and also using your temporary UART interface, does the controller board LEDs flash adjacent to the 5pin DIN actuator connectors?

Do the numbers transmitted continue after the respective remote button is released? Did you observe a minimum number of transmissions issued? What happens when you press two buttons at the same time? Does it add the values, intersperse them and send both, or what?

What is the voltage at the power pins for both PICs? 5v? For both remote and main boards?

I will give an update to what I’ve done and then get to answering your questions.

I soldered wires to the RX, TX, 5V, and ground of the main board on the back side of “Handler” to coincide with the remote wires. These go to my logic converter 5v to 3.3v.
I connected the logic converter to my usb to ttl device with the jumper set to 3.3v. I can push the buttons on the remote and get the 1,2,3,4, and 5 responses. I get a string of each depending on how long the button is pressed.

From this I can prove the logic converter is connected correctly and I can read the stream from the remote to the control at a 3.3v level. However I can not write.

I tried to write using just putty. I realized I was still connected to read what the remote output so I swapped the RX and TX wires to try to write. No response. I pressed a button on the remote to see if anything happened. The control sent a bunch of blanks while it was receiving the ascii from the remote. Once the button was released, I get a response from the control of “1+!” and “~1+!” or something like that. I didn’t write it down.

I am wondering if this is some type of two way communication.

I then tested the ESP32 with the usb to ttl device. If I press the button it gives me the 1111111111… output. I can tell my ESP32 is outputting what I expect it to.

I did notice when I plugged the remote into the control, the control rebooted. Then the remote sent “REST” to the control.

TX from the remote goes to R43 “33R0” on the control to pin12 of the PIC chip.
RX from the remote goes to R45 “33R0” on the control to pin10 of the PIC chip.

TX on the remote goes to R2 “1002” then bridges to R3 “1002”. TX also connects to pin10 of the PIC chip.
RX on the remote goes to R3 “1002” then bridges to R2 “1002”. RX also connects to pin12 of the PIC chip.

Both then lead to D4 “light emitting diode” on the opposite side which backlights a button.


The LED next to the actuator connector lights red when that one is being moved.

The numbers stop as soon as you let off of the button. There doesn’t seem to be a min or max amount of numbers output. No pattern of numbers grouped together. I havent tried 2 buttons at the same time. I’ll get back to you on that one.

Both of these are 5V.

I’ve done more research on this. I tried to read the PIC chip and found out they are both locked.

I messed with reading the data and inserting it with no luck. I thought I must be missing something. I found out I could use my USB to TTL device to interface with PulseView. The image below is the first try output when the #1 button is pressed. It repeats this pattern over and over. I only got “sa” as a time on it, so I need to go back and redo it.

This is probably just hex for “0x31” over and over.

Looks correct for 8N1.
0 1 0 0 0 1 1 0 0 1
where 0 is start, 10001100 is LSB 0x31 and stop 1.

- uart.write:
    id: my_uart
    data: [0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31]

Success… Probably a long time ago.

Just to check everything, I started at each component testing logic. The esp32 I was using wasn’t giving me expected output. I probably applied straight 5v UART to it at some point. I swapped it out with one I had never used. Tested the TX output and the results were perfect.

I connected it to the LV side of my logic level converter and tested the HV side. I got random output from it. I removed it and put a new one in its place. I tested it and the output was perfect.

Then I connected it to the bed control where the remote connects to it. I powered it all up and it worked as expected.

Here is the code I used to test it. Integrating it with home assistant is going to be a piece of cake after all this.

esphome:
  name: standalone-esp32

esp32:
  board: esp32doit-devkit-v1
  framework:
      type: esp-idf

# Enable logger
logger:

uart:
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 1200
  data_bits: 8
  parity: NONE
  stop_bits: 1
  debug: 
    direction: BOTH
    dummy_receiver: True

interval:
  # This specifies the interval: run every 10 seconds
  - interval: 10s
    then:
      - logger.log: "This message logs every 10 seconds."

      - uart.write:
          # Data to send: "1111"
          data: "1111" #[0x31, 0x31, 0x31, 0x31]
 

Thank both of you for all the help! It is much appreciated.

Fantastic! Glad you were persistent and went with your instincts rather than abandoned the project when faced with strange unexpected results. We often hope 5v accidentally applied to 3.3v ports doesn’t cook the device, but you have shown it is not always the case.

Reverse engineering is rewarding when you crack it. In this case it also highlights that your bed manufacturer has built a very simple but robust control system you can trust to give you many more years of reliable service with enhanced functionality and home automation extensions.

Thanks for posting the detailed photos and doing the detailed debugging to understand how it all was put together originally.

You should be able to power the ESP32 (or even a cheaper ESP8266) from the bed controller power supply and make a simple box with a dangling connector to plug in to the spare port for a neat and complete solution. Add a transistor and dropping resistor to the TX pin for voltage translation, and the final part count should make it a worthwhile project for others to follow.

For thread completeness, could you alter the title of the thread to say “Serial remote control for hospital bed” or similar, and post your final code for anybody searching for an easy way to control their similar scenario, standing on the shoulder of giants like yourself.

Choice of ESP32s and ESPHome also gives you the potential to control this using BlueTooth, BLE, WiFi, ZigBee, Thread/Matter, direct or via MQTT, and hence make it a flexible solution to integrate easily into other automations.

1 Like