Automated bee hive scale - How do I connect a HX711 board to an emonTx board?

I’m trying to set up an automated scale for monitoring the weight and temperatures of my bee hive.

I have managed to hack a bathroom scale using a HX711 board and an Arduino UNO and I would now like to replace the Arduino with an emonTx, i.e. use all the nice OEM hardware and software for transmitting and managing the data.

In order to connect the HX711 board to the emonTx I need four pins; GND+5V and DAT+CLK.

GND, 5V is simple and I guess I can use Dig3 for the DAT pin (screw terminal 4), but how do I get a CLK pin? Can I use Dig19 / screw terminal 5 even though I am connecting temperature sensors via the RJ45 onewire bus? …or is there a smarter way to do this?

Edit: A simple sketch without OEM SW runs just fine using Dig3 and Dig19.

If you look at the circuit diagrams for your emonTx, which you get via the Wiki from Resources, you’ll see that D19 doesn’t go to the RJ45 socket, so you should be free to use it.
However, depending on what your library for the load cell actually does, you probably want to make sure that it and the temperature sensors aren’t trying to communicate at the same time, as both appear to be timing-critical.

Thanks for the help Robert, I have it up and running now. Will have a look at the potential timing issue.

The biggest issue now seems to be, that the emonTx eats the batteries way too quickly. I’ll turn down the reporting rate, but… guess I’ll have to read up on battery saving tips.

If there was a timing issue, I think you’d have found out by now.

I would guess that the battery drain problem is due to the extra load (1.5mA continuously) taken by the load cell. We get round that for the temperature sensor (and in the emonTH, the humidity sensor) by switching the power on just before taking a reading, and switching it off again after. But guess which output we use for that! Until you can do something like that, turning down the reporting rate (even though once every few minutes is surely fast enough?) will not achieve all that much.

D6 (the LED drive) could double up for the load cell power, or D7 is free, D8 & D9 are used as DIP switch inputs, if you guaranteed the switch would never be used, those could be used as outputs. But all these will require some very careful soldering to attach a wire to the PCB. ADC6/D20 is available on the RJ45 socket.

What else are you using the emonTx for?

This emonTx will be used for monitoring load cell’s and temperatures only. I needed an Arduino, a good RF radio and battery capability, and the emonTx seemed to be the easy way out. In hinesigt, an emonTH may have been a wiser move.

I will implement the powering down concept. I do own a soldering iron, so e.g. to desolder one of the DIP switches and use the pin for powering the load cell(s) should be within reach.

Which sort of battery lifetime is attainable with a typical emonTH setup?

I believe it is months. A search of the old forums and/or a look at the emonTH wiki might tell you.

My emonTh has been running indoors for 1 year on the same set of batteries. It sends data every 1 minute. Just looked at the battery data and it is probably time to change the battery (voltage is 1.2 volts).

Have you seen these sites? They may help… :grinning:

http://forum.arduino.cc/index.php?topic=113534.0

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

Thanks, I’ll have a look. I will probably need all the help, tips and hints I can get :wink:

I’m trying to implement the powering down of the load sensor.

I’m using Dig19/Adc5 for power, Dig3 for data and Dig8 for the clock. The hook-up works fine using a simple sketch, but I’m experiencing some difficulties with the load cell data when I try to implement the powering on/off on the master sketch.

One question though; how does the power saving work when using the one-wire temperature sensors (RJ45 plug)? Will the one-wire software automatically power down the sensors between readings (DIG20/ADC6)? The emonTh code only seem to power down sensors attached to Dig19/Adc5…

Not sure about your specifics, I don’t have an EmonTH, but on my old EmonTemp the code needs to power down the DS18B20’s.

It’s the -
digitalWrite(9,HIGH);
delay(2);

that does it. It just powers up a digital output pin and that powers the DS18B20 up by feeding power to its power pin.
The delay is to give it a bit of time to stabilise.

I now have the master sketch up running with most of the power saving features from the standard emonTH sketch, thank you all for chipping in :slight_smile:

Power consumption is now very good; battery life of several months I think, at least in the summer period. Readings are spot on and data transmission works fine; a big thank you to all the OEM contributors for providing such premium and flexible building blocks.

Now I’ll have to do a weather and bee resistant enclosure; Bees are very keen on chewing up and destroying all soft materials inside the hive, so I hope they do not take a liking to temperature sensor wirerings.