solar_charge_2.JPG

Plugging into the Sun

Last Updated: 1/25/19

With a fascination for renewable energy technologies, I figured the best way to explore would be to build my own. So, I made a photovoltaic battery charger to charge my phone with sunlight.


Background

This is an older version of the current project, which now uses Li-ion cells and a Battery Management System (BMS). To view the current project, click here.

About a year ago after stopping work on Lookabout, I realized that while I was super passionate about renewables, I really had no hands-on experience with them. I was (& still am) very interested in solar and energy storage, so I made a point to start developing hands-on experience with renewables, with the end goal of building the device above: a photovoltaic battery charger. I began this project with no power electronics experience, and have since taught myself Arduino, taken a Power Systems class, taken a Senior Electronics Lab, and worked for a solar developer. With the project nearly completed, I decided to share its story, technical details, and difficulties here. So, without further ado, let’s dive in.

Components

  • Batteries: 8 Ni-MH rechargeable batteries from Panasonic, rated at 1.2V / cell with min. 1900mAh (link)

  • Photovoltaic Panel: 3W, 12V, 250mA from Sunnytech (link)

  • Microcontroller: Arduino/Genuino Uno (link)

  • Voltage Regulator: LM2575T-5.0 switching-mode regulator from Texas Instruments (link)

  • Various Circuit Components: Detailed below, mostly ordered from Digi-Key

The Circuit

If you’re not familiar with electronics, don’t worry! It’s simpler than it looks. The part of the circuit to the left of the batteries is responsible for charging the batteries, and the part of the circuit to the right of the batteries is responsible for charging the iPhone from the batteries. The components within each part all stem from accomplishing those functions, and there’s a toggle switch in the middle to control which part of the circuit is active.

circuit_v2.png

Determining the Charge Level of the Batteries

While it’s not critical to know how much charge is in the batteries for this application (if the phone doesn’t charge, the batteries are dead), it is important for a number of industrial applications—like electric vehicles or utility-scale grid storage. Since this project was intended to be a learning sandbox, I decided to create a battery state of charge (SoC) estimation mechanism.

Total Cell Voltage Drop Model - A First Attempt

My first model planned to estimate the battery charge level by using the voltage drop across all 8 cells in series. Since the batteries have a signature discharge curve, I thought I could track the voltage drop from full charge to no charge and normalize those values to a 100 point scale. (This proved the be wrong.)

To create the model, I first needed to collect data on the voltage across the cells from their full charge to depletion. Instead of painstakingly copying numbers from the voltmeter to an Excel file, I turned my Arduino Uno into a voltmeter that automatically plotted the battery voltage to the Serial Monitor, from which I was able to create a Python script to write those values to a CSV file.

You can pull up my Github Repository for the project here.
The discharge curve provided by the battery manufacturer for Eneloop AA.

The discharge curve provided by the battery manufacturer for Eneloop AA.

My initial data on the battery cell voltage drop while charging my iPhone.

My initial data on the battery cell voltage drop while charging my iPhone.

The result, as you can see, was quite different from the predicted discharge curve. Why? The load in the circuit (my iPhone) had variable resistance. My iPhone was at roughly 65% when I started charging and ended around 80%. I predict that the resistance of the iPhone (and the ensuing input impedance to the voltage regulators) changes as the iPhone’s battery charge level changes. As a result, the total cell voltage steadily decreased before increasing to a final voltage drop higher than that of when I started charging.

It was clear that this model was flawed, so with a little research, I discovered a mechanism called Coulomb Counting.

The Coulomb Counting Model

The 1N5817-T Schottky Diode prevents the batteries from charging the panel, while also only allowing the batteries charge to a max 11.55V. The 1N5348 zener diode only allows current to pass if the batteries have reached at least 11V.

The 1N5817-T Schottky Diode prevents the batteries from charging the panel, while also only allowing the batteries charge to a max 11.55V. The 1N5348 zener diode only allows current to pass if the batteries have reached at least 11V.

In this method, I literally count the Coulombs (i.e., charges/electrons) leaving the battery. Each cell is rated at a minimum of 1.9 Ah with a nominal voltage of 1.2 V, so I’ll start by assuming that a full battery can supply 2.28 Wh. Since I have 8 cells in series, my net capacity is 2.28 Wh * 8 = 18.24 Wh / (1.2 V * 8) = 1.9 Ah = 6,840 C. I converted my Arduino voltmeter into an Arduino ammeter, which tells me how many Coulombs are leaving the battery per second (1A = 1C/s). I then used the time interval between measurements and multiplied it by the average current during the period to calculate the number of coulombs that left the battery.

I know that the batteries are essentially fully charged when they reach roughly 11V, so I use an 11V zener diode in the solar charging half of the circuit to check when the batteries are sufficiently charged. (The solar panel puts out 12V with a .45V drop across the Schottky diode, so the batteries can technically charge up to 11.55V, which is right around their max on the Panasonic data sheet.) So, I begin the counting assuming 6,840 C at full charge.

You can pull up the Github Repository for my Arduino Coulomb Counter here (link coming shortly).

Measuring Current

The Arduino measures the voltage drop between A0 and GND, which are wired to the top and bottom of the resistor, respectively.

The Arduino measures the voltage drop between A0 and GND, which are wired to the top and bottom of the resistor, respectively.

Before the batteries connect to the two 5V switching mode regulators, all current goes over a 1 ohm power resistor (shown above on the right). By measuring the voltage drop across this resistor, I can use Ohm’s Law to find the current (which is equal to the voltage drop since R = 1 in this case). Unfortunately, the Arduino Uno’s analog pins can only read a voltage drop from pin to ground, rather than pin to pin. To circumvent this issue, I wired the Arduino’s ground to the bottom of the resistor so that the analog pin only reads the voltage drop across the power resistor.

I am currently powering the Arduino via USB from my computer until I can figure out how to accurately measure voltage between two analog pins. To power the Arduino via the batteries, I have to wire the Arduino’s ground to the battery ground, which prohibits measuring the voltage drop across the power resistor. (Since I want this to be a standalone device, I must eventually overcome this issue, but for the time being I am focusing on learning the fundamentals of Coulomb Counting and refining the accuracy.)

What’s Next

I will be using an op-amp to isolate the voltage drop across the 1 Ohm power resistor from ground, which will allow me to power the Arduino via the circuit and not my computer.

I will additionally be working extra hours on this project during my Senior Lab, and plan on creating a more complex BMS with SoC estimation using 3.7 V Li-ion cells.

I also think it’d be great to build a single-axis tracking mechanism for the panel, and then eventually turn that into a dual-axis tracking mechanism. I’d also like to tweak the Arduino so that it stores Coulomb values between being powered on and off.

Nevertheless, I’ve already learned more than I could have imagined about circuits and sparked what is turning out to be a serious passion.