1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-29 19:20:36 +02:00

Updated Home (markdown)

oliexdev
2014-12-19 07:33:14 -08:00
parent 72c9dbd4eb
commit d6f4cbc730

152
Home.md

@@ -116,6 +116,158 @@ Next step is to analyse the signals that are controlling the display. I had the
<sub><b>Figure 1.11: The 16 digital channels oscilloscope for analysing the signals</b></sub>
</p>
Because I couldnt connected all display connector pins to the oscilloscope I left pin 1 and pin 2 unconnected. So I had the following pin mapping:
| display pin | oscilliscope |
|:-----------:|:------------:|
| 3 | D0 |
| 4 | D1 |
| 5 | D2 |
| 6 | D3 |
| 7 | D4 |
| 8 | D5 |
| 9 | D6 |
| 10 | D7 |
| 11 | D8 |
| 12 | D9 |
| 13 | D10 |
| 14 | D11 |
| 15 | D12 |
| 16 | D13 |
| 17 | D14 |
| 18 | D15 |
The question for the reverse engineering process was how the signals will respond when a value of the display had changed? Could I find some logic behind the signal changes? As I turned on the scale the first observation was that not all pins are active and that four pins (D12-D15) had always the same repeating pattern, no matter which value was displaying. So these four pins must be the cycle pins for a serial communication. The second observation was if the first digit of the four digit scale was displaying a value D0 and D1 were active. If two digits are displaying some values then the signals D0-D3, for three digits D0-D5 and for four digits D0-D7 were active. The obvious conclusion was to display a digit on the scale a pair of two signals are used. In short I knew a command is four cycles long. I also knew that pin D0 and D1 are used for displaying the first digit. So the display controller uses 2x4 Bit = 8 Bit for representing a digit. If I can decode these 8 Bit word, I would be able decode the other signals too. The next step was to see the behaviour of the two signals D0 and D1 when different digits (0-9) are shown on the scales display. The best way to display each digit on the display was by pushing the up or down button of the scale to get into the selection mode of the scale. In this mode I was able to click through the values “P-01” to “P-09”. The correspondent recorded signals are shown in figure 1.12-1.20. Note that valid signals are near the right side of the signal diagram because on the left side old signals could be still visible.
<table border="0">
<tr>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P01.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P01.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.12: signals of value "P-01"</sub>
</th>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P02.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P02.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.13: signals of value "P-02"</sub>
</th>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P03.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P03.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.14: signals of value "P-03"</sub>
</th>
</tr>
<tr>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P04.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P04.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.15: signals of value "P-04"</sub>
</th>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P05.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P05.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.16: signals of value "P-05"</sub>
</th>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P06.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P06.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.17: signals of value "P-06"</sub>
</th>
</tr>
<tr>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P07.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P07.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.18: signals of value "P-07"</sub>
</th>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P08.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P08.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.19: signals of value "P-08"</sub>
</th>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P09.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_P09.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.20: signals of value "P-09"</sub>
</th>
</tr>
<tr>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_0_0kg.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_0_0kg.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.21: signals of value "0.0 kg"</sub>
</th>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_person.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_person.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.22: signals while displaying the person symbol, see signal on D8 and D9</sub>
</th>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_person_age.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/scope_person_age.png' width='250px' alt='image missing' /> </a> <br>
<sub>Figure 1.23: signals while displaying the person and age symbol, see signal D8 and D9</sub>
</th>
</tr>
</table>
For decoding the 8 Bit word I compared the recorded signals. I first chose two numbers that differs only in one segment of the seven segment display. For example the digit 5 and 6 differs only in segment g, see figure 1.24. If you compare the corresponded signals in figure 1.16 and 1.17 you will see that only one bit on pin D1 has changed. So I knew that the cycle no. 1 bit on pin D1 was for segment g of the seven segment display. Another example was the signal difference between digit 6 (figure 1.17) and 8 (figure 1.19). Only the cycle no. 3 bit on pin D0 has changed. Therefore this bit was responsible for turning segment b on or off. After I did this kind of comparison with all digits (its like playing Sudoku) I finally got the following decoding table:
<table>
<tr>
<th>
<a href="https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/seven_segement.png" target="_blank">
<img src='https://github.com/oliexdev/openScale/raw/master/doc/sanitas_sbf12/seven_segement.png' width='200px' alt='image missing' /> </a> <br>
<sub>Figure 1.24: seven segment display</sub>
</th>
<th>
<table>
<tr>
<th>Cycle No.<br></th>
<th>0<br></th>
<th>1<br></th>
<th>2</th>
<th>3</th>
</tr>
<tr>
<td>Signal B<br></td>
<td>d</td>
<td>g</td>
<td>x</td>
<td>a</td>
</tr>
<tr>
<td>Signal A<br></td>
<td>c</td>
<td>e</td>
<td>f</td>
<td>b</td>
</tr>
</table>
8-Bit word decoding table
</th>
</table>
## How its started ...
I gained a little weight a while ago, not overweighted, but I decided to do something about it. So I started my first diet. I bought a diet book in a book shop and followed it strictly about 2 weeks. At the beginning it was really tough, but in the end my diet worked out. I lost around 10kg (around 22lb). In that time I checked my weight every two or three days with my normal digital bathroom scale. That's helped me to stay motivated because I was happy to see that I gradually lost some weight. The disappointment was that my diet progress was not tracked in any way. Of course I could create a spreadsheet and wrote down my weight values but that would be troublesome and not seasonable in a world of smartphones and tablets.