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!
Sadly it was not on hand when I originally designed this project

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!

This guide was first published on Apr 21, 2013. It was last updated on Apr 21, 2013. This page (Analog Stuff) was last updated on Feb 15, 2020.