Imminent Work!

  • The ADS1015 reads noise whenever the inverter or solar contactor is switched off. This hasn't happened for a few days.
  • Estimated turn on and turn off times added to website.
  • Diagnostics added throughout. Nano can now relay errors to ESP32 and ESP32 can relay to server.

Introduction

Firstly, I'd like to say 'thanks' for visiting this website, and especially for visiting this page. If you have any comments, feel free to type them in the comments box at the bottom of this page.

From a young age, I've wanted to make a solar power station. I was always obsessed with achieving or understanding 'impossible' things. I seem to get curious and almost obsessive about things which I can't understand, and then I seem to get addicted to learning about them and then facing challenges which they bring. Anyway, now I've got the time, money and space, I'm able to give it a go!

Over the past year, many people have looked at what I'm doing with some degree of fascination. So, because of this, and after getting some inspiration, I decided to write this report on what I've been doing and how it works. It's taken me a year in order to create this system. For those of you who would like to make a similar thing, hopefully, this will save you a lot of time! For those of you who are just looking - welcome!

My system is somewhat different to most on YouTube and other blogging sites, this is because my system has a sophisticated brain which automatically makes lots of decisions on my behalf - it's a Micro-Controller called an ESP32. This brain decides when to switch solar on and when to switch it off basically. Not only does it decide, it actually carries it out too. The 'firmware' which has been flashed to the Micro-Controller has taken me about a year in order to get right. It's written in a language called C++, and I used an IDE called Arduino Studio.

What is an 'Offgrid Solar Power Station'?

A solar power system basically consists of a means of gathering energy from the sun, and a means of storing that energy in batteries, ready to be used. You then use something called an 'inverter' in order to convert that power into usable mains electric. 'Offgrid' means that it is in now way connected the the national grid. It's basically an independantly owned power station, and it's aim is to give you 'free' power.

An important point to note about solar power; The more intense the light is, the more energy is produced. It sounds like a stupid thing to say, but it's actually very important that you're aware of it. Because sunlight is available to us in such sporadic measures, therefore, so is any power which is produced from it. This is why you'd draw energy from batteries rather than directly from the panels. Power direct from the panels would betoo unreliable.

Past Solar Projects

I gained the knowledge in order to do all this through reading articles on the internet, books, and a year of trial and error. Infact, solar is the basis of my whole channel on YouTube.

I started off simple, with the basics; The 4 panels, two lead acid batteries and a cheap 600W modified sinewave inverter. I noticed that the inverter wasn't good enough for general applicances. It lacked power ofcourse, and the wave form seemed to upset some of my devices, (the PC would hum for example). After this, I upgraded to a 2500W, pure sinewave inverter. I realised that it's necessary to look after the lead acid batteries properly and ensure that they don't get drained. At this point I realised that it is better to use solar in the day, but use mains in the night.

After a while, I got contactors, and I'd switch a contactor on or off, depending on which I wanted to be on. I could operate the contactor from a switch. After a while, I wanted the process to be automatic. For it to be automatic though, I needed to use a micro-controller, feed it with data, let it decide for me, and then operate relays on my behalf. So, that is what I did! To start with, I used a Rapberry Pi Zero, but I found that it wasn't reliable or quick enough for my liking. It also had the overhead of an OS, which I didn't need. From there, I moved on to an Arduino Pro Mini + Raspberry Pi Zero, from there, I moved onto Arduino Nano + ESP8266, and finally I moved on to Arduino Nano + ESP32 which is where I'm at now.

How does it Generate Power?

To generate the power, I use 4 x 24V, 220W solar panels. They're Solar Europa CHN220-60P panels. The datasheet can be found here. They're situated on top of my (and my late neighbour's) shed roof. I made some adjustable stands for the panels, and bolted them down to the top of the flat roof. The stands can be set into pre-set positions, depending on the season. The sun is higher in the sky in Summer, and lower in Winter. The panels are wired in series/parallel with 40A cable - Two panels wired in series, and then those two banks are paralleled together using a 'Y' splitter. Two wires then feed through a hole in my Solar Shed, to an MCB.

Los Angeles
Los Angeles
Los Angeles
Los Angeles
Los Angeles
Los Angeles
Los Angeles
Los Angeles

How does it Store the Power?

From the panels and the MCB, the wires are then they get connected to the charge controller. The charge controller is an EPSolar Tracer 4215BN. (You can read about them here) I bought this from new in 2016 some time. The charge controller charges my batteries via another MCB. I have 12 x 75Ah, lead acid batteries, again, wired in series/parallel. I have 6 banks of batteries, each bank containing 2 batteries wired in series, to give 24V. Each bank has a 20A fuse fitted to it. I got the batteries from a reclaimation yard and tested each one when buying. They are VARTA VA0 batteries. The batteries are all connected using a home made manifold type thing, made of connector blocks and some 40A cable. The charge controller keeps the batteries topped up throughout the day and fills them back up after something has used up some of their stored energy.

Los Angeles
Los Angeles
Los Angeles
Los Angeles

How do we Use the Power?

To use the power, I have a 2500W pure sine wave inverter. There are two thick 25mm2 cables which go from the battery bank, through a 110A MCB, to the inverter. The inverter has a wired remote control, and by using it, I can manually override it, if I want to force it on. By default though, I leave the decision making up to my AI controller, which is an ESP32 micro-controller - I've hacked into the remote, and given the micro-controller power to use it in the form of a simple 5V 'Songle' relay. From the inverter, the power goes through an MCB and an RCD, this gives me a sort of RCBO functionality which makes it a lot safer to use.

The next point of contact is the contactors. There's a feed into the shed of mains electric too, aswell as solar from the inverter. Both power sources go into the contactors, and either one power source or the other feeds the output at the other end of the contactor block. The idea is that if the micro-controller decides that solar is the best choice, then solar will be the output, but if mains is the best choice, then mains will be the output.

My AI system controls the contactors via TIP41C transistors. From the output of the contactors, the power goes out to a socket, finally, for power to be used! So, basically, the output of this socket will either be mains power or solar power.

Los Angeles
Los Angeles
Los Angeles
Los Angeles

How does it Acquire Data?

Throughout all stages, the micro-controller gathers data, this is for it's own use, in order to make decisions, and also for me, so that I can understand things and learn more!

It gets Solar Voltage, Solar Amperage, Battery Voltage and Battery Charge Amperage from the charge controller via RS485/MODBUS. I do this using an Arduino Nano, an RS485 to TTL converter and an ethernet cable. Other data which is logged include; light and battery drain.

To get light data, I use an I2C BH1750 lux sensor, and to measure drain current, I use a 200A current shunt with an I2C ADS1015 standalone ADC.

I also store whether the AI system is on, which power source is currently enabled, and finally whether the inverter is on or off. The Nano polls the sensors at varying frequencies, averages the data, and then sends this data via serial to the ESP32 every second. The ESP32 uses the data, also does it's averaging, and then sends that data to my server every 15 seconds. I've written a program which is on my server which constantly awaits the data, filters it, separates it, parses it and sends it to SQL server.

Los Angeles
Los Angeles
Los Angeles
Los Angeles
Los Angeles
Los Angeles

About This Website

This website primarily shows data, which has been collected via the ESP32 data collection and transmission. It gets it's data from SQL server and is written in ASP.NET with a language called C#.

This website actually has the power to talk to the ESP32 and to send it commands. When this happens, it sends a message to the service running on my server which I just mentioned. That service sends the command to the ESP32 and the ESP32 replies back with an acknowledgement when the command has been actioned. These commands are also logged in SQL server.

What is the AI System?

The AI system is an ESP32, although as previously mentioned; there is also an Arduino Nano which sends it it's data. Using this data, it makes a decision as to whether solar should be on. Specifically, to decide whether solar should be on. It used to look at the battery voltage and the amount of light. If the voltage and light were above a certain level, it would powers up the inverter via a relay, then 50ms after, it would switch the contactors over from mains to solar power. Now however, it is a timer based system; the system requests yesterday's sunrise and sunset times from my server, then it switches on solar 1 hour before sunrise and switches off 1 hour before sunrise. When solar should no longer be on, it reverses the operation. The AI system also has a small TFT monitor as an output! This is so that I can conveniently view current statistics.

AI can be switched off. If the AI is switched off, then the user has to then decide on the power source and whether the inverter should be on or off manually. AI is basically the automatic decision-making process. The ESP32 will still carry out any commands via transistors and relays though. There is also a shutdown button, both on the website and a physical button near the micro-controller. This shut down button tells the ESP32 to stop making decisions, stop powering both transistors (therefore cutting power to the contactors, therefore cutting output power completely), and to stop powering the relay, therefore switching the inverter off. This completely disables all 250V power.

The AI system can be manipulated via the website, the service, a manual button or via the IR remote. When the IR remote or when a manual control is used, the TFT comes on. I did this with a PNP transitor. After 30 seconds, the backlight 'times out' and the the screen goes dark.

The AI control system can now tell the time too. It uses the NTP protocol in order to poll a server fo the time every hour. This currently isn't used for anything, but it will be used in the near future in the next AI control algorithm.

Los Angeles
Los Angeles
Los Angeles
Los Angeles
Los Angeles
Los Angeles

Evaluation & Future Plans

  • Adding a restart ESP button to the site.
  • Restricting web control to only me.
  • Powering the house.
  • Consolidate all functionality into the ESP32.
  • Add some casing.

Comments