Hello everyeone,
This is my very first forum post so please correct me if I'm doing something wrong.
I'm working on an Arduino sketch that communicates with my Growatt inverter.
This should allow me to receive various information from the inverter (e.g., output power, voltages, etc.).
The Growatt inverter supports RS232 communication so I've decided to buy an RS232 shield for my Arduino Uno.
To be exact, I'm using the RS232 Arduino Uno shield from Keyestudio: KS0406 keyestudio RS232 to TTL Conversion Shield Compatible with Arduino - Keyestudio Wiki
I've basically finished the software but for some reason I receive no response from the inverter over RS232.
To troubleshoot this, I've already tested several things, of which the following list of tests were succesful:
- I was able to connect the Arduino Uno using the RS232 shield and a straight-through cable (let's call this cable "cable A") to an RS232-to-USB converter to my laptop. I was able to receive the data properly and transmitted data from the laptop was received properly by the Arduino (this basically simulates the behavior of the inverter).
- I was also able to connect an RS232 straight-through cable (let's call this "Cable B") from the RS232-to-USB converter from my laptop to the RS232 port of the inverter. I was able to transmit the same data that the Arduino sketch is transmitting and actually received a proper response from the inverter.
Now for the weird part, when I use "Cable B" to connect the Arduino Uno using the RS232 shield directly to the inverter, no data is received from the inverter.
Using the results of the tests above, I think I can make a few assumptions:
- Cable B is wired properly, since I was able to use this cable to communicate from my laptop to the inverter.
- The RS232 shield seems to be working for both transmitting and receiving, since I was able to use "Cable A" to send and receive data to and from my laptop.
This leaves my quite puzzled to be honest, since everything seems to be in order.
As a final test, I took my digital oscilloscope to take a look at the TX and RX lines on the RS232 shield.
I noticed something interesting there.
When leaving the RS232 connector on the RS232 shield disconnected or when connecting it to my RS232-to-USB adapter on my laptop (using "Cable A"), the voltage levels varied between approx. -7V and +7V:
After connecting the RS232 connector to the inverter (using "Cable B"), I noticed that the voltage levels for the TX line (coming from the Arduino) dropped significantly to approx. -7V and -3V (so no positive voltages anymore at all):
As a truely final test I measured the voltages of the TX line of "Cable B" when I used that cable to connect my laptop to the inverter. I noticed that the voltages varied between approx. -7V and +7V, which I suppose is fine:
I suppose the dropping voltages explain the reason why the inverter does not respond, but I am absolutely clueless about why the voltages actually drop.
Does anyone have any idea what could be the reason for the dropping voltages?
Thanks in advance!
Kevin