Are you tired of staring at that boring, old, bad news scale every morning?
The one you often say "I hate you" to you, just like every time you step on it.
Why does no one make a scale that is really interesting or motivating to use?
It's time to create a scale that is not only smart but also more personal to brighten your day.
We will build our own hack, weight tracking, SMS bathroom scale with a built-in-
Have a sense of humor.
This is an interesting and simple project to create a web-by combining the Wii Balance Board, Raspberry Pi and the online data analytics platform-
You can hack the scale of connections controlled by Python scripts.
Project level: start about completion time: 20 minutes interesting factor: not measurable in this step-by-
Step tutorial, you will: Here is a list of all the devices we will use in this tutorial with links to each item that can be purchased.
Note: You need a Bluetooth adapter if you have a Raspberry Pi 1 or 2 (
Wii balance board?
It turns out to be a very good, durable scale with a Bluetooth connection.
This will allow us to connect it toTablet computer (Raspberry Pi)
Read your weight in a Python script and send these measurements to the online data service to do something cool.
Also, there is a good chance that you or someone you know already has a simple opportunity to collect dust.
We need to make some simple changes to the Wii Balance Board to really make this project practical and convenient.
The Raspberry Pi 3 has Bluetooth built in and we only need to communicate with the Wii Balance Board.
If you have Raspberry Pi 1 or 2, we will have to plug in the adapter using one of our USB ports.
Power on Pi (
I assume you have Raspbian installed and it will start)
Go to your Raspberry Pi terminal window.
You can use the "hcitool dev" command to see the address of the Bluetooth dongle: install the Bluetooth module we will use in the Python script: After the installation is complete, we are ready to connect and communicate with the Wii Balance Board.
We will not permanently pair the motherboard with Pi like most Bluetooth devices.
The Wii balance board was never intended to be paired with anything other than the Wii, and permanent pairing proved to be a confusing challenge.
Pairing occurs every time a Python script is run.
Now is the time to connect the Wii Balance Board to our Raspberry Pi.
We will do this by modifying the Gr8W8Upd8M8 version of Stavros korokithakis. py script (
The python script we will use for this step is located here.
You can copy the contents of this file to the file you created on Raspberry Pi, or you can clone all the python files we will use for the entire project.
Let's do the latter.
Type the following command in the terminal on the Raspberry Pi: Clone to "smart-scale'. . .
Remote: count object: 14, complete.
Remote: compressed objects: 100% (12/12), done.
Remote: 14 in total (delta 1), reused 8 (delta 0), pack-
Reuse 0: 100% for unpacking objects (14/14), done.
Check the connection. . . done.
You should see two python files in the new smart-
Catalogue of scalesmartscale.
Py and wiiboard _ test. py.
Run wiiboard _ test.
Py script to test the communication and get the weight reading from the Wii Balance Board: you will see the following response: remove the battery cover under the motherboard and find the red sync button.
Make sure to press the button within seconds of running the script, otherwise a timeout will occur.
Once successful, you will see something similar to the following: wiiboard _ test.
Py script is getting the weight measurement specified by Line 10 and output the average: you can change the value and re-
Run the script to see the weight of the measurement and the changes in the time required for each measurement.
Call yourself, call your dog, call anything, and see if the measurement makes sense.
To stop the script, press ctrl c.
Now you have successfully converted your Wii balance board to a Raspberry Pi connection scale.
Now, let's turn it into a cool scale.
Nintendo thinks you always power the Wii Balance Board with four AA batteries and don't have an AC power adapter.
Only battery power can be inconvenient as we can't permanently pair the Wii board with the Pi via Bluetooth.
We need to sync it and then allow it to stay in sync without running out of battery so we can simply step on the scale and weigh.
Fortunately, there are a few third.
Party adapter made for Wii balance board, we can use it to provide constant power from wall sockets.
Replace the battery with the battery pack and plug the AC adapter into the wall socket.
Every time you run a Python script, you have to pair the Wii Balance Board with the Raspberry Pi, which gives us another inconvenience because of the location of the Sync button.
The sync button is at the bottom of the Wii board, which means we have to flip it every time we need to sync.
We can make a small pole with a pencil and three 3/8 felt pads to solve this problem, as shown above.
The rechargeable battery pack exposes the Sync button to the lower surface of the board. Tape a pencil (
Or something like that)
From the Sync button to the outside of the board.
Stack three 3/8 "felt pads (
Or something like that)
Create a fixed fulcrum in the center of the pencil.
Be careful not to reveal too many pencils from the board because you don't want someone to accidentally kick it out.
Flip the board and you can press the Sync button just by pressing the lever.
A bit of a hack, but it works.
Depending on the way you store your Wii board, you may want to remove the rubber grip pad from the foot of the board (
Pads are just stickers you can pry open).
For easy sliding, the 3/8 "felt pad can be placed on the foot of the board.
We want to stream our weight/data to the cloud service and have it turn our data into a great dashboard that we can access from a laptop or mobile device.
We need a destination for our data.
We will use the initial state as our destination.
Step 1: register the initial status account and then create a new account.
Step 2: install ISStreamerInstall to install the initial state Python module on the Pi: at the command prompt (
Don't forget to SSH into your Pi first)
, Run the following command: Step 3: Do some automation after step 2. You will see on the screen something similar to the following output :(
If you have never installed the initial state Python streaming module before, the output may be different and will take longer)
When prompted to get the sample script automatically, type y.
This will create a test script that we can run to make sure we can stream data from Pi to the initial state.
You will be prompted: You can either type a custom local path or you can click enter to accept the default path.
When registering an initial status account, you will be prompted for the username and password you just created.
Enter both and the installation will be completed.
Step 4: access key Let's take a look at the sample script created.
On Line 15, you will see one with streamer = Streamer (bucket_ . . . .
This line creates a new bucket of data called "Python stream example" and is associated with your account.
This association happens because of access _ key =. . .
"Parameters on the same line.
The long series of letters and numbers is your initial status account access key.
If you transfer to the initial status account in the web browser, click the user name in the upper right corner and go to my settings ", you will find the same access key under "Stream access key" at the bottom of the page.
Each time a data stream is created, the access key directs the data stream to your account (
So don't share your key with anyone).
Step 5: run the sample run the test script to make sure we can create a data stream for your initial status account.
Run the following steps: Step 6: return the initial status account in the web browser.
The left side of the log shelf should show a new bucket called "Python stream example (
You may need to refresh the page).
You can view the data in the block and the same data in the dashboard form.
Let's say you run the "git clone" command in Part 2, and the final script that combines everything together is called smartscale.
In your ~ /Smart-Catalog of scale. (
Before running the script, you need to set some settings in the script.
In your favorite text editor, like nano.
There is a user settings section near the top of this file.
After each parameter is specified in this section and changes are saved, you can run the final script.
Before we run the script, let's take a look at what it will do.
Run the script to start the magic.
Go to your initial status account and click the new bucket of data with the name corresponding to the buc _ name parameter (i. e.
My weight history).
Click tile to view your weight history dashboard.
When you look at the data in tiles for the first time, you should see three Tiles-
Update, weight date and weight (lb).
You can customize your dashboard by adjusting and moving tiles and changing view types or even adding tiles.
This dashboard allows you-a-glance.
It is mobile friendly and you can even share it with others.
Let's create SMS alerts whenever the scales do weight measurement.
Ensure that the loaded weight historical data bucket is added.
Once the setup is complete, each time you weigh, you receive a text message containing your weight, how much your weight has changed since the last measurement, and random jokes/insults/compliments.
You can have unlimited options based on what you create now.
Here are some ideas for this project: Hacking, let me know if this tutorial inspires you to create something amazing.