Introduction: Wireless Digital Scale

This scale is wireless. It may be useful where you can't operate a normal scale, due to the weather outside, or if you don't want to scare birds or other creatures away. With this scale you can weigh them. In this instructable, I used a 0 to 1 Kg load cell since I wanted to weigh hummingbirds and orioles that visited our nectar feeder. One end of the load cell was attached to the eaves, and the other end has a hook from which the support string for the feeder hangs. Many other load cells are available in different weight ranges, and they all can be hooked up the same way, the only difference being the zero factor and range factor which can be changed in the Arduino sketch.

Step 1: Supplies Required

The parts are all very low cost, but will take 4 to 5 weeks to arrive from China.


The remote end contains the load cell (0 to 1 Kg), the amplifier, an ATtiny85, and a HM-10 Bluetooth low energy transmitter/receiver slave. The display module contains: 2 x 16 line LCD, HM-10 configured as master, software latching on/off switch, buttons, toggle switches, USB battery bank, and an Arduino Pro Mini 8 Mhz 3.3 volt micro controller.

1 ea. Load cell: 0-1 Kg load cell

1 ea. HX711 amplifier/ 24 bit A to D converter HX711

1 ea. ATTiny85 micro controller ATtiny85

2 ea. HM-10 Bluetooth Low Energy modules, one configured as master, one as slave HM-10 serial

1 ea. 2 cell AA battery holder Battery Holder

1 ea. pin Adapter Adapter

1 ea. USBasp Programmer USBasp programmer

1 ea free Aduino IDE Arduino IDE

1ea. 2 x 16 LCD, I2C interface LCD

1 ea. Arduino Pro Mini 8 Mhz 3.3v 3.3v Pro Mini ATmega328

1 ea. USB to TTL serial adapter FTDI adapter

1 ea. USB battery bank Battery bank

10 ea. push type toggle switch ( 8 spare) latching switch

10 ea. momentary tactile button (8 spare) buttons

1 ea. clear soap dish enclosure for display, from Daiso.

Assorted: wires, small perfboard, 3 2N2222 transistors, IRF9540 Mosfet, resistors, and diodes.

Step 2: Programming the HM-10 Modules

The HM-10 modules come configured as slave units, and no auto sleep. They need to connect immediately, master to slave, without a password or other negotiation. To program them, use the FTDI 232 adapter (set to 3.3 volts). You connect pins 3.3v, Gnd, Rx to Tx and Tx to Rx; it will be helpful to have a female header to stick on the FTDI pins, then solder small flexible wires to the female header pins, and from there solder the wires to the HM-10. See the circuit diagram for the HM-10 Manual , the mode led on pin 24, the reset wiring on pin 23, and the connection of grounds to pins 13,14, 21, and 22 needs to be accomplished- it takes a fine tipped soldering iron and a steady hand (plus a 3rd hand accessory to hold the board) . You will need some sort of terminal program, the best is Realterm because it allows you to send AT modem commands to change the configuration. See this excellent instructable to familiarize yourself on the steps required Programming the HM-10 .

/////////////////////////////////////////////////////////////////////////////////////////////////

Program the slave as:

MODE 2, data and AT commands in same data stream. send AT+MODE2

PWRM 0, auto sleep mode, send AT+PWRM0

ROLE 0, slave/remote/peripheral unit, send AT+ROLE0

PCTL 1, power output, max. send AT+PCTL1

FLOW 0, flow control not used. send AT+FLOW0

ADDR ?, you need to find the MAC address for this device, write it down. Used to set CONN in master.

send AT+ADDR?

CONN XXYYZZ etc., set the slave to connect to master's MAC address.

send AT+CON22C22FF22DA2 [whatever the master MAC address is]

BAUD 0, default baud rate 9600 baud (as fast as the ATtiny85 can send) send AT+BAUD0

POWE 1, -6 dBm transmit power (to save a bit of power), send AT+POWE1

VERS ?, version. My version was v533. send AT+VERS?

With HMSoft V540, see notes below.

///////////////////////////////////////////////////////////////////////////////////////////////////////

Program the master as:

MODE 2, data and AT commands in same data stream. send AT+MODE2

PWRM 1, no sleep mode (master has external soft latch power down), send AT+PWRM1

ROLE 1, master/central unit, send AT+ROLE1

PCTL 1, power output, max. send AT+PCTL1

FLOW 0, flow control not used. send AT+FLOW0

ADDR ?, you need to find the MAC address for this device, write it down. Used to set CONN in slave. send AT+ADDR?

CONN XXYYZZ etc., set the master to connect to slave's MAC address. send AT+CON22C22FF22DA2 [whatever the slave MAC address is]

BAUD 0, default baud rate 9600 baud (as fast as the ATtiny85 can send) send AT+BAUD0

POWE 2, default 0 dBm transmit power, send AT+POWE2

VERS ?, version. My version was v533. send AT+VERS?

With HMSoft V540, see notes below.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

Notes: V540 uses AT+TYPE set to 2 as default (use PIN code), so set it back to 0 (no PIN code).

Also, V540 does not connect immediately on power on, display unit must send AT+CONxxyyzz...... (MAC address of slave) to connect, add that to Setup section of the sketch.

other interesting AT commands:

TEMP ? send AT+TEMP? to get the temperature

RSSI ? received signal strength send AT+RSSI?

BATT ? battery voltage (has A/D converter!), send AT+BATT?

PIO4, PIO7 etc. set or clear output pins (used to power up and down the ATtiny85) send AT+PIO41 to set HIGH, AT+PIO40 to set to low.

Step 3: Wiring Up the Scale and Program ATtiny85

Assemble the parts for the scale on the perfboard. Solder wires between components according to wiring diagram. You can program the ATtiny85 externally by making or buying a 6 pin programming adapter for the ATtiny85, or you can just wire a 6 pin header to the perfboard like I did (the wiring diagram does not show the extra connections to the header). I used the Arduino IDE to program the ATtiny, but first add the ATtiny to the boards manager, see ATtiny In the tools tab of the Arduino IDE, program the ATtiny to run the 8 Mhz internal clock, port doesn't matter (it uses the USB port), and Programmer: USBasp. On a new ATtiny, you need to "burn bootloader" first (at bottom of tools list- actually just sets fuses for the internal clock speed etc.). The ATtiny is great in that it runs at low power, but the internal clock has the drawback that the clock isn't very accurate. Therefore, because the Attiny needs to send serial data gathered from the HX711, an OSCCAL calibration procedure is required or the serial data at 9600 baud will likely be garbage. I used Tiny Tuner , the "Using serial communication" method.

Program the ATtiny with the sketch ATtiny85_Hummingbird_Bluetooth_SLEEP_net1_1.ino The HX711.h include file can be found by following this link HX711 hookup and code library

I am currently using 2 AA batteries for a power supply, as that, and the circuit board will fit into the small plastic food container I bought from Daiso. If that doesn't work long term, I will add a step up boost dc to dc converter; I found such a dc to dc converter that has a 500uA idle current draw.

Step 4: Assembling the Display and Programming It

Hot glue the Arduino Pro Mini to a bit of Popsicle stick, and hot glue the Popsicle stick to the lcd so as to keep the Pro Mini above the tabs on the lcd display. Build the Softlatch on/off circuit on a piece of perfboard according to the circuit diagram- credit to Ardweeny and wire it to Ground and Raw input of the Pro Mini, and control lines to pins 5 and 6 of the Pro Mini. Wire the on/off button lead and ground to an case mounted button. Hot glue the Softlatch circuit to the lcd.

Since the power supply needed to power the lcd with 5 volts, but the HM-10 needs 3.3 volts, a Pro Mini with an onboard 3.3 volt regulator was chosen. That simplified logic level interfacing between the Pro Mini and HM-10, and even to the I2C backpack (5V I2C components can be connected to the SDA and SCL lines of the 3.3V Pro Mini I2C-bus), while still giving the lcd 5 volts for a normal display. A common USB battery bank was chosen to provide the 5 volts because it was easily rechargeable via USB, fit well in the project box (soap dish), and came in a pleasing color to show through the clear soap dish case. Because lengthwise space is limited in the soap dish, a USB connector was cut down and wires soldered to the cut down connector (outer 2 pins) and extended to the Softlatch circuit board power input.

Carefully drill 4 holes for mounting the lcd in the soap dish lid, and attach lcd to lid with 4 ea. 1/2" long miniature screws and matching nuts. Drill holes for the toggle switch pushbutton, and hold in place temporarily with earthquake putty on the sides of the toggle. Apply 30 minute epoxy sparingly to top and bottom of toggle and allow to cure. Do the same for the 2 buttons. Wire according to circuit diagram.

Program the Pro Mini with the sketch using the FTDI adapter plugged into the female programming header.

Position the HM-10 so the built in Antenna faces towards the front of the case, clear of metal or wiring, and in such a position that the HM-10 mode led can be seen. Secure with hot glue to the lcd.

Step 5: Installing the Scale and Testing

Since our house has wood eaves, a bracket that holds the load cell and electronics/battery was fabricated out of 1-7/16" x 1/8" aluminum stock, using a vise and pipe wrench to bend it. The load cell should attach at one end via screws to the bracket, the other end of the load cell has screws to attach a hook. The fishing line attaches to the hook, supporting the feeder. Be sure the free end of the load cell is clear of the plastic container and wires.

Test the scale without the feeder, and note the reading. Zero can be adjusted in the sketch for the display, try different factors until it reads zero. Then attach a known weight (weigh a nickel on a separate scale, should be around 5 grams). Adjust the scale factor in the sketch until the scale reads the same as the known weight. Attach the feeder and note the reading. When you see a bird about to land on the feeder, set the toggle for net weight instead of gross weight, thereby zeroing the scale before the bird lands. The hummingbirds weigh around 3.5 to 4.5 grams, and an oriole, 25 grams. Do the weighing when the wind is calm, as a swinging feeder makes it difficult to get a reading.

Comments

author
JetMechanic made it!(author)2016-05-19

What are the accuracy/performance specs on the load cell?

author
jbike made it!(author)2016-05-19

It is best to order a few load sensors (or from different vendors), being that since the shipping is free, the packaging may not be the best and the fine wires of the load cell can get damaged in transit. That happened to me, and they will gladly refund your money for a damaged sensor. Check for symmetrical resistance readings between wires.

author
jbike made it!(author)2016-05-19

I don't know the specs of my cell, but probably similar to other cells of this design.

see

http://www.ebay.com/itm/Weighing-Sensor-3Kg-Electronic-Scale-Aluminium-Alloy-Load-Cell-Weight-/231943063291

Range: 3Kg
Comprehensive Error: 0.05mV / V
Output Sensitivity: 1.0 ± 0.1% F.S
Nonlinear: 0.03% F.S
Repeatability: 0.03% F.S
Hysteresis: 0.03% F.S
Creep: 0.05% F.S (5min)
Zero temperature drift: 0.02% F.S / 10 ?
Rated output temperature drift: ? + 0.1% F.S / 10 ?
Zero output: ± 0.1mV / V
Input Resistance: 1050 ± 10?
Output Resistance: 1000 ± 10?
Insulation resistance: ?2000M?
Recommended excitation voltage: ?10V
Operating temperature range: -10 ~ + 40 ?
Overload: 150% F.S
Recommended for: kitchen scales postage scales.
Sensor Size:55*13*13mm

author
DIY+Hacks+and+How+Tos made it!(author)2016-05-17

that is a really clever way to monitor a bird feeder. I guess you could also use it to monitor the moisture level of hanging plants. A planter with more water will be heavier than a dry plant.

author
JetMechanic made it!(author)2016-05-19

How do you compensate for growth?

author
DIY+Hacks+and+How+Tos made it!(author)2016-05-19

Good question. I guess you could automatically calibrate it every few days kind of like zeroing out a kitchen scale.

author
jbike made it!(author)2016-05-17

Thanks. That is a good idea, I will have to try it.

author
extreme_yarak made it!(author)2016-05-18

How does temperature affect the readings? I would like to use something like this year round to monitor a beehive.

author
jbike made it!(author)2016-05-18

Temperature does seem to change the weight slightly, though if the load cell is constructed properly, it shouldn't change since the cell is arranged in a half wheatstone bridge configuration see http://www.ni.com/white-paper/3432/en/

The temperature readout originates from the slave HM-10, not the HX711 A/D next to it. We had some bees in the wall of a house we were selling, it was amazing how much heat the bees produce. You could feel it through the drywall!

For weighing bees, you might use the common bathroom scale load cells, one on each corner, they sell a little terminal block that combines the leads to feed into the HX711.

About This Instructable

4,831views

84favorites

License:

More by jbike:Levitator / Motor, Solar PoweredDouble Acting Electric MotorHex-a-gone-wild (solar Motor)
Add instructable to: