Hi,
I’d like someone to help me build an Arduino Sketch that polls Power Meters like the ones below via ModBus – Eastron SDM220 and 120 (I presume all EASTRON meters would be similar in the way you poll them?)
I do tinker round with Arduino’s, but I don’t entirely get the RS485 stuff, so thought I’d leave it to an expert ;)
[login to view URL],searchweb0_0,searchweb201560_9
[login to view URL],searchweb0_0,searchweb201560_9
These power meters have a range of different registers that hold voltage, current etc.. ideally I want a script that gets these values from the meters and uploads them to a web service.
I’ve found this link to someone who has written code against the Eastron meters in another language, some of the register addresses may help development?
[login to view URL]
Ideally the electronics would be:
• An RS485 (MAX485) converter and a NodeMCU Board (ESP8266 on a developer board).
Now that you can run Arduino sketches to the ESP8266 chip, this would be ideal low cost board rather than having an Arduino AND an ESP8266 chip. I’ve already tried some basic Arduino sketches on these.
o [login to view URL],searchweb0_0,searchweb201560_9
o [login to view URL],searchweb0_0,searchweb201560_9
The MAX485 board would interface on say Digital Pin 2 for High/Low and Pin 3 and 4 for RS485 RX/TX (Software Serial as to leave the hardware RX/TX for Console) via USB port
The Arduino Sketch Would:
• Set up the RS485 Bus – Set Baud Rate etc, Hardware Pins to use
• Set up Software Seral for ModBus Comms through the MAX485 converter
• Set up Hardware Serial at 9600 for Console Comms
• Set up a Wifi Client Connection to a home Wifi Network via the ESP8266 wireless library - hard coded SSID, Pass etc OK for now
• Loop
o Poll the bus for devices that respond on different addresses – build an array of responding devices (this way if you add meters to the bus they get detected)
(There may be a better way to scan RS485 for addressable devices?? Not sure as never worked with RS485.
o For Each Device Found
Send whatever you need to send to get the meter to respond
Read in the readings from the meter
Construct the readings to send to web server and add to array of data to send
o Send the data in a JSON type format
Ideally the code would be well commented and print to the contsole so its verbose as to what it’s doing.
As I say, I’m not a complete beginner with Arduino and understand the basics, but have never worked with ModBus and am short on time, therefore I know someone out there would write a far nicer sketch than me and the right person would bash it out in an afternoon or evening :)