Reading Growatt solar inverter data

Hello all

I have installed a grid connect PV 3kw system. The inverter is a Growatt brand with a RS 232 output. I would like to use a stand alone arduino uno to:

a) log power output during the day
and
b) turn on a pump when the solar panels are generating enough power to drive the pump to transfer water from a bore to a storage tank. IE use my power to pump not the electricity company's.

Any ideas or suggestions would be greatly appreciated.

Thanks

Patrick

Welcome to the forum.
First, the forum software has been upgraded and you will not yet get notifications to any posts, so you will need to check back here yourself until it is rectified.

Next, you need to be more specific about the model of inverter you have, or all I can do is assume, and that consumes too much brain power from my synapses. But I'll assume it is a 3kW inverter.

Next I'll assume the inverter uses either Modbus protocol over the proprietary Growatt protocol.

Next, can we assume you want to communicate with the invetrer and get data out of it so you can store this data in your Arduino UNO, say, maybe to SD card at say some regular time period, say, each minute to be be averaged out over say each hour?

What do you want to do with this logged data, please be more specific as this will determine the design and solution for you.

About your pump, is it to be controlled only in certain time periods, or only when other certain conditions are met, what about on the pump side, say water level? Again, you really need to be very clear and specific, or all we can do is guess, which wastes time for everyone.

Provide a link to the inverter details, give details about how you intend to control the pump which I can only assume is not near the inverter, so what distance, what sort of power, what are your electrical capabilities doing such work?


Paul

Referring to the "Growatt Inverter Communication Command Manual" extract below:

"..............RS232 cable: DB9 direct through cable.
2 Mode 1; Automatic Return Periodically (mode for one inverter communication)
2.1 Format of commands

3F 23 7E 34 C1 7E C2 C3 T0 T1 T2 T3 23 3F
C1: command type; It is ‘0x41’ or ‘0x42’ generally; C2: read data type; It is ‘0x32’ generally;
C3: enable return periodically; It is ‘0x59’ generally;
T0~T3: periodic return interval; for example: 1000ms,then string is ‘1000’, field T0~T3 must be
’0x31’ ‘0x30’ ‘0x30’ ‘0x30’;
(1) Communication procedure
Step1: Computer send Read Command, for example: periodic return interval= 1500ms; 3F 23 7E
34 41 7E 32 59 31 35 30 30 23 3F
Step2: If the connection is OK, inverter will return some data. Do not care about what are they
except there was no data returned;
Step3: Computer send Start Command; 3F 23 7E 34 42 7E 23 3F
Step4: Inverter return data periodically (every 1500ms); 57 D1 D2 D3 … D28 D29
D30

D1D2: PV1 voltage (10 times value); Vpv = (D1*256 + D2)/10; D3D4: do not care;
D5D6: PV2 voltage (10 times value as well. Only 2 MPPT machine have this parameter) D7D8: Grid
voltage (10 times value);
D9D10: Grid frequency (100 times value);"

What do I need to do to get the Arduino to send:

3F 23 7E 34 41 7E 32 59 31 35 30 30 23 3F

then when Growatt replies, get Arduino to send:

3F 23 7E 34 42 7E 23 3F

and then when Growatt replies with data:

57 D1 D2 D3 … D28 D29 D30

Get arduino to write this to a SD and wait for next data reply and write that to SD.

Once I get the data, I can extract the values I want.

Thanks

Patrick

I am also doing a similar project. Actually, the parameters i need are Battery capacity, Battery voltage and some others. According to the manual, these data are not provided by the inverter via the serial. But the LCD in the inverter shows these data. The model I am using is Off-Grid-4K-48V.

I am also doing a similar project. Actually, the parameters i need are Battery capacity, Battery voltage and some others. According to the manual, these data are not provided by the inverter via the serial. But the LCD in the inverter shows these data. The model I am using is Off-Grid-4K-48V.

avinav001:
I am also doing a similar project. Actually, the parameters i need are Battery capacity, Battery voltage and some others. According to the manual, these data are not provided by the inverter via the serial. But the LCD in the inverter shows these data. The model I am using is Off-Grid-4K-48V.

So, now who will know which posting a response is referring to?

AVINAV001, best to start your OWN thread!

Paul

I am sorry about that. I did not find many posts or discussions regarding these subject. This one is by far the closest. Even, if there is a formula to calculate battery capacity, voltage and charging current , given the parameters the inverter provides via serial, please, that would be really helpful.

avinav001:
I am sorry about that. I did not find many posts or discussions regarding these subject. This one is by far the closest. Even, if there is a formula to calculate battery capacity, voltage and charging current , given the parameters the inverter provides via serial, please, that would be really helpful.

If you don't find a thread that relates to your quest, that is a good reason to start your own thread.

Now, about battery capacity. That is a chemistry question and every time a battery is discharged and recharged, the capacity is a little bit lower. Therefore, capacity of a battery cannot be calculated because it all relates to age of battery, internal chemistry, and number of charge/discharge cycles. Oh, temperature of the battery is also involved.

Paul

I am using the RS232 to ttl converter.

Using Arduino Uno: SoftwareSerial

byte input[] = {0x3F,0x23,0x7E,0x34,0x41,0x7E,0x32,0x59,0x31,0x35,0x30,0x30,0x23,0x3F};
Serial1.write(input, sizeof(input));

I did not receive any dummy data from an inverter.

Using Arduino Mega 2560 :

byte input1[] = {0x3F,0x23,0x7E,0x34,0x41,0x7E,0x32,0x59,0x31,0x35,0x30,0x30,0x23,0x3F};
Serial1.write(input1, sizeof(input1));

(Note: I passed each Hex separately).

Receive Dummy Data from Arduino. Then I pass :

byte input1[] = {0x3F,0x23,0x7E,0x34,0x42,0x7E,0x23,0x3F};
Serial1.write(input1, sizeof(input1));
 if (Serial1.available() > 0)
   {
      
    for(int n=0; n<100; n++)
        {
         buf[n] = Serial1.read();
                  Serial.println(buf[n],HEX);
        }    

    }

I receive a few chunks (ie. 3-4 bytes and the FFFFF) data, not coming whole data.
Output Data : 2341FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Baud Rate: 9600, config Default
What is the issue?

Using RS232 to USB: I was able to read data from python script.