Introducing the latest and greatest in health technology: the Motivational Bathroom Scale. Getting unwanted family comments about your recent weight gain? Now you can get criticized by both your family and your bathroom scale! Simply enter your goal weight with the keypad and step onto the scale. The scale compares your real weight with your goal weight. If you’ve been exercising extra at the gym, the scale gives you a flattering compliment. Otherwise, beware, this scale is very sassy.
The Motivational Bathroom Scale is made with a cheap bathroom scale hooked up to an amplifier and a Raspberry Pi. A numeric keypad plugs into the Pi’s USB port. Sassy comments are stored on the Pi and played through 8-ohm speakers connected to an audio amplifier.
Materials for scale
- Taylor digital bathroom scale Target
- (x4) AAA 1.5V batteries RadioShack 23-2214
- (x1) 4 ‘AAA’ battery holder RadioShack 270-411
- (x1) Mini protoboard RadioShack 276-148
- (x1) LM7805 voltage regulator RadioShack 276-1770
- (x1) 0.1 μF capacitor RadioShack 55047557
- (x1) 0.33 μF capacitor Mouser 581-TAP334K035SCS
- (x1) 10 μF capacitor RadioShack 272-1025
- (x1) MCP3008 ADC RadioShack Mouser 579-MCP3008-I/P
- (x1) AD260 instrumental amplifier Mouser 584-AD620ANZ
- (x2) 1 Kohm resistor RadioShack 271-1321
- (x1) 333 ohm resistor RadioShack 271-1315
Materials for Pi Case
- Raspberry Pi Starter Kit RadioShack 277-196
- USB wall charger RadioShack 61-076
- USB to micro USB cable RadioShack 26-2738
- (x1) Project box RadioShack 270-1807
- (x1) Numeric USB keypad RadioShack 55053664
- (x1) Rocker switch RadioShack 275-693
Materials for audio (speakers plus amplifying circuit)
- (x1) 9V battery snap RadioShack 270-324
- (x1) 9V battery RadioShack 55039837
- (x2) 8ohm mini speaker RadioShack 273-092
- (x1) audio plug RadioShack 274-286
- (x1) LM386 RadioShack 276-1731
- (x2) 10 μF capacitor RadioShack 272-1025
- (x1) 200 μF capacitor RadioShack 272-1029
- (x1) 47 nF capacitor Mouser 810-FK20X7R2J473K
- (x1) 1000 μF capacitor RadioShack 272-1032
- (x1) 10K trim potentiometer RadioShack 271-282
- (x1) 10 ohm resistor RadioShack 271-1301
- (x1) 1 Kohm resistor RadioShack 271-1321
- (x1) 2-pin screw terminal RadioShack 276-410
Materials for base
- 24″x36″x3/16″ piece of plywood
- 34″x20″ bath rug Target
Useful materials for the Raspberry Pi
- External monitor
Other useful materials
- Electrical tape
- 2-part epoxy
Step 1: Project Overview
To help you get a sense of how this project is designed, this Instructable is broken up into sections, each illustrated by a block in this flowchart. I will refer to this flowchart again and again as a roadmap.
Step 2: Project Overview: How Digital Scales Work
The way a digital scale works is based on a component called a strain gauge. A strain gauge can be used to measure the force applied on an object.
When a material is pushed or pulled, it stretches or compresses. Take a diving board for example. If a swimmer stands at the end of a diving board, the board deforms. The bottom of the board compresses and the top stretches. Now image a wire is placed on top of the board. A wire acts like a resistor, and the longer the wire the higher the resistance. So if the wire is stretched on the diving board, its resistance goes up. The more force applied to the board, the higher the wire’s resistance. This, in essence, is how a strain gauge operates.
We can see this for ourselves with a digital scale. Detach one of the 3-wire strain gauges from the bathroom scale. Connect its red wire to power, blue or black wire to ground, and white wire to the oscilloscope. Have a friend “pump” the strain gauge, or apply weight to it on and off. AC couple the oscilloscope and watch while the stain gauge’s output voltage changes with force.
Step 3: Project Overview: Hacking the Digital Scale
This section covers how to rewire the strain gauges inside a digital scale, amplify strain gauge output, and enable a Raspberry Pi to read analog input.
Step 4: Scale Circuitry: Disassemble the case
Remove the screws on the underside of the scale. Pull off the scale’s top case.
Step 5: Scale Circuitry: Cut the Wiring
My scale has four 3-wire load cells. Each load cell has a blue, a red, and a white wire, where
- red = V-in
- white = V-out
- blue = GND
Cut these wires (12 total) from the scale’s PCB. Also snip away the power and ground wires running from the battery pack to the PCB.
There will be labels underneath the connections that were just snipped away. They read “E+, E-, S+, S-“. On my board, these labels are underneath the connection between the white wires and the PCB. These labels stand for “Excite” and “Sense”. I colored coded each white wire with a piece of colored tape to help me differentiate the load cells.
Step 6: Scale Circuitry: Prepare the Wire
Solder a small piece of solid wire to the end of each stranded load-cell wire. Wrap a piece of electrical tape around the solder joint to protect it from breaking.
Step 7: Scale Circuitry: Remove the Scale’s PCB and LCD
Remove the scale’s PCB and LCD from the lid.
Step 8: Scale Circuitry: Power
Swap out the scale’s 4.5V battery pack for a 6V pack and scale it down with a 5V regulator. This feeds the circuit a constant 5V, ensuring that the scale calibration (which is described later) won’t go wonky when batteries get low.
Step 9: Scale Circuit: Voltage Regulator
Bend the legs of a LM7805 voltage regulator at a right angle. Solder the legs down so the regulator lies flat against the board. Solder a 0.33 μF capacitor from the regulator’s input pin to ground pin and a 0.1 μF capacitor from the regulator’s output pin to ground pin. Solder in a AA 6V battery pack into the board and connect its red output wire to the regulator’s input pin, and its ground to the regulator’s ground pin.
Step 10: Scale Circuitry: Load Cell Wheatstone Bridge
Scales use a circuit known as a wheatstone bridge. A standard wheatstone bridge is composed of two voltage dividers in parallel. A wheatstone bridge makes it possible to measure small changes in resistance by measuring the voltage across the two dividers.
In this circuit, the scale’s four load cells create the four legs legs of the wheatstone bridge. As the load cells are compressed, their output voltages vary minutely. This small difference in voltage will be correlated to the weight of a person on the scale. This small change in voltage is detected with the wheatstone bridge.
Wire the wheatstone bridge as illustrated in the Fritzing schematic. In my scale the R and W labels (which refer to the cell’s red and white wires) are switched. Recall that the white wires attached to each load cell are labeled “E+, E-, S+” and “S-” for “Excite” and “Sense”. The “Excite” wires are linked to the circuit’s excitation source, and the “Sense” wires sense changes in weight.
Step 11: Scale Circuitry: Instrumental Amplifier
The wheatstone bridge only outputs a few mV when a person’s full weight is applied. The analog-to-digital converter (ADC) used with the Raspberry Pi can only read 1024 divisions per 5V or,
5V/1024 steps = 5 mV/step
This means that the ADC’s resolution is too large to detect the wheatstone’s output voltage, so the output voltage must be amplified. I use an AD620 instrumental amplifier tuned to have a gain of 150.
Solder the connections as illustrated in the circuit diagrams included here.
Step 12: Scale Circuitry: MC3008 ADC Convertor
The Raspberry Pi alone cannot read analog inputs like an Arduino or other microcontrollers. An analog-to-digital converter (ADC) is necessary for the Pi to read the AD620’s output signal. A MCP3008 ADC chip acts like a bridge between the amplifier’s analog output and the Pi’s digital input. The MCP3008 is wired to two 1×13 male-to-male header pins that are soldered into the board. They act as a makeshift Raspberry Pi Cobbler. The header pins are connected with a ribbon cable to the Raspberry Pi. Look at the included circuit diagram for how to connect the MCP3008 to the Pi.
It easy to misconnect the header pins to the Pi. One edge of the ribbon cable has a white or red stripe. Connect the cable so the stripe is closest to the SD card on the Pi. The cable’s connection to the header pins on your circuit board may differ depending on your wiring.
I also decided to put a small piece of paper underneath the circuit to prevent any shorts.
Step 13: Scale Modification: Remove the Display Cover
The scale’s plastic top has been sitting off to the side while I’ve been hacking the base’s load cells. It is now time to modify the top.
Take the white plastic top and pop off the plastic display cover. Flip the top over and unscrew the platform that held the 7-segment display (the screws are circled in red).
Step 14: Scale Modification: Cut the Exterior
Draw two parallel lines running down the front edge of the scale top. Use masking tape as a guide to draw straight lines.The distance between them should be slightly larger than the width of the ribbon cable.
Secure the scale top in a vice and saw along the lines to cut out a chunk of scale.
Step 15: Scale Modification: Replace the display cover
With a hand saw, cut about 1″ of plastic off the lip of the display cover. Place back onto the scale case.
Step 16: Project Overview: Audio
This section covers how to record audio files and amplify audio output from the Raspberry Pi.
Step 17: Audio: Recording Comments
I recorded audio clips of mean and nice comments for my scale. The mp3 files are included here. Make a folder on your computer desktop called ‘comments’. Download these audio files and put them into ‘comments’. Insert the Raspberry Pi SD card into your computer and copy comments into it.
If you wish instead to record your own sassy comment follow these instructions:
If you don’t have it already, download Audacity here. Audacity is a free and easy-to-use audio editor that runs on any operating system. Also download the LAME mp3 encoder here so you can generate mp3 files through Audacity. Open Audacity and press the circular red button in the upper left-hand corner to record your comment. When you are finished, press the yellow stop button in the upper left-hand corner. Save each section of sound as a separate mp3 file by selecting it with your cursor and using the ‘File’ -> ‘Export Selection’ command.
For more detail: Motivational Bathroom Scale