loading

I bought an MPPT TRACER 3215RN Solar Charge Controller, made by EP Solar (I've also seen SainSonic mentioned as the manufacturer, but it's the same product). I wanted to use my computer to monitor the PV panel and battery instead of buying the manufacturer's MT-5 Remote Meter, (a) because I wanted to log the data on my computer, and (b) why spend $36 when you don't need to.

I hunted around on the Internet and found a straightforward way of doing this with an Arduino Uno. I hope it works for you.

Step 1: Prepare Ethernet Cable

Get an Ethernet cable. It makes your head spin when you start looking into connector standards (technically the Tracer uses 8P8C), but so long as it has 8 wires it should be ok.

Cut the connector off one end.

Plug the end with the connector still on it into the Tracer.

On the end you just cut, use a multimeter to determine which wires are which:

- 4 of them will be ground

- 2 of them will be approx +12V

- 2 of them will be approx +3.3V

Trim off three of the ground wires and the two 12V wires, so you're left with one ground wire and the two 3.3V wires.

I then soldered breadboard wires to the three used wires to make it easy to hook up to the Arduino.

Step 2: Install This Arduino Sketch

This Arduino sketch (and most of the info in this posting) is from https://github.com/xxv/tracer However they used a serial baud rate of 57600, I had to drop it to 9600 to work on my Arduino/computer combination.

I had some trouble copying and pasting the sketch below because of unsupported characters, so if you get any errors with the sketch get the original from the github site.

/*
* An interface to the Tracer solar regulator. * Communicating in a way similar to the MT-5 display */

#include

SoftwareSerial myserial(10, 11); // RX, TX

uint8_t start[] = { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xEB, 0x90, 0xEB, 0x90, 0xEB, 0x90 }; uint8_t id = 0x16; uint8_t cmd[] = { 0xA0, 0x00, 0xB1, 0xA7, 0x7F };

uint8_t buff[128];

void setup() { Serial.begin(9600);

myserial.begin(9600); }

float to_float(uint8_t* buffer, int offset){ unsigned short full = buffer[offset+1] << 8 | buff[offset];

return full / 100.0; }

void loop() { Serial.println("Reading from Tracer");

myserial.write(start, sizeof(start)); myserial.write(id); myserial.write(cmd, sizeof(cmd));

int read = 0;

for (int i = 0; i < 255; i++){ if (myserial.available()) { buff[read] = myserial.read(); read++; } }

Serial.print("Read "); Serial.print(read); Serial.println(" bytes");

for (int i = 0; i < read; i++){ Serial.print(buff[i], HEX); Serial.print(" "); }

Serial.println();

float battery = to_float(buff, 9); float pv = to_float(buff, 11); //13-14 reserved float load_current = to_float(buff, 15); float over_discharge = to_float(buff, 17); float battery_max = to_float(buff, 19); // 21 load on/off // 22 overload yes/no // 23 load short yes/no // 24 reserved // 25 battery overload // 26 over discharge yes/no uint8_t full = buff[27]; uint8_t charging = buff[28]; int8_t battery_temp = buff[29] - 30; float charge_current = to_float(buff, 30);

Serial.print("Load is "); Serial.println(buff[21] ? "on" : "off");

Serial.print("Load current: "); Serial.println(load_current);

Serial.print("Battery level: "); Serial.print(battery); Serial.print("/"); Serial.println(battery_max);

Serial.print("Battery full: "); Serial.println(full ? "yes " : "no" );

Serial.print("Battery temperature: "); Serial.println(battery_temp);

Serial.print("PV voltage: "); Serial.println(pv);

Serial.print("Charging: "); Serial.println(charging ? "yes" : "no" );

Serial.print("Charge current: "); Serial.println(charge_current);

delay(1000); }

Step 3: Connect Wires to Arduino

Connect the ground wire to Arduino ground.

One of the 3.3V wires connects to Arduino pin 10, and the other 3.3V wire connects to Arduino pin 11. There's probably a way of telling which goes which from the colors (comments welcome!), but there's only 2 wires so just swap them if it doesn't work first time.

Watch the results in the serial window (terminal emulator) on your computer.

Good luck!

<p>I made it, but it doesn't work. :(<br><br>I use controller Tracer 2210 -&gt; works fine<br>I use Arduino Mega, serial 2 (17=RX, 16=TX)<br>I use the exact same sketch from here above.<br><br>After I sent the initialisation strings, I do get a response from the controller that I can see on my osciloscope. I've put a &quot;schmitt trigger&quot; in front of the RX pin so that I get nice 5V pulses on pin 17.<br>On my serial, I see nothing but ZERO's (except the temperature which is -30)<br><br>Baud rates are both set to 9600<br>I tried 15 and 14 as RX and TX, but the same result.<br>When I try another baud rate , I don't get nothing back from the charger.<br>I tried without the schmitt trigger : same result (pulses are only 3V)<br><br>What did I do wrong ?</p>
<p>Use this code for Arduino MEGA :</p><p>/*<br> An interface to the Tracer solar regulator.<br> Communicating in a way similar to the MT-5 display<br> for ARDUINO MEGA<br>*/<br>// DO NOT include &lt;SoftwareSerial.h&gt; !!<br>// connect RX from MT5 to pin 14 of Arduino MEGA<br>// connect TX from MT5 to pin 15 of Arduino MEGA<br>// Arduino MEGA has 3 Serials. Serial3 is standard 14/15 !!<br><br>uint8_t start[] = { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55,<br> 0xEB, 0x90, 0xEB, 0x90, 0xEB, 0x90<br> };<br>uint8_t id = 0x16;<br>uint8_t cmd[] = { 0xA0, 0x00, 0xB1, 0xA7, 0x7F };<br>uint8_t buff[128];<br><br>void setup() {<br> Serial.begin(9600);<br> Serial3.begin(9600); // &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Notice the 3 !<br>}<br><br>float to_float(uint8_t* buffer, int offset) {<br> unsigned short full = buffer[offset + 1] &lt;&lt; 8 | buff[offset];<br> return full / 500.0;<br>}<br><br>void loop()<br>{<br> Serial.println(&quot;-------------------------------------&quot;);<br> Serial.println(&quot;Reading from Tracer&quot;);<br><br> Serial3.write(start, sizeof(start));<br> Serial3.write(id);<br> Serial3.write(cmd, sizeof(cmd));<br><br> int read = 0;<br><br> for (int i = 0; i &lt; 255; i++) {<br> if (Serial3.available()) {<br> buff[read] = Serial3.read();<br> read++;<br> }<br> }<br><br> Serial.print(&quot;Read &quot;);<br> Serial.print(read);<br> Serial.println(&quot; bytes&quot;);<br><br> for (int i = 0; i &lt; read; i++) {<br> Serial.print(buff[i], HEX);<br> Serial.print(&quot; &quot;);<br> }<br><br> Serial.println();<br><br> float battery = to_float(buff, 9);<br> float pv = to_float(buff, 11);<br> //13-14 reserved<br> float load_current = to_float(buff, 15);<br> float over_discharge = to_float(buff, 17);<br> float battery_max = to_float(buff, 19);<br> // 21 load on/off<br> // 22 overload yes/no<br> // 23 load short yes/no<br> // 24 reserved<br> // 25 battery overload<br> // 26 over discharge yes/no<br> uint8_t full = buff[27];<br> uint8_t charging = buff[28];<br> int8_t battery_temp = buff[29] - 30;<br> float charge_current = to_float(buff, 30);<br><br> Serial.print(&quot;Load is &quot;);<br> Serial.println(buff[21] ? &quot;on&quot; : &quot;off&quot;);<br><br> Serial.print(&quot;Load current: &quot;);<br> Serial.println(load_current);<br><br> Serial.print(&quot;Battery level: &quot;);<br> Serial.print(battery);<br> Serial.print(&quot;/&quot;);<br> Serial.println(battery_max);<br><br> Serial.print(&quot;Battery full: &quot;);<br> Serial.println(full ? &quot;yes &quot; : &quot;no&quot; );<br><br> Serial.print(&quot;Battery temperature: &quot;);<br> Serial.println(battery_temp);<br><br> Serial.print(&quot;PV voltage: &quot;);<br> Serial.println(pv);<br><br> Serial.print(&quot;Charging: &quot;);<br> Serial.println(charging ? &quot;yes&quot; : &quot;no&quot; );<br><br> Serial.print(&quot;Charge current: &quot;);<br> Serial.println(charge_current);<br> Serial.println();<br><br> delay(2000);<br>}</p>
<p>&quot;exact same sketch&quot; but of course changed SoftwareSerial myserial to (17,16) ! :)</p>
<p>Use this code for Arduino MEGA :</p><p>/*<br> An interface to the Tracer solar regulator.<br> Communicating in a way similar to the MT-5 display<br> for ARDUINO MEGA<br>*/<br>// DO NOT include &lt;SoftwareSerial.h&gt; !!<br>// connect RX from MT5 to pin 14 of Arduino MEGA<br>// connect TX from MT5 to pin 15 of Arduino MEGA<br>// Arduino MEGA has 3 Serials. Serial3 is standard 14/15 !!<br><br>uint8_t start[] = { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55,<br> 0xEB, 0x90, 0xEB, 0x90, 0xEB, 0x90<br> };<br>uint8_t id = 0x16;<br>uint8_t cmd[] = { 0xA0, 0x00, 0xB1, 0xA7, 0x7F };<br>uint8_t buff[128];<br><br>void setup() {<br> Serial.begin(9600);<br> Serial3.begin(9600); // &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Notice the 3 !<br>}<br><br>float to_float(uint8_t* buffer, int offset) {<br> unsigned short full = buffer[offset + 1] &lt;&lt; 8 | buff[offset];<br> return full / 500.0;<br>}<br><br>void loop()<br>{<br> Serial.println(&quot;-------------------------------------&quot;);<br> Serial.println(&quot;Reading from Tracer&quot;);<br><br> Serial3.write(start, sizeof(start));<br> Serial3.write(id);<br> Serial3.write(cmd, sizeof(cmd));<br><br> int read = 0;<br><br> for (int i = 0; i &lt; 255; i++) {<br> if (Serial3.available()) {<br> buff[read] = Serial3.read();<br> read++;<br> }<br> }<br><br> Serial.print(&quot;Read &quot;);<br> Serial.print(read);<br> Serial.println(&quot; bytes&quot;);<br><br> for (int i = 0; i &lt; read; i++) {<br> Serial.print(buff[i], HEX);<br> Serial.print(&quot; &quot;);<br> }<br><br> Serial.println();<br><br> float battery = to_float(buff, 9);<br> float pv = to_float(buff, 11);<br> //13-14 reserved<br> float load_current = to_float(buff, 15);<br> float over_discharge = to_float(buff, 17);<br> float battery_max = to_float(buff, 19);<br> // 21 load on/off<br> // 22 overload yes/no<br> // 23 load short yes/no<br> // 24 reserved<br> // 25 battery overload<br> // 26 over discharge yes/no<br> uint8_t full = buff[27];<br> uint8_t charging = buff[28];<br> int8_t battery_temp = buff[29] - 30;<br> float charge_current = to_float(buff, 30);<br><br> Serial.print(&quot;Load is &quot;);<br> Serial.println(buff[21] ? &quot;on&quot; : &quot;off&quot;);<br><br> Serial.print(&quot;Load current: &quot;);<br> Serial.println(load_current);<br><br> Serial.print(&quot;Battery level: &quot;);<br> Serial.print(battery);<br> Serial.print(&quot;/&quot;);<br> Serial.println(battery_max);<br><br> Serial.print(&quot;Battery full: &quot;);<br> Serial.println(full ? &quot;yes &quot; : &quot;no&quot; );<br><br> Serial.print(&quot;Battery temperature: &quot;);<br> Serial.println(battery_temp);<br><br> Serial.print(&quot;PV voltage: &quot;);<br> Serial.println(pv);<br><br> Serial.print(&quot;Charging: &quot;);<br> Serial.println(charging ? &quot;yes&quot; : &quot;no&quot; );<br><br> Serial.print(&quot;Charge current: &quot;);<br> Serial.println(charge_current);<br> Serial.println();<br><br> delay(2000);<br>}</p>
<p>Could you do Instructions for tracer BN series? It uses an RS-485 interface.</p><p>Description of communication protocol is http://www.solar-elektro.cz/data/dokumenty/1733_modbus_protocol.pdf</p>
<p>That would be great!</p><p>Lubsz, have you managed to get it to work?</p>
Working... epsolar BN series. I have 4215BN. <br><br>https://github.com/kasbert/epsolar-tracer
<p>I've been trying your script with a Tracer 4210A, and I can't get it to work. I'm using this USB cable:</p><p><a href="https://www.amazon.com/Battery-Temperature-Sensor-Monitoring-adapter/dp/B016RU8JUY/ref=cm_cd_al_qh_dp_i" rel="nofollow">https://www.amazon.com/Battery-Temperature-Sensor-...</a></p><p>What's strange is that it doesn't work using the Windows software from EPEVER either:</p><p><a href="http://www.epsolarpv.com/en/index.php/Technical/downloadF/id/801" rel="nofollow">http://www.epsolarpv.com/en/index.php/Technical/do...</a></p><p>Works great with my MT50 remote monitor box though. </p><p>Do you (or anyone) happen to have any idea what might be wrong, or something to test?</p>
<p>NICE!</p>
<p>I'm trying to read the data from a Tracer 4210a, which I gather is a BN series, which uses modbus. So far no luck, including with the Windows program &quot;Solar Station Monitor&quot; from EPEVER. It works just fine with the MT50 remote monitoring box though.</p><p>I'm using the USB cable from here:</p><p><a href="https://www.amazon.com/Battery-Temperature-Sensor-Monitoring-adapter/dp/B016RU8JUY/ref=cm_cd_al_qh_dp_i" rel="nofollow">https://www.amazon.com/Battery-Temperature-Sensor-...</a></p><p>Has anyone figured out how to read data from these controllers? </p>
<p>How it work with Windows10 iot + raspberry pi !!?</p>
<p>I followed your steps and it worked. TY!</p><p>On my Ethernet cable, I used brown as ground and stripe-blue went to arduino pin 10 (RX), and solid green went to arduino pin 11 (TX).</p>
<p>good work :-)<br><br>I also have an epsolar tracer (3215RN) and I <br>just finished my data logger: Arduino connected to tracer display (resp.<br> data) port saving a set of values every 5 seconds to a mySQL database. <br>Two arduinos showing everything on 4 OLED displays (SSD1306) in a 'black<br> box'. And 2 web pages for live and day view. Here're some pictures.</p><p>Have sun :-)</p><p>Oliver</p>
Nice work!
<p>Great work, hooked mine up to a raspberry pi and it sends it on to xively.</p><p>Wouldn't have managed to do it without this instructable.</p><p>Will make a instructable on that in a while.</p><p>On a standard RJ45, connect full blue to to pi RX and Green/white to TX, used orange to GND.</p>
<p>I am attempting to make this happen with my raspberry pi b+ but running into problems. I have tested that pin 5 &amp; 6 on the rj45 coming from mt-5 have 2v and 3v respectively. 5th pin on my ethernet cable is Tx according to schematic and white/blue. The 6th pin on ethernet is Rx and is green. I plug green into 15th pin on breadboard or bcm 14 (Tx PIN on GPIO) and white/blue into 16th breadboard/bcm 15 (Rx PIN on GPIO) and the brown ground into GND pin on GPIO. Controller Tx to PI Rx and Controller Rx to Pi Tx, then GND to GND. Do I need to use the Orange for ground or will any ground work?</p><p>I am also using cutecom with vnc to communicate. Any chance I can contact you directly?</p>
<p>Hi,</p><p>I aslo have the sme setup and tried to use your code to get the readings.</p><p>When I view the information in the serial window it only shows a lot of special characters over and over, did I miss a step or is there another setting I need to changeto get the right information?<br></p><p>I swapped the 2 wires on pin 10 and 11 aswell and no change..</p><p>Regards</p>
Sometimes getting weird characters is due to the wrong baud rate being set. You might want to check that everything is set to 9600, ie. ensure in the sketch it says Serial.begin(9600) and myserial.begin(9600).<br><br>Hope this helps.
<p>Is it possible to power of ethernet arduino by this solution?</p>
I tried using one of the +12V wires from the Tracer to power the Arduino and Ethernet board, but it didn't work. The Ethernet board needs a lot of power (they get really hot, which is normal) and there wasn't sufficient power from the Tracer. I needed to plug the Arduino into a dedicated power supply.
<p>Excellent!</p>
<p>This is awesome! What a good solution :D</p>

About This Instructable

12,277views

21favorites

License:

More by BF72:Use Arduino to Communicate with Tracer MT5 Charge Controller 
Add instructable to: