Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Solar battery monitor

Status
Not open for further replies.

nsaspook

Well-Known Member
Most Helpful Member
I'm building a solar battery monitor using a pic18f8722 controller board for my small scale off-grid project. I can generate about 8-9 Ah of charging current from the current solar array to two sets of batteries connected to a 2Kw pure sine-wave inverter using a boat 1/2/both/off 300A switch.

Cell 1 is a bi-mart deep-cycle that supplies 30Ah for 2 hours to below 50% charge. (400W load)
Cell 2 is a used DEKA type 31 & 50Ah for 2 hours. (600W load)
The normal load is about 200W for a small TV, fan and music system with LED lighting.

The goal is to know the run-time and state of charge of the cells so the best charging method is used to keep things topped off for when the AC power is needed for a outdoor media/sun room.

The software is written using C18 and MPLAB with mainly relay switching for power. The solar charge controller is XANTREX C40. The PIC controller will store the operational data and send via a RS-232 port a complete report of all parameters for data logging and history.

The current version is "alpha" with most things working. I'll post a link here for the latest version with hardware diagrams. A lot of the stuff is salvaged junk from work.

Build slideshow. solar project


I will post the diagrams and software here (GPL'd) for others to use or modify for their own use.

Download link... http://mysite.ncnetwork.net/res02dad/sitebuildercontent/sitebuilderfiles/swm8722.zip
 
Last edited:
Updated first post with download link to current software source code.
 
MPLAB C18 source code updated. Link on first post.
 
LCD status display, update.

MPLAB C18 source code updated. Link on first post.

**broken link removed**

(after controller reboot, not synced with real battery state yet)
Battery 1&2:
Voltage, run-time (hr:min), state of charge (%), Ah used

Charge monitor:
Battery under charge. Max time on charger if C40 didn't go to float mode (monitor LED).

Pv voltage, Battery voltage, charge amps
Edit/Delete Message
 
After working in rain for 2 months, it's finally above 80 here. Took some photos of the system in operation powering the sun-room outdoors. Flickr slideshow. solar project

Dual inverter power monitor screen. Battery 1 running inverter in float charge mode.
Line 2: PV input voltage CC output voltage, charge current.
Lines 3&4: battery 1/2 voltage,run time at current usage, soc, Ah used.
http://farm5.static.flickr.com/4022/4693984527_02e56de9e5_b.jpg

Analog meters for PV input.
http://farm5.static.flickr.com/4029/4693983987_3569f2a4d1.jpg

Solar arrays: Unistrut and old Sat dish mount.
http://farm5.static.flickr.com/4025/4694617830_536114087c_b.jpg

Old TV with dtv converter box, cheapo am/fm cd player and cooling fan.
http://farm5.static.flickr.com/4064/4693983193_73d44566c6.jpg

C18 source code: Still under development but mostly working.
http://mysite.ncnetwork.net/res02dad/sitebuildercontent/sitebuilderfiles/swm8722.zip
 
Finally broke 1kWh generated today. Added a monitor controlled transfer switch to run some workshop and security lighting if we have excess power generated.

P PV input power: today, yesterday
I Inverter usage:
**broken link removed**
 
Basic networking is running using a simple master/slave comm protocol that can transfer binary blobs (C data structures) directly from one processor to the other.

The PIC32 is running a test program that just moves the data for now so I can add CRC checks and cleanup the network code.

Short video: DSCN2065 | Flickr - Photo Sharing!

PIC32 test code link: **broken link removed**
It's just a modded version of the uart demo. The structure types have to be defined with variable types that both the PIC18 and PIC32 C versions know the exact size of in mbmc.h
 
That's nice made me want to get off my lazy butt and make me one>
 
I've finished the basic PIC18/PIC32 serial network drivers /API and coded most of the basic callback functions for the web server on the Microchip TCPIP stack app.

The only real problem was getting the structure defines and alignments correct for both controllers. The PIC32 wants data on 4 byte hunks but the PIC18 packs structures to 1 byte. A few tricks with the GCC __attribute__ pragma fixed that.

Short Video: DSCN2067 | Flickr - Photo Sharing!
Downloads - solar-monitor - Microchip PIC18F8722 Solar battery/charge monitor MBMC - Google Project Hosting
 

Attachments

  • mbmc.png
    mbmc.png
    857.6 KB · Views: 229
Well, most of the fun stuff is done. The basic model for two way comms and control of the system from the web host, near real-time system status on the web and javascript generated charts from data cached on the host database collected from the controller. Next is the boring part of creating all the web pages, writing the chart functions and finding the bugs in software. :(

Short Video: DSCN2075 | Flickr - Photo Sharing!
**broken link removed**

WebFX has a great free chart/graph system in Javascript.
**broken link removed**
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top