1

well I have this power analyzer. And I want read data with Arduino NANO, through rs485

enter image description here

here is product and here is the register table of this device.

I am using boud rate 9600, no parity, slave 1

also I had read those link and this video

but still i cant read data from power analyzer with arduino.

there 3 topic I am not sure:

    1. Which library sould ı use? now ı am using modbus master
    1. How should be connection of arduino and tll/rs-485 converter?
    1. How to read data such as:

Address Dec: 0, Address Hex: 0000, Format Word: uint32, Counts : 2, Unit: V, Remarks: Voltage L1-N, Multiplier: 0.1

for example I used this codes

#include <SoftwareSerial.h>

#define SSerialRX        10  //Serial Receive pin
#define SSerialTX        11  //Serial Transmit pin


#define SSerialTxControl 3   //RS485 Direction control

#define RS485Transmit    HIGH
#define RS485Receive     LOW

#define Pin13LED         13

/*-----( Declare objects )-----*/
SoftwareSerial RS485Serial(SSerialRX, SSerialTX); // RX, TX

/*-----( Declare Variables )-----*/
int byteReceived;
String ph_hexa, ph_hexa_hight_byte, ph_hexa_low_byte, ph_hexa_value; 
byte request [] = {
    0x01, 
    0x03,
    0x17,
    0x70,  
    0x00,   
    0x01,   
    0x65,    
    0x80    
};

//01 03 17 70 00 01 65 80 from register table example at last page

void setup()   /****** SETUP: RUNS ONCE ******/
{
  // Start the built-in serial port, probably to Serial Monitor
  Serial.begin(9600);
  Serial.println("YourDuino.com SoftwareSerial remote loop example");
  Serial.println("Use Serial Monitor, type in upper window, ENTER");
  
  pinMode(Pin13LED, OUTPUT);   
  pinMode(SSerialTxControl, OUTPUT);    
  
  digitalWrite(SSerialTxControl, RS485Receive);  // Init Transceiver   
  
  // Start the software serial port, to another device
  RS485Serial.begin(19200);   // set the data rate 

}//--(end setup )---


void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
   if (RS485Serial.available())  //Look for data from other Arduino
   {
    Serial.print("Response: ");
    for (int i = 0; i <= 6; i++) {
        byteReceived = RS485Serial.read();    // Read received byte
      
        ph_hexa = String(byteReceived, HEX);
          
          // index 3 = high byte
          if(i == 3)  
          {
            ph_hexa_hight_byte =   ph_hexa;  
          }

          // index 4 = low byte
          if(i == 4)  
          {
            ph_hexa_low_byte =   ph_hexa;  

            ph_hexa_value = ph_hexa_hight_byte + ph_hexa_low_byte;

            Serial.print(ph_hexa_value);// Show on Serial Monitor  
          }
        Serial.print(" ");                       
      }
      /*
      Serial.println(ph_hexa);
      ph_hexa = "";
      */
      Serial.println();
   }
   else
   {
      Serial.println();
      Serial.print("Request: ");
      digitalWrite(SSerialTxControl, RS485Transmit);  // Init Transceiver
      for (int i = 0; i < 8; i++) {
        Serial.print(request[i], HEX);          
        RS485Serial.write((byte)request[i]);                
      }
      Serial.println();
      digitalWrite(SSerialTxControl, RS485Receive);  // Init Transmit       
   }
   delay(1000);

}

but there is no Response return

23:17:17.663 -> YourDuino.com SoftwareSerial remote loop example
23:17:17.709 -> Use Serial Monitor, type in upper window, ENTER
23:17:17.756 -> 
23:17:17.756 -> Request: 131770016580
23:17:18.691 -> 
23:17:18.691 -> Request: 131770016580
23:17:19.719 -> 
23:17:19.719 -> Request: 131770016580
9
  • Can you give us a link to a documentation in english language? What have you tried and what is your actual problem? – Sim Son Apr 30 at 20:38
  • @SimSon English page is here entes.eu/mpr-47s-d links are updated . also I have added a code. but I didnt get any response as a user said. – mehmet Apr 30 at 23:59
  • 1
    Which IC do you use to interface the power meter? – Sim Son May 1 at 12:44
  • If you haven't already, swap the A and B signals on one side and see if anything behaves differently. The labeling of these signals is often backwards from what you'd expect. – timemage May 1 at 13:34
  • @SimSon arduino nano – mehmet May 1 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.