# Arduino Nano using Modbus on RS485

**URL:** <https://forum.arduino.cc/t/arduino-nano-using-modbus-on-rs485/1370475>\
**Category:** General Guidance\
**Created:** [April 4, 2025, 5:34pm UTC](https://forum.arduino.cc/t/arduino-nano-using-modbus-on-rs485/1370475 "2025-04-04T17:34:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![raff5184](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/raff5184/32/465743_2.png) [@raff5184](https://forum.arduino.cc/u/raff5184)\
**Post date:** [April 4, 2025, 5:34pm UTC](https://forum.arduino.cc/t/arduino-nano-using-modbus-on-rs485/1370475/1 "2025-04-04T17:34:33Z")

</div>

Hi,  
I am trying to figure out if and how I can use the Arduino Nano to communicate with a solar charge controller [MSC-N Series(20~40A) MPPT Charge Controller - EPEVER](https://www.epever.com/product/mscn-20-40a-mppt-charge-controller/) that has an RS485 com port.

I can communicate with this controller, using a PC, a cable "USB A (RS485)-to- Ethernet" that connects the PC (USB A side) to the controller (Ethernet side), and I can read/write the controller registers using a Python script.

My first question is: how do I connect the Arduino to the controller? Do I need a converter board, or just 2 GPIOs (besides GND and VCC) that I can connect to the USB-A side of the cable that I have? The cable should already have a converter inside.

As for the Arduino code, I assume I need to send messages using the ModbusMaster library, but I am not 100% sure

Thank you

---

<div class="post-metadata">

**Author:** ![markd833](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/markd833/32/1186928_2.png) [@markd833](https://forum.arduino.cc/u/markd833)\
**Post date:** [April 4, 2025, 5:50pm UTC](https://forum.arduino.cc/t/arduino-nano-using-modbus-on-rs485/1370475/2 "2025-04-04T17:50:28Z")

</div>

> [@raff5184](#):
>
> I can communicate with this controller, using a PC, a cable "USB A (RS485)-to- Ethernet" that connects the PC (USB A side) to the controller (Ethernet side), and I can read/write the controller registers using a Python script.

Are you sure that's an ethernet connection? The manual on the web page you linked to seems to show an RJ45 connector along with the pins used for RS485 comms.

> [@raff5184](#):
>
> My first question is: how do I connect the Arduino to the controller? Do I need a converter board, or just 2 GPIOs (besides GND and VCC) that I can connect to the USB-A side of the cable that I have? The cable should already have a converter inside.

Forget the cable you have that you use with your PC. In order to use the Modbus protocol with a Nano, you need a simple RS485 module like this one:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/f/b/8/fb836ad6c5f66630553dbb34d48d3cbdd0fcb89f.jpeg)

You then setup a software serial port on your Nano (don't use the hardware serial port) and connect the pins designated for Tx and Rx to the DI and RO pins on your RS485 module. The RE & DE pins on the module are generally joined together and connected to a 3rd pin on the Nano to control the data direction (Tx or Rx) of the MAX485 chip. The VCC and GND pins go to +5V and 0V on your Nano.

This discussion may help you get started:

> [@Arduino Nano and RS485 to read meter data](https://forum.arduino.cc/t/arduino-nano-and-rs485-to-read-meter-data/1006291):
>
> Hello, I've bought an energy meter (OB115-Mod) that supports RS485 I am trying to read it using an Arduino Nano; This is the register map of the device [image] I'm following this example which I intend to modify for my needs; I just want to read the voltage at the moment #include \<ModbusMaster.h\> /\*! We're using a MAX485-compatible RS485 Transceiver. Rx/Tx is hooked up to the hardware serial port at 'Serial'. The Data Enable and Receiver Enable pins are hooked up as follows: \*/ #…

---

<div class="post-metadata">

**Author:** ![raff5184](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/raff5184/32/465743_2.png) [@raff5184](https://forum.arduino.cc/u/raff5184)\
**Post date:** [April 4, 2025, 6:07pm UTC](https://forum.arduino.cc/t/arduino-nano-using-modbus-on-rs485/1370475/3 "2025-04-04T18:07:23Z")

</div>

Thank you for your quick reply. Yes, that's an RJ45 to be correct.

All clear, just one more question. To connect the RS485 to the controller it looks like I need to short every 2 pins: so 1 and 2 to VCC, 3 and 4 will go to pin B and so on?

---

<div class="post-metadata">

**Author:** ![kmin](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kmin/32/1147370_2.png) [@kmin](https://forum.arduino.cc/u/kmin)\
**Post date:** [April 4, 2025, 6:16pm UTC](https://forum.arduino.cc/t/arduino-nano-using-modbus-on-rs485/1370475/4 "2025-04-04T18:16:08Z")

</div>

What pins? Provide some scheme, most of us don't have MSC-N on the desk.

---

<div class="post-metadata">

**Author:** ![markd833](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/markd833/32/1186928_2.png) [@markd833](https://forum.arduino.cc/u/markd833)\
**Post date:** [April 4, 2025, 6:21pm UTC](https://forum.arduino.cc/t/arduino-nano-using-modbus-on-rs485/1370475/5 "2025-04-04T18:21:48Z")

</div>

> [@raff5184](#):
>
> it looks like I need to short every 2 pins

Are you referring to this diagram in the manual (attached):

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/a/a/c/aac50bc2a16aa557194b560b9a6641ac19b3aa38.png)

My interpretation of that is that the pairs of pins are internally connected. You don't need to do any "shorting" in your cable. Just use pins 3 (or 4), 5 (or 6) and 7 (or 8) and connect them to the RS485 module.

[MSC-N-Manual-EN-V2.0.pdf](https://forum.arduino.cc/uploads/short-url/vabfAqeIeWkpnTfov2womjA1gmm.pdf) (1.7 MB)

---

<div class="post-metadata">

**Author:** ![raff5184](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/raff5184/32/465743_2.png) [@raff5184](https://forum.arduino.cc/u/raff5184)\
**Post date:** [April 7, 2025, 8:24pm UTC](https://forum.arduino.cc/t/arduino-nano-using-modbus-on-rs485/1370475/6 "2025-04-07T20:24:43Z")

</div>

Thanks again @markd833 I followed your advice and it works!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 4, 2025, 8:25pm UTC](https://forum.arduino.cc/t/arduino-nano-using-modbus-on-rs485/1370475/7 "2025-10-04T20:25:03Z")

</div>

Closed on October 4, 2025, 8:25pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
