Close
0%
0%

Raspberry Pi Smart Scale

A fun, easy project that combines a Wii balance board, a Raspberry Pi, and an online data analytics platform to create a web-connected scale

Public Chat
Similar projects worth following
Are you tired of staring at that boring, old, bearer of bad news bathroom scale every morning? The one that you often say "I hate you" to as if it might hear you and actually care. Why hasn't anyone made a scale that is actually fun or motivating to use? It is time to create a scale that is not only smart but has a bit more personality to brighten your day. We are going to build our very own hackable, weight tracking, text messaging bathroom scale that comes with a built-in sense of humor.

In this step-by-step tutorial, you will:

  • connect a Wii balance board to a Raspberry Pi through bluetooth
  • run a Python script that measures your weight when you step on the balance board
  • use a Raspberry Pi to stream your weight to a cloud service (Initial State)
  • setup a SMS notification every time you weigh yourself
  • build a weight-tracking dashboard you can access in your web browser

  • 1 × Raspberry Pi 3 with a SD card and Power Supply (https://init.st/psuufmj)
  • 1 × Wii Balance Board (https://init.st/qg4ynjl)
  • 1 × Wii Fit Rechargeable Battery Pack (https://init.st/iyypz2i)
  • 1 × 3/8" Felt Pads (https://init.st/8gywmjj)
  • 1 × A pencil An archaic writing utensil

  • 1
    Using the Wii Balance board

    Why a Wii Balance Board? It turns out that it is a really nice, durable scale that has bluetooth connectivity. This will allow us to connect it to a single-board computer (Raspberry Pi) to read your weight in a Python script and send those measurements to an online data service to do cool stuff. Plus, there is a good chance that you or someone you know already has one that is simply collecting dust.

    We will need to make a couple of simple modifications to our Wii Balance Board to really make this project practical and convenient.

    The Raspberry Pi 3 comes with bluetooth built in, all we need to communicate with the Wii Balance Board. If you have a Raspberry Pi 1 or 2, we will have to use one of our USB ports to plug in an adapter.

    Power on your Pi (I am assuming you have already installed Raspbian and it boots up) and go to your Raspberry Pi terminal window. You can see the address of your bluetooth dongle with the "hcitool dev" command:

    $ hcitool dev
    Devices:
    	hci0	00:1A:7D:DA:71:13
    

    Install the bluetooth modules that we will be using in our Python scripts:

    $ sudo apt-get install python-bluetooth 

    After installation completes, we are ready to connect and communicate with the Wii Balance Board. We will not be permanently pairing our Board with our Pi like we do with most of our bluetooth devices. The Wii Balance Board was never intended to be paired with anything other than a Wii, and permanent pairing proved to be quite the confusing challenge (if you find a solution for permanent pairing of the Wii Balance Board, please let me know). Pairing will happen every time we run our Python script.

  • 2
    Bluetooth Setup

    The Raspberry Pi 3 comes with bluetooth built in, all we need to communicate with the Wii Balance Board. If you have a Raspberry Pi 1 or 2, we will have to use one of our USB ports to plug in an adapter.

    Power on your Pi (I am assuming you have already installed Raspbian and it boots up) and go to your Raspberry Pi terminal window. You can see the address of your bluetooth dongle with the "hcitool dev" command:

    $ hcitool dev
    Devices:
    	hci0	00:1A:7D:DA:71:13
    

    Install the bluetooth modules that we will be using in our Python scripts:

    $ sudo apt-get install python-bluetooth 

    After installation completes, we are ready to connect and communicate with the Wii Balance Board. We will not be permanently pairing our Board with our Pi like we do with most of our bluetooth devices. The Wii Balance Board was never intended to be paired with anything other than a Wii, and permanent pairing proved to be quite the confusing challenge (if you find a solution for permanent pairing of the Wii Balance Board, please let me know). Pairing will happen every time we run our Python script.

  • 3
    Reading the Scale

    It is time to connect our Wii Balance Board to our Raspberry Pi. We will do this by modifying a version of Stavros Korokithakis' Gr8W8Upd8M8.py script. The python script we will be using for this step is located here. You can copy the contents of this file to a file you create on your Raspberry Pi or you can clone all of the python files we will be using for this entire project. Let's do the latter. Type the following commands into a terminal on your Raspberry Pi:

    $ cd ~
    $ git clone https://github.com/InitialState/smart-scale.git cloning into 'smart-scale'...
    remote: Counting objects: 14, done.
    remote: Compressing objects: 100% (12/12), done.
    remote: Total 14 (delta 1), reused 8 (delta 0), pack-reused 0
    Unpacking objects: 100% (14/14), done.
    Checking connectivity... done.
    

    You should see two python files in the new smart-scale directory - smartscale.py and wiiboard_test.py.

    $ cd smart-scale
    $ ls
    README.md		smartscale.py		wiiboard_test.py
    

    Run the wiiboard_test.py script to test communication and take weight readings from the Wii Balance Board:

    $ sudo python wiiboard_test.py
    

    You will see the following response:

    Discovering board...
    Press the red sync button on the board now
    

    Remove the battery cover underneath the Board to locate the red sync button. Make sure you press the button within a few seconds of running the script or a timeout will occur. Once successful, you will see something similar to the following:

    Found Wiiboard at address 00:23:CC:2E:E1:44
    Trying to connect...
    Connected to Wiiboard at address 00:23:CC:2E:E1:44
    Wiiboard connected
    ACK to data write received
    84.9185297 lbs
    84.8826412 lbs
    84.9275927 lbs
    

    The wiiboard_test.py script is taking the number of weight measurements specified on line 10 and outputting the average:

    # --------- User Settings ---------
    WEIGHT_SAMPLES = 500
    # ---------------------------------

    You can play with this number by changing the value and re-running the script to see the variation in weight measured and time required for each measurement. Weigh yourself, weigh your dog, weigh whatever and see if the measurements make sense. To stop the script, press CTRL+C.

    You have now successfully converted your Wii Balance Board into a Raspberry Pi connected scale. Now, let's make it a cool scale.

View all 9 instructions

Enjoy this project?

Share

Discussions

Mike Shaw wrote 07/30/2023 at 17:23 point

Just seeing this and was going to give it a try because it looks like an easier solution rather than trying to rig a RPi to a generic digital scale. Did anyone ever find a solution to the pairing dilemma?

  Are you sure? yes | no

Graham Toal wrote 01/08/2020 at 17:53 point

When I used a wii board as a bee hive scale, I avoided the need for permanently connecting to bluetooth by using a relay to simulate pressing the red button.  It worked very reliably.

  Are you sure? yes | no

Caoimhaoin wrote 07/12/2020 at 22:40 point

Very cool.  I will try that out.  I am just starting on creating a bee hive scale.  - I am using this project as a jumping off point:

https://makezine.com/projects/bees-sensors-monitor-hive-health/

I'd love to hear about your project if you'd care to share - if there are any tips about using the wii board and if you used any sensors within the hive.

Cheers,

Kevin

  Are you sure? yes | no

Graham Toal wrote 07/12/2020 at 23:13 point

The early version of our hive monitor is documented at https://www.instructables.com/id/The-Electric-Hive/ - the last version before I left that project also had multiple temperature sensors and a humidity/pressure sensor, and a microphone as well as the primary instrument which was the pi camera. I can give you the sensor code if you want it, email me at gtoal@gtoal.com  I used one of those hat-like solder boards to hook up the sensors and relay control etc - not quite as nice as a custom PCB but much better than just attaching wires directly to the GPIOs.  I especially liked the mic (one of those ones you stick to a guitar - interfaced through a cheap usb audio device) which was able to produce a signature of the bee hum activity.  It was all powered by PoE from about 100ft away. The pi fed power to the wii scale over a wire (4 wires - 2 for pwr/gnd and 2 for the relay which was housed with the pi) - no batteries needed. We did most of the data processing locally on the pi, and saved video/audio to a WD Pi Drive.  The weather is very hot here and every alternative storage that we had tried failed too frequently.  A bit of a surprise that a spinning disk drive would survive in an outdoor hive for a year, but it did.

  Are you sure? yes | no

Sophi Kravitz wrote 02/28/2019 at 12:10 point

The Wii as a scale is an excellent interface idea.. also affordable, eBay is littered with many under $20 ;)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates