Decoding unknown serial data from treadmill display board

Thread Starter

soham24

Joined May 28, 2024
4
I have been working on a treadmill project whereby my aim is to manually control the treadmill with an arduino without using the remote.

Info about the treadmill - The treadmill is just a normal Walking pad. It has a 2hp PMDC motor which is controlled by a MC2 V3.1 motor driver/controller(whatever you like to call it). The motor driver is connected to a display board which is a separate pcb which takes in IR signals from the remote of the treadmill.

I have not found any datasheet for the motor driver as well as the display board pcb. On the display board pcb, there are 4 pins which are connected directly to the motor driver. They are GND, VCC(10.8V), REV, SEND. After some investigations with multimeter and oscilloscope, the Rev is the recieved signal from the driver and Send is the signal sent by our display pcb. So I want to replicate this Send signal with my Arduino.

My issue - I have attached original and annotated images of the signal on the Send pin. It looks like a async serial data. I have checked with oscilloscope cursors and the smallest bit is 1.6ms wide. The slightly bigger one is 3.2ms and all of the high and low are either this 1.6ms bit or 3.2ms(2 bits). The signal I am getting on scope is inverted as I can see a small inverter on the pcb. So the start bit is 1 and stop bit is 0. Now as I start counting the bits I am not getting a consistent 8 bit data(in between the start and stop bits are either both zero or one). Even if I consider a 7 bit data then the next problem is when I increase the speed of the treadmill, the signal changes and the start and stop bits again are equal(which shouldn't be).

I can't afford a logic analyzer so I am manually trying to decode it. My scope doesn't have the decode feature. Please help me decode this signal.

20240611_140439.jpg

20240619_103305.jpg
 

MrChips

Joined Oct 2, 2009
31,195
This does not appear to be UART encoding to me. This looks like PWM, a short pulse (1.6ms) and a long pulse (3.2ms) with 1.6ms space.
 

Thread Starter

soham24

Joined May 28, 2024
4
This does not appear to be UART encoding to me. This looks like PWM, a short pulse (1.6ms) and a long pulse (3.2ms) with 1.6ms space.
How can I interpret this in code? If want to change the speed of the treadmill and I don't know which pulses are to be altered, I cannot write a code for it.
This here is another image (not inverted) of the signal at a different speed and it looks like a lot has changed.
20240619_133520.jpg
 
Last edited:

BobTPH

Joined Jun 5, 2013
9,335
Each short pulse is a zero, each long one a one. Or vice versa.

Each message appears to be 13 bits.

Just decode the binary value at different speeds and see if you see a pattern.

It might be LSB first or MSB first, so there are four possible interpretations. One of them should make sense, i.e. increasing value with increasing speed.
 

Thread Starter

soham24

Joined May 28, 2024
4
Each short pulse is a zero, each long one a one. Or vice versa.

Each message appears to be 13 bits.

Just decode the binary value at different speeds and see if you see a pattern.

It might be LSB first or MSB first, so there are four possible interpretations. One of them should make sense, i.e. increasing value with increasing speed.
But there are longer spaces between two short pulses and shorter spaces between long pulses. Is that possible?
 

Thread Starter

soham24

Joined May 28, 2024
4
Decoded Finally!
Let me explain it with a bunch of pictures so that everyone understands. Following are pictures of the signal on the scope and the red color annotation is the respective speed level of the treadmill for which the signal is recorded (sorry for the blur at the center of all images). 20240619_151756.jpg

20240619_152129.jpg

20240619_152603.jpg

20240619_154337.jpg

Now if I divide the signal at every rising edge then I get a constant 4.8ms period. Between any two rising edges, either there is a ```110``` (3.2ms high and then 1.6ms low) or ```100``` (1.6ms high and then 3.2ms low). If you compare the first three pictures then the only difference between them can be seen at the last four bits(considering one bit is the distance between two rising edges).
Now I am considering ```110``` as logical 1 and ```100``` as logical 0.

With this logic if we look for the last four bits in the first picture then the combination is 1011 which when converted in decimal yields 11. This directly corresponds to the level 1.1
Similarly in second picture, we have 1100 which is decimal 12 and the level is 1.2
Now in the fourth picture we have 10100 which is decimal 20 and the level is 2.0

I will write a code and try to send a signal through arduino using this logic.

The most recent answer from MrChips also looks convincing and I'll try using this logic as well.
Absolutely. You trigger on the leading edge and strobe the data after 2.4 ms
Finally, I would like to thank @MrChips and @BobTPH for giving their valuable time to this thread.
 
Last edited:

BobTPH

Joined Jun 5, 2013
9,335
Congrats on getting it decoded. But it is actually quite a bit simpler than that. Each rising edge starts a pulse. If the pulse is short, it represents a zero. If it is long, it represents a 1.

When you send code from the Arduino, be sure to replicate the 9 bits that do not change. It will not work if you don’t.
 
Top