By default, a voltage regulator keeps a voltage constant. We can use this to our advantage when creating a constant current source by putting a fixed resistance on the output (Vout) pin, and connecting the Adjust pin to the Vout, after the resistance. Ohm’s law dictates that constant voltage + constant resistance = constant current. (More info on the LM317 is here: http://en.wikipedia.org/wiki/LM317 .)
Solder the circuit on the proto board following the photos here and the schematic diagram in Step 1. I used the following wire colors: 3.3V orange, 9V yellow, 5V red, Ground black, Signal white. Green wires connect the current pot.
The 100µF electrolytic capacitor is connected directly across the 2 series solar panels. This filters out power fluctuations and extends battery life. Polarity is critical: the cap’s positive lead goes to the positive solar panel lead, and its negative lead goes to the other panel’s negative lead.
To use one of the solar panels as a light level sensor, you have to be sure the signal voltage doesn’t exceed 5.5V, which is all the Arduino’s analog input will tolerate. Attach the 5.1V Zener diode across the positive and negative wires, as shown in the first photo here. Polarity is important here, so be sure to install it the right way. This will limit or “clamp” the voltage at 5.1V — you lose some power, but you protect your Arduino. Solder a red wire to the positive side of the Zener diode — you’ll connect this to the Arduino A0 pin later.
Add the variable regulator (LM317) and put a 5K or 1K potentiometer and the 10Ω fixed resistor in series with the output (middle, Vout) pin. Then connect the Adjust pin (left) to the output after the resistance. By adjusting this potentiometer, you can get a constant 17mA current output in full sunlight. There will be a small voltage drop from using the regulator, but as long as it stays above 9V, it’ll charge the battery. You can vary R3’s value to adjust the range of the current control; its value must be between 0.8Ω and 120Ω to protect the LM317. With the 10Ω resistor we got about 70mA that we could adjust down to the correct range using the current pot.
The 5K potentiometer marked R1 on the schematic is used as a potential divider. The solar panels are rated at 6V and the Zener diode should limit voltage to 5.1V, but not all diodes are created equal. By adjusting this pot you can reduce the signal voltage further if needed, to protect the Arduino. It’s a “belt and braces” approach: the first pot limits the voltage absolutely, the second limits it relatively.