Building smart WiFi enabled bathroom scale

2014-02-13 09:19 | Categories: In English, Projektai, Užrašai

wifi_scale_tThere are several wireless scales on the market but none of them implements functions I like (or overpriced). This scale logger is attempt to build wireless scale from existing components like Carambola 2 and USB IR Toy and, of course, scale with remote indicator. Implemented purely on Python this project enables gathering, sending and displaying weight data to any service you like or even build one yourself.

 

 

About

This is only framework and final solution is “to be done”. This project is based on Maxim 29-66SH bathroom scale. Data is captured from scale via USB IR Toy.v2 with no invasion to scale itself. Testing was done on regular PC and project can be easily copied to Carambola 2 (install python and couple of libraries, setup connectivity and you are ready to go).

Maxim 29-66SH

Maxim 29-66SH bathroom scale

2

Tools involved to make standalone wireless scale

Features I’d like to implement are:

  • Auto individual recognition
  • Data uploading to database for future analysis
  • Graphing
  • Weekly/Monthly analysis
  • Email/SMS reminder if individual has not weighted for several days
  • Means to set and seek goal

Protocol hints

logic

Waveforms from logic analyzer

 

bitstream                                weight status
0111111110000000011111111111111111111111          0    - Syncro (43 packets)
0101010111000000000000011101100011110000 94.5     0    - Measuring
0101010111000010000000011101100111110011 94.7     1    - Measuring
0101010111000110000000011101100111110111 94.7     3    - Weight is stable. Data valid.
.............ssddddddddddddddddddccccccc
  • Data range is [15:33] encoded as integer data in 100*grams
  • Status [13:15].
  • At the beginning it looks like packet synchro bits
  • At the end looks like 7 bit checksum

Code

Code is hosted on Github. There are several files in the project.

  • save_timing.py – reads raw values from USB IR Toy and saves to text file
  • analyze.py – analyses txt files saved earlier
  • ir_scale_utils.py – data conversion routines
  • weight.py – reads data from scale and presents value on the screen.
  • app.py – Python tornado server application
  • index.html – internal html file tornado serves. (replace websocket ip address inside)

In order to read weight data only few lines of code are necessary:

import ir_scale_utils

lines = ir_scale_utils.get_data_serial('COM43')

weight = ir_scale_utils.get_real_weight(lines)
print 'Your weight is: %3.1f kg' % weight

Demo video

  1. conor
    2014-02-25 22:53

    Hi, nice project – I was wondering if you could explain how you went about the decoding – is it a binary PWM signal? what did you use for a logic analyzer – hardware or software?
    thanks,

  2. Saulius Lukšė
    2014-02-28 07:43

    Hi Conor, it’s a binary even decimal encoded signal. Tools – own brain mostly :)

  3. gingin
    2015-02-16 21:28

    Labas Sauliau, reik paslaugos. Ar galetum suprogramint taip kad siustu svori per sms kas tam tikra laika. Ant svarstykliu uzdesim biciu avili, zinosim kada vaziot medaus. ;-) gintaras@balticlinen.lt

You must be logged in to post a comment.
TOP