Suggestions for ModBus device to OpenEnergyMonitor

Hi

I am a newbie to OpenEnergyMonitor but have done some experimentation and have a clear goal in mind... I am hoping to use the OpenEnergyMonitor eco system to collect temperature measurements from my hibernating tortoises!

I have purchased a second hand AKO-15722 datalogger from EBAY (bargain at £20) and have 10 NTC temperature sensors, the logger works nicely and will talk proprietary modbus/RS485.  I have reverse engineered the modbus registers and can reliably get the temperature readings from all 10 probes on demand.

My current set-up is an Arduino Uno connected to a MAX485 and an LCD display.

The next step is to get the information from the Uno back into OpenEnergy monitor...

I can see a number of potential options...

(1) Add a RFM12B to my Uno and wrangle with the fact the RFM12B really wants 3v3 levels

(2) Try and run the modbus/RS485 at 3v3 levels (doesn't sound hopeful)

(3) Use a Pi (potentially the emonPi basestation) for the modbus connection

I'm not sure which way to go...

Any recommendations for a hardware platform for Modbus/RS485 to OpenEnergyMonitor?

Thanks

Nivag

NivagSwerdna's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

I looked at the schematic for the emonTx Arduino Shield SMT.  It seems this is probably the easiest approach for me... I'll try that.

Robert Wall's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

Or maybe just the Shield PCB - you don't need the voltage and current inputs, so the PCB, RFM69CW, half a dozen resistors, 1 capacitor and headers is about all you need. (Check the schematic for the details.) (Though there might be no cost saving!)

NivagSwerdna's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

Thanks for the reply.  Yeap the Shield PCB seems to have exactly the resistors needed for the 5v to 3v3 level conversion.  Will try that first.

Bill Thomson's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

Here's another method...

I have an Elkor WattsOn RS-485 headless Wh meter that I connect to a Pi via a USB RS-485 adapter
(very low cost, about 4 USD)

I wrote a python script that uses Jonas Berg's MinimalModbus package to get the data from the meter to the Pi.

From the Pi, I send the data to a local emoncms (on another Pi, although I could've chosen to run emoncms on the same Pi) via curl, in a bash shell script.  Also running is the Python package Advanced Python Scheduler, which calls the meter reading routine every five seconds. It sounds more complicated than it actually is. It's run without issue for a bit more than two years.
 

NivagSwerdna's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

Hi Bill,

That would work.  Would you be prepared to share your script so I can have a look?

That would probably be a neater solution since it only needs 3 wires + power from the Pi.

Thanks

Nivag

 

Bill Thomson's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

 Would you be prepared to share your script so I can have a look?

You bet. Hope it works as good for you, as it has for me.
Extensions changed to .txt to enable attaching them to this post.

NivagSwerdna's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

Thanks Bill. That's awesome.

I've decided to implement all three options!

I have the hardware for Option1 and have a 3v3 RS285 adapter for Option 2 and a USB RS485 adapter for Option 3 on order!

Regards

Nivag

NivagSwerdna's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

Well I'm quite pleased with myself... I now have my 10 channel ex-EBAY £25 Datalogger working reliably using a RS485 module (also EBay for 99p!) feeding its 10 measures every 60 seconds into EMONCMS.

I used an UNO clone and a emonTX SMD shield which was slightly overkill but it saved me the effort of a bare RFM69 and getting the voltage levels correct.

Now off to measure some things....

 

Bill Thomson's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

Looks like you're off to a good start!

One caveat though. You might want to find something else to put under your Arduino. The piece of carpet/rug you're using can easily generate enough ESD voltage (14-cent term for static electricity) to zap your Arduino.

Here's a video clip made by Apple Computer that shows how easy it is to zap electronics by ESD. It was made in 1985, but the concepts demonstrated are still valid.

NivagSwerdna's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

That's my solder mat!  It's Wool not Polyester, indeed if it was Polyester I would worry.

Point taken though, maybe I should replace it although over the last 10 years or so of electronics I've never had a problem and I've had many CMOS bare components pass over its weave.

Regards
Nivag

Bill Thomson's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

It's Wool not Polyester

Wool isn't as bad as Polyester, but still generates a charge, as demonstrated by this video.

The best cloth material to use is Cotton. Although an anti-static mat would of course be best, they're not cheap.

Did you watch the video clip? The part where he talks about "wounding" an IC vice flat out destroying it is the part most folks don't know about. I had to show the video to a fellow ET who thought his computer video card wasn't in danger of getting damaged when he put it in a plastic grocery bag, to convince him the plastic bag wasn't a good idea. The real eye-opener for him was when he realized the components could be damaged by bringing a charged object near them, i.e. without actually touching them.

NivagSwerdna's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

I have watched both videos.  I bet there is some polyester in that jumper ;o)

Seriously, you have a fair point and it is noted.

Regards
Nivag

 

NivagSwerdna's picture

Re: Suggestions for ModBus device to OpenEnergyMonitor

FWIW Attached my sketch code.  Modbus Read command is for an AKO-15722 10-Channel Datalogger

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.