# Portable Solar Charging Tracker

## Introduction

## Portable solar charging tracker
https://vimeo.com/13936259

This is actually not any sort of product or public project (!) - it's something I designed to help me evaluate solar panels and how they act when charging batteries. [Normally this requires a lot of multimeters](http://voltaicsystems.com/blog/measuring-power-flow-with-two-multi-meters/) and it's a bit of a pain to do if you have to constantly change out panels. So I decided I would build a specialized tool that would assist me. Here is what I wanted!

- Portable! Its hard to test solar panels inside
- Ability to log to an SD card for long-term data analysis (to be added later)
- Keep track of the solar panel voltage
- Keep track of the battery voltage
- Keep track of how much current is going thru the panel to the charger

I figured if I had to build this, someone might find my notes useful. However, this documentation is primarly intended to demonstrate [how to use the enclosure we carry in the adafruit shop](http://www.adafruit.com/products/271).

![](https://cdn-learn.adafruit.com/assets/assets/000/007/506/medium800/tools_assembled.jpg?1396852901)

This design is intended for ~6V panels, single Lithium Polymer cells and chargers. It can very easily be adapted to any kind of panel and charger, you'll just need to adjust the resistor dividers and such!

![](https://cdn-learn.adafruit.com/assets/assets/000/007/507/medium800/tools_sensorend.jpg?1396852914)

Please note, this project **isn't** a solar-powered datalogger. You do need to power it with batteries, it's only meant for analysis of panels!

# Portable Solar Charging Tracker

## Parts List

The Arduino, case and display:

- [Adafruit Metro 328P (Arduino Uno Compatible)](http://www.adafruit.com/products/2488)
- [Enclosure for Arduino](http://www.adafruit.com/products/271)
- [16x2 LCD](http://www.adafruit.com/products/181)
- [0.1" header and potentiometer to go with the LCD, if you buy from the Adafruit shop they're included](http://www.adafruit.com/products/181)
- [Datalogging shield](http://www.adafruit.com/products/1141) or [prototyping shield](http://www.adafruit.com/products/2077) (we don't actually do any datalogging in this tutorial, so if you just want to view and not track, a protoshield will work just fine.)
- [Premium female jumper wires](http://www.adafruit.com/products/266) (You can also just use plain wire, but we wanted to be able to detach the LCD with ease.)

The analog electronics!

- [3 x 10K resistors](http://www.adafruit.com/partfinder/resistors#w_5_carbon)
- [1 x 47K resistor](https://www.adafruit.com/product/2786)
- [1 x 15K resistors](http://www.adafruit.com/partfinder/resistors#w_5_carbon)
- [1 x 1.0K resistor](http://www.adafruit.com/partfinder/resistors#w_5_carbon)
- [3 x 3.5mm terminal blocks](http://www.adafruit.com/partfinder/terminals?s%5B%5D=3.5mm "Link: http://www.adafruit.com/partfinder/terminals?s%5B%5D=3.5mm")
- [0.1 ohm (current sense) resistor](http://www.adafruit.com/products/808 "Link: http://www.digikey.com/product-detail/en/605HR100E/605HR100E-ND/823357?cur=USD")
- [8-pin DIP dual rail-to-rail input/output opamp (TS922 works well)](http://www.adafruit.com/products/808 "Link: http://www.adafruit.com/products/808")
- [8-pin DIP socket for opamp](http://www.adafruit.com/partfinder/sockets "Link: http://www.adafruit.com/partfinder/sockets")
- [3 x mono 3.5mm phono jacks](http://www.adafruit.com/partfinder/connectors#audiovideo "Link: http://www.adafruit.com/partfinder/connectors#audiovideo")
- [3 x mono 3.5mm phono plugs](http://www.adafruit.com/partfinder/connectors#audiovideo)

Then of course, the stuff to log. You can substitute other types of batteries & chargers.

- [6V 1W solar panel](http://www.adafruit.com/products/262)
- [Lipoly charger](http://www.adafruit.com/products/259)
- [Lithium poly battery](http://www.adafruit.com/products/258)

If you want to take it outside you'll need a portable power source, we like AA's but you can also use a 9V if you're not going to be out long.

- [6 x AA battery holder](http://www.adafruit.com/products/248 "Link: http://www.adafruit.com/products/248")
- [9V holder with switch](http://www.adafruit.com/products/67 "Link: http://www.adafruit.com/products/67")
- [9V battery clip](http://www.adafruit.com/products/80 "Link: http://www.adafruit.com/products/80")

# Portable Solar Charging Tracker

## Analog Stuff

There's a little bit of analog stuff going on. The two easiest parts to understand is the voltage dividers made of **R1** & **R2** and **R3** & **R4**. **R1** & **R2** take the 6V solar panel voltage and divide it by two (just make R1 = R2) so that the input to the analog converter is under 3.3V. Likewise, **R3** & **R4** take the as-high-as 4.2V lipoly voltage and divide it by 3/5 to get it down to under 3.3V so we can track that voltage.

The more complex part is the op amp that is used to measure the current draw. We stick a 0.1 ohm resistor between the negative wire of the solar panel and ground, so that we can measure the current going though the panel by measuring across the resistor. 1 Amp of current gets turned into 100mV (our panel can't do much more than 300mA which would be 30mV). This is low enough that doesn't affect the solar panel's charging ability. However, 30mV is really low and that's the maximum we expect from the panel. We use a non-inverting amplifer that amplifies that voltage to a bigger and easier to manage voltage. In particular. This amp multiplies the voltage by **1 + R6/R7** = 48x! That turns our 30mV max signal into 1.5V. The reason we don't amplify more is that I want to be able to use bigger panels that can provide 500mA or more, so a little headroom will be handy.

In general, I used resistors I had lying around on my desk (except the 0.1 ohm, that value is important) so feel free to adjust the values.

[If I were to build this project today, I'd use a proper high-side current sensor such as the INA219 which is precise, can measure high voltages, and is easy to use!](http://www.adafruit.com/product/904)  
Sadly it was not on hand when I originally designed this project![](https://cdn-learn.adafruit.com/assets/assets/000/007/509/medium800/tools_schem.png?1396852968)

Now to the soldering iron! This is actually the most annoying part. If you don't need datalogging - just the LCD feedback, you'll be happier if you solder this onto a protoshield as there's way more space. Click on the pictures for zoomed in shots. To solder, we bend over the wires and carefully solder together before clipping. It's sometimes a bit tough to follow so go slow and check your work at each step.

Note that we tie **ARef** to 3.3v for more stable analog readings - especially when using battery-powered portable loggers!

![](https://cdn-learn.adafruit.com/assets/assets/000/007/510/medium800/tools_analog.jpg?1396852986)

![](https://cdn-learn.adafruit.com/assets/assets/000/007/511/medium800/tools_analogbottom.jpg?1396853003)

![](https://cdn-learn.adafruit.com/assets/assets/000/007/512/medium800/tools_analog2.jpg?1396853019)

# Portable Solar Charging Tracker

## Casing

I'll start by prepping the case. For the bottom, snap in the pieces to cover the two holes.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/513/medium800/tools_casebottom.jpg?1396853031)

Place the Arduino so it lines up with the mounting holes.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/514/medium800/tools_arduninoplace.jpg?1396853045)

Attach! Use two screws, the third won't fit because the Arduino drill is too small.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/515/medium800/tools_arduinoscrew.jpg?1396853059)

# Portable Solar Charging Tracker

## LCD

Get the LCD out of the packaging. You'll need some sort of 10K potentiometer. We will use some header and premium socket jumpers but you can skip that part and just solder direct wires.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/517/medium800/tools_lcdprep.jpg?1396853095)

Solder the header in, then we clip the unused data pins to avoid confusion.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/519/medium800/tools_lcdheader.jpg?1396853117)

![](https://cdn-learn.adafruit.com/assets/assets/000/007/520/medium800/tools_lcdbot.jpg?1396853128)

Connect the LED backlight lines to the LCD logic power lines.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/521/medium800/tools_lcdpwr.jpg?1396853141)

Ground the RW pin (it's not used).

![](https://cdn-learn.adafruit.com/assets/assets/000/007/522/medium800/tools_rwjumper.jpg?1396853151)

And get rid of that pin as well as pins #1 and #2 (they are close to the mounting post so we'll connect to pins #15 and #16 instead).

![](https://cdn-learn.adafruit.com/assets/assets/000/007/523/medium800/tools_headertrim.jpg?1396853166)

Connect the 10K pot to 5V, pin 3 and ground.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/524/medium800/tools_pot.jpg?1396853176)

And clip pin 3.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/525/medium800/tools_potheader.jpg?1396853188)

Now we have the used 8 pins, from left to right: ground, power, D7 thru D4, RS and EN. Connect sockets.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/526/medium800/tools_sockets.jpg?1396853207)

And clip the other end.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/527/medium800/tools_cables.jpg?1396853218)

# Portable Solar Charging Tracker

## LCD Connect and Test

Start with connecting up power, red goes to +5V and black goes to ground. [Perform the tests in the LCD tutorial to verify the contrast pot works](http://learn.adafruit.com/character-lcds).

![](https://cdn-learn.adafruit.com/assets/assets/000/007/528/medium800/tools_lcdpower.jpg?1396853231)

Connect the remaining wires as such:

- EN → Digital #2
- RS → Digital #3
- D4 → Digital #4
- D5 → Digital #5
- D6 → Digital #6
- D7 → Digital #7

![](https://cdn-learn.adafruit.com/assets/assets/000/007/529/medium800/tools_lcdwired2.jpg?1396853246)

[Then try out the LCD by uploading the sketch](https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/Solar_Charger_Tracker). You should get the LCD working even if it's not displaying anything.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/530/medium800/tools_lcd1_t.jpg?1396853257)

![](https://cdn-learn.adafruit.com/assets/assets/000/007/531/medium800/tools_lcd2_t.jpg?1396853266)

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Solar_Charger_Tracker/solartrack/solartrack.ino

# Portable Solar Charging Tracker

## Mechanical

Now to connect the external panel and batteries and such. The terminal blocks are OK but not very elegant. Instead, I will use pluggable connectors. [Audio connectors will work well here and I only need 2 pins (ground and signal) per connection so mono 3.5mm headphone plugs and jacks are an inexpensive an easy-to-get solution](http://www.adafruit.com/partfinder/connectors#audiovideo). Be sure to get panel-mount jacks!

![](https://cdn-learn.adafruit.com/assets/assets/000/007/532/medium800/tools_connectors.jpg?1396853278)

Start with the JST cable that goes to the charger output (to measure the lipo). Unscrew the plug, slip thru the wire, Then solder each pin to crimpies. As a rule, you should always make 'sleeve' or 'ring' ground and 'tip' positive signal. Keeps things easy to track! ![](https://cdn-learn.adafruit.com/assets/assets/000/007/533/medium800/tools_jstphono.jpg?1396853292)

Crimp, making sure not to short the wires. This can be a bit challenging so use a multimeter to test!

![](https://cdn-learn.adafruit.com/assets/assets/000/007/534/medium800/tools_jstphono2.jpg?1396853308)

[Next, the miniB usb cable is stripped and the red and black wires pulled out](http://www.ladyada.net//solarlipo/index.html). We also use some heatshrink to protect the end of the cable.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/535/medium800/tools_usbphono.jpg?1396853319)

Crimp

![](https://cdn-learn.adafruit.com/assets/assets/000/007/536/medium800/tools_usbcrimp.jpg?1396853333)

Heat shrink!

![](https://cdn-learn.adafruit.com/assets/assets/000/007/537/medium800/tools_usbshrink.jpg?1396853348)

Next, the jacks. Connect any stranded wire to the sleeve and tip connections as shown.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/538/medium800/tools_phonosolder.jpg?1396853358)

We like heat shrink!

![](https://cdn-learn.adafruit.com/assets/assets/000/007/539/medium800/tools_phonoshrink.jpg?1396853372)

Connect the jacks to the terminal blocks.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/540/medium800/tools_phonowired.jpg?1396853382)

Now is a good time to test, before finishing it all up! Verify you're getting reasonable voltages from the panel and lipoly battery. If you can get near a window, see if you can get the battery charging.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/541/medium800/tools_test.jpg?1396853395)

# Portable Solar Charging Tracker

## Finishing

Of course, we want the panel mount jacks to be panel mounted. Grab the box end piece. It's made of ABS…

![](https://cdn-learn.adafruit.com/assets/assets/000/007/542/medium800/tools_boxend.jpg?1396853405)

Which means they're very easy to drill or machine!

![](https://cdn-learn.adafruit.com/assets/assets/000/007/543/medium800/tools_boxdrill.jpg?1396853415)

![](https://cdn-learn.adafruit.com/assets/assets/000/007/544/medium800/tools_phonos.jpg?1396853429)

We have a label maker so we made nice little labels!

![](https://cdn-learn.adafruit.com/assets/assets/000/007/545/medium800/tools_sensorend.jpg?1396853441)

The other side gets the precut case that covers the Arduino power and programming slot.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/546/medium800/tools_arduinoend.jpg?1396853453)

Ready to go! Here I show how I can try different panels by connecing alligator chips. The lipo input is from the passthrough connection on the charger. As the panel charges the battery I can track the voltages and current.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/547/medium800/tools_assembled.jpg?1396853466)


## Featured Products

### White Enclosure for Arduino - Electronics enclosure

[White Enclosure for Arduino - Electronics enclosure](https://www.adafruit.com/product/271)
Discontinued - **you can check these [Arduino accessories](https://www.adafruit.com/category/346)&nbsp;instead!&nbsp;**

&nbsp;

We are very excited to have one of the first (and we think the best) Enclosure for Arduino & project box! Here are all the...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/271)
[Related Guides to the Product](https://learn.adafruit.com/products/271/guides)
### Smoke Translucent Enclosure for Arduino - Electronics enclosure

[Smoke Translucent Enclosure for Arduino - Electronics enclosure](https://www.adafruit.com/product/821)
We are very excited to have one of the first (and we think the best) Enclosure for Arduino & project box now available in gray translucent plastic, the future! Here are all the details:

- Dimensions: 3.6" x 5" x 1.35"
- Injection molded gray translucent...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/821)
[Related Guides to the Product](https://learn.adafruit.com/products/821/guides)
### Clear Enclosure for Arduino - Electronics enclosure

[Clear Enclosure for Arduino - Electronics enclosure](https://www.adafruit.com/product/337)
We are very excited to have one of the first (and we think the best) Enclosure for Arduino & project box now available in clear plastic, the future! Here are all the details:

- Dimensions: 3.6" x 5" x 1.35"
- Injection molded clear plastic
- Enclosure is...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/337)
[Related Guides to the Product](https://learn.adafruit.com/products/337/guides)
### Adafruit METRO 328 - Arduino Compatible - with Headers

[Adafruit METRO 328 - Arduino Compatible - with Headers](https://www.adafruit.com/product/2488)
This is the&nbsp; **Adafruit METRO Arduino-Compatible - with&nbsp;headers.&nbsp;** It's a fully assembled and tested microcontroller and physical computing board with through-hole headers attached.&nbsp; If you don't want a&nbsp;Metro with the headers attached for...

In Stock
[Buy Now](https://www.adafruit.com/product/2488)
[Related Guides to the Product](https://learn.adafruit.com/products/2488/guides)
### Adafruit Assembled Data Logging shield for Arduino

[Adafruit Assembled Data Logging shield for Arduino](https://www.adafruit.com/product/1141)
Here's a handy Arduino shield: we've had a lot of people looking for a dedicated and well-designed data logging shield. We worked hard to engineer an inexpensive but well-rounded design. Not only is it easy to assemble and customize, it also <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1141)
[Related Guides to the Product](https://learn.adafruit.com/products/1141/guides)
### Adafruit Proto Shield for Arduino Unassembled Kit - Stackable

[Adafruit Proto Shield for Arduino Unassembled Kit - Stackable](https://www.adafruit.com/product/2077)
This prototyping shield is the best out there (well, we think so, at least), and now is even better with **Version R3** - updated for the most compatibility with just about all the Arduinos! It works with UNO,&nbsp;Mega, Leonardo, NG, Diecimila, Duemilanove, and compatible...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2077)
[Related Guides to the Product](https://learn.adafruit.com/products/2077/guides)
### Lithium Ion Polymer Battery - 3.7v 1200mAh

[Lithium Ion Polymer Battery - 3.7v 1200mAh](https://www.adafruit.com/product/258)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 1200mAh for a total of about 4.5 Wh. If you need a larger battery, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/258)
[Related Guides to the Product](https://learn.adafruit.com/products/258/guides)
### USB / DC / Solar Lithium Ion/Polymer charger

[USB / DC / Solar Lithium Ion/Polymer charger](https://www.adafruit.com/product/390)
Make your projects to go green this summer with our specialized USB/Solar Lithium Ion Polymer Battery charger! This charger is a very unique design, perfect for outdoor projects, or DIY iPod chargers. We've spent over a year testing and tinkering with this charger to come up with a plug...

Out of Stock
[Buy Now](https://www.adafruit.com/product/390)
[Related Guides to the Product](https://learn.adafruit.com/products/390/guides)

## Related Guides

- [Wave Shield Talking Clock](https://learn.adafruit.com/wave-shield-talking-clock.md)
- [Collin's Lab: Solar](https://learn.adafruit.com/collins-lab-solar.md)
- [Overwatch Prop Gun: Lucio's Blaster Pt. 1](https://learn.adafruit.com/overwatch-lucio-gun-pt1.md)
- [IR Sensor](https://learn.adafruit.com/ir-sensor.md)
- [Ladyada's Learn Arduino - Lesson #2](https://learn.adafruit.com/ladyadas-learn-arduino-lesson-number-2.md)
- [Ladyada's Learn Arduino - Lesson #1](https://learn.adafruit.com/ladyadas-learn-arduino-lesson-number-1.md)
- [Plotting Offline Data - JSONL to CSV files, filters and graphs](https://learn.adafruit.com/plotting-offline-data-jsonl-to-csv-files-filters-and-graphs.md)
- [Mystery Box: NeoMatrix Mk I](https://learn.adafruit.com/mystery-box-neomatrix-mk-i.md)
- [Adafruit VCNL4040 Proximity Sensor](https://learn.adafruit.com/adafruit-vcnl4040-proximity-sensor.md)
- [Micro SD Card Breakout Board Tutorial](https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial.md)
- [RGB LED Matrix Basics](https://learn.adafruit.com/32x16-32x32-rgb-led-matrix.md)
- [Motorized Camera Slider MK3 ](https://learn.adafruit.com/motorized-camera-slider-mk3.md)
- [Ladyada's Learn Arduino - Lesson #0](https://learn.adafruit.com/ladyadas-learn-arduino-lesson-number-0.md)
- [Solar Charging Handbag](https://learn.adafruit.com/solar-charging-handbag.md)
- [Arduino GPS Clock](https://learn.adafruit.com/arduino-clock.md)
