Close
0%
0%

Web based solar panel monitoring/managment

Arduino enable web server to monitor a small solar array and power management systems.

Similar projects worth following
This is an arduino enabled web server that will monitor voltage and current generated from a small solar array, Will also monitor voltage and current charging the battery as well as current and voltage going to the load.

This will be done in stages, first is a simple web server.
Then add voltage collection to the web server.
After that add current monitoring.
Then some sort of logging of the collected data and someway to view it.
Final is cleaning up web page.

Build an Arduino powered and web enable voltage and current system  to monitor power coming in from my solar panels, Power from the charge controller to the batteries and power from the battery to the load.

This project is built for 3 ports, but can split out to any number of ports needed for your project.

  • 1 × Arduno nao
  • 1 × cheap ebay UNO W5100 network interface (non shield, but shield will work). W5100 Ethernet Network Module for Arduino UNO W5100
  • 1 × pololu.com ACS715 Current Sensor (30 amps for my project but the 10,30 or 90A will work) Current Sensor module upto 30 amps
  • 1 × Radio shack proto board to fit your prject box. Used to mount the current senor and voltage divider
  • 1 × 10K ohm resistor and a 3K ohm pot. (pot only need if you want to adjust the voltage

View all 7 components

  • 2 years after

    Gary02/07/2016 at 19:42 0 comments

    Project has been running for over 2 years now and has been providing good solid data. I have had 2 ocassions that the unit hung up and both times we had storms in the area. A quick power cycle and the arduino was back up and running.

  • Thats all folks

    Gary10/12/2014 at 00:31 0 comments

    For now the project is complete. If I find any issue Ill post them up. If you have questions please drop me a note. good luck.

  • Arduino Sketch

    Gary10/12/2014 at 00:30 0 comments

    Here is the Arduino Sketch. Nothing fancy. It is a mix of my code, code fragments from other peoples projects as well as vendor sample code.

    #include <SPI.h>

    #include <Ethernet.h>

    // Enter a MAC address and IP address for your controller below.

    // The IP address will be dependent on your local network:

    byte mac[] = {

    0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xee

    };

    IPAddress ip(192, 168, 1, 178);

    IPAddress gateway(192, 168, 1, 1);

    IPAddress subnet(255, 255, 255, 0);

    // Initialize the Ethernet server library

    // with the IP address and port you want to use

    // (port 80 is default for HTTP):

    EthernetServer server(80);

    float current_input_value = 0; // value read from the carrier board

    float amps = 0;

    void setup() {

    // Open serial communications and wait for port to open:

    Serial.begin(9600);

    while (!Serial) {

    ; // wait for serial port to connect. Needed for Leonardo only

    }

    // start the Ethernet connection and the server:

    Ethernet.begin(mac, ip);

    server.begin();

    Serial.print("server is at ");

    Serial.println(Ethernet.localIP());

    }

    void loop() {

    float voltage;

    float watts;

    char buffer[10];

    String S_label ;

    String S_voltage ;

    String S_amps ;

    String S_watts ;

    String S_print = S_label + S_voltage + S_amps + S_watts;

    // listen for incoming clients

    EthernetClient client = server.available();

    if (client) {

    Serial.println("new client");

    // an http request ends with a blank line

    boolean currentLineIsBlank = true;

    while (client.connected()) {

    if (client.available()) {

    char c = client.read();

    Serial.write(c);

    // if you've gotten to the end of the line (received a newline

    // character) and the line is blank, the http request has ended,

    // so you can send a reply

    if (c == '\n' && currentLineIsBlank) {

    // send a standard http response header

    client.println("HTTP/1.1 200 OK");

    client.println("Content-Type: text/html");

    client.println("Connection: close"); // the connection will be closed after completion of the response

    client.println("Refresh: 5"); // refresh the page automatically every 5 sec

    client.println();

    client.println("<!DOCTYPE HTML>");

    client.println("<html>");

    //get the volatage

    voltage=get_voltage(A0); //get volatge on A0

    //Get the Current

    current_input_value = analogRead(A1);

    amps = float ((((long)current_input_value * 5000 / 1024) - 500 ) * 1000 / 133)/1000;

    if (amps < 0 )

    amps = 0 ; // Get rid of sensor noise when currentt is at/near zero.

    watts=(amps * voltage);

    S_label = "Panel" ;

    S_voltage = dtostrf(voltage, 2,2, buffer );

    S_amps = dtostrf(amps, 2,2, buffer );

    S_watts = dtostrf(watts, 2,2, buffer );

    S_print = S_label + " " + S_voltage + " " + S_amps + " " + S_watts;

    client.println (S_print);

    client.println ("<br>");

    //get the volatage

    voltage=get_voltage(A2); //get volatge on A5

    //Get the Current

    current_input_value = analogRead(A3);

    amps = float ((((long)current_input_value * 5000 / 1024) - 500 ) * 1000 / 133)/1000;

    if (amps < 0 )

    amps = 0 ; // Get rid of sensor noise when currentt is at/near zero.

    watts=(amps * voltage) ;

    S_label = "Battery" ;

    S_voltage = dtostrf(voltage, 2,2, buffer );

    S_amps = dtostrf(amps, 2,2, buffer );

    S_watts = dtostrf(watts, 2,2, buffer );

    S_print = S_label + " " + S_voltage + " " + S_amps + " " + S_watts;

    client.println (S_print);

    client.println ("<br>");

    //get the volatage

    voltage=get_voltage(A4); //get volatge on A5

    //Get the Current

    current_input_value = analogRead(A5);

    amps = float ((((long)current_input_value * 5000 / 1024) - 500 ) * 1000 / 133)/1000;

    if (amps < 0 )

    amps = 0 ; // Get rid of sensor noise when currentt is at/near zero.

    watts=(amps * voltage);

    S_label = "Load" ;

    S_voltage = dtostrf(voltage, 2,2, buffer );

    S_amps = dtostrf(amps, 2,2, buffer );

    S_watts = dtostrf(watts, 2,2, buffer );

    S_print = S_label + " " + S_voltage + " " + S_amps + " " + S_watts;

    client.println (S_print);

    client.println ("<br>");

    client.println("</html>");

    break;

    }

    if (c == '\n') {

    // you're starting a new line

    currentLineIsBlank = true;

    }

    else if (c != '\r') {

    // you've gotten a character on the current line

    currentLineIsBlank = false;

    }

    }

    }

    // give the web browser...

    Read more »

  • Burn in.

    Gary10/12/2014 at 00:21 0 comments

    The completed project has been running for several weeks. No major issues and seem to be collecting data correctly. While I check on the device via the web from time to time just see power levels. I mainly collect the data every 5 minutes from a Linux server running on my VM server. A simple curl script can pull and parse the data into a CSV file that I can use as needed. Long term I will look at putting this into a web site to do trending, but for now I can graph the data as needed.

  • Online

    Gary09/24/2014 at 00:54 0 comments

    Project has been online for a few days and starting to get some data captured. The current portion of the circuit seems to be working fine, but the voltage seems to never get below 11v on all 3 channels.. When there is sun the panel voltage go up but non of them tend to go below 11 volts. I suspect some cross talk. Will have to look at how to fix this....

  • Moved into postion

    Gary09/14/2014 at 00:07 0 comments

    Was also able to move the board into position in the solar panel charging room. 

    Will let it soak for a few days and see how well it works.

  • more time

    Gary09/13/2014 at 23:54 0 comments

    Was able to get the project mounted in  a case. The cut outs are a bit messy but it will work. Best I could do with the dremel tool..

  • Project time....

    Gary09/13/2014 at 22:23 0 comments

    Now that I have some space to work I was able to get the project wired and into position for testing.

    1st step was to get the voltage/current sensors connected to the Nano. I switched from the  larger wire to wire wrap wire to minimize  my soldering on the Nano chip.  Currently only tacked the a couple of pins. The rest was wire wrap.  Soldering is pretty crappy looking. Between a board that didnt take solder very will and my eye it was interesting soldering. I need a better magnifier..

  • I am back.....

    Gary09/13/2014 at 22:16 0 comments

    Been busy with other projects. Main project was rebuilding the "shack" to make hobby time a little easier.. painted walls, new floorts, new counter tops, shelves, cabinets... looking much better  and I now have room to do work.

  • Not dead yet

    Gary08/17/2014 at 13:27 0 comments

    Still around but other projects have been filling my time. ...

View all 45 project logs

  • 1
    Step 1

    The project is just a typical bread board project. use what ever techniques your comfortable with. I use a mix of soldering for the voltage and current collectors and use wire wrap to tie those collectors back to the Arduino. One mistake I made that cause re-work was a case that was to small... While you can built this to whatever size you can fit it into my large Anderson power poles determine the project case width. I also use #10 wire to go from the power poles to the current sensors. I would recommend moving down to a size #12. The #10 was difficult to bend to mate up with the current sensors.

View all instructions

Enjoy this project?

Share

Discussions

aarthiece101 wrote 02/01/2017 at 17:27 point

can I get the circuit diagram for this project

  Are you sure? yes | no

Gary wrote 09/19/2015 at 14:21 point

The voltage is measured with a simple resitor voltage divider network, this is required if your voltage is over 5v. with the divider the voltage from your source is scaled down to 0-5v. For the current sensor I used the ACS715 Current Sensor, this sensor takes upto 30 amps and scales the output to a 0-5v that the arduino can handle.

  Are you sure? yes | no

sahamad.htd wrote 09/04/2015 at 07:48 point

which hardware is used to measured  load/current ?thanks in advace 

  Are you sure? yes | no

Gary wrote 07/06/2014 at 19:14 point
Now that I have several people following the project, Anyone have any questions or comments?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates