Spark Core Power Shield (New Battery Shield!) [Prototype Stage]

@timb So If I’m following correctly it will be as easy as loading a sketch to via the IDE to change the battery type on the TI fuel gauge. If so thats a hell of alot easier than I thought it was going to have to be. Looking forward to the killer battery shield.

@RWB Yup, to break down what I posted above: The MSP430 MCU on the battery shield is going to talk to the Core over I2C to provide the battery level, charging status and GPIO control. Normally you’d use a JTAG programmer to flash the MSP430, but I’ve implemented a bootloader that will allow us to reflash over I2C. This will allow me to release new firmware after shipping the shield!

However, to change the battery type on the fuel gauge we won’t even need to reflash the MSP430 as I plan on implementing a set of commands that will let you change all the various parameters for the fuel gauge to implement custom profiles.

The MCU has two physical I2C interfaces: Basically the fuel gauge (and charging chip) will talk to the MSP430 over I2C#1 and the Spark Core will talk to the MSP430 over I2C#2. The MSP430 will apply the settings to the fuel gauge and charging chip on power up and take care of keeping track of the battery level, which the Spark Core can request at any time.

That all sounds great. Its crazy advanced. Your a Genius! LOL

Do you have any specific charging chips in mind?

A couple. I’ll post a link shortly!

In the mean time, what if I squeezed two small LEDs onto the back corners of the board?

You could toggle them through software for when on battery, but with a USB input they could show charging status. Maybe have the red LED slowly decrease in brightness and the green LED increases in brightness as the battery charges. Or you could have them fading in and out, the red one would fade quickly while the green one faded slowly and vice versa to indicate charge level. Just thinking of clever ways to show information with minimal space.

Edit: Oh, I’ve also added a crystal for the MSP430’s internal RTC; this could stay synced up to the Core’s RTC which would be set from the internet. We can use this for the optional features of turning the Core on at a set time and to timestamp sensor readings taken when the Core was off.

1 Like

Looks good.

As far as the battery status / SOC LED’s , couldn’t you just use 1 Dual Color (Red & Green) LED?

And for SOC status we could just use flashes to indicate SOC in 20% increments.

Red Flash - Battery Dead - Recharge
Green Flash x 1 = 20% SOC
Green Flash x 2 = 40% SOC
Green Flash x 3 = 60% SOC
Green Flash x 4 = 80% SOC
Green Flash x 5 = 100% SOC
Green Solid = Fully Charged While Charging

That would be good for me.

Timb. This looks insane… I love the solar integration and thanks for RWB for providing input. I’d love to put something together that used the big ball of burning gas. It looks like an crazy big job though… Don’t kill yourself.

This is awexome, especially with the super low power of the MSP430 FRAM.

I think this needs a BLE module on the bottom, so it can notify your phone/pebble/BTbracelet at the exact moment your charging is done... KIDDING!! wrap this beast up before it's like $99.99 with Arch Linux running on it :wink:

timb, you’re my hero!

:wink:

1 Like

+1 on using the ST SPV1040 as your solar boost converter.

Also I am in favor of limiting the charge current to the < 500mA available from the micro-USB port instead of having a second charge connector. Dealing with heat while operating at ~5Watts is something to keep an eye on.

If you would like any assistance from the software side, let me know.

After looking at the SPV1040 closer it really limits the kind of solar panels you can use with it because the maximum input voltage is limited by your maximum charging voltage which is in the 4v range. I would have to have custom solar panels made to work just with this chip and it would eliminate alot of the good choices as far as 5v solar panels go that you could use.

Rest assured I’m helping to choose a chip that will keep the most common 5-6v solar panels working at close to their Maximum Power Point without using a special MPPT chip, but will also allow the use of higher voltage solar panels also.

Have you considered building a buck-boost converter front end that can handle open circuit voltages in the range of, say, +20V and implementing the DC-DC converter + MPPT in the MSP430? Add solar input voltage and current detection, a current comparator for peak detection, and your basically there with a little extra software. The SPV1040 uses a switching frequency of only 100KHz which should be doable in the MSP430. If thats too fast… use a slightly larger inductor and reduce the switching frequency.

We really would not need boost, just buck down to the battery charging voltage which will be different depending on what battery type your using.

If implementing MPPT with a DC to DC chip and the MSP430 is easy then I would love to hear more, and get Tim’s feedback about this.

Not a dedicated DC-DC chip - the MSP430 could directly control the DC-DC converter circuit. Here is a simple design example, though its for an ST chip (http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/CD00116928.pdf) – Ok, yes I’m a ST guy.

Add the extra switch and support buck+boost so there’s still an option to get some power from the solar cell under low irradiance. Or if you want to stay single switch, implement a SEPIC converter for the solar front end - its 4 parts: a n-ch mosfet, a capacitor, a diode and a coupled inductor. Plus your voltage and current detection (op-amp, a few resistors or maybe a current sense amplifier).

Another option: keep the fuel gauge chip but implement the LIPO charger with the MSP430 as well. Then you have the ultimate flexibility over charge currents, charge voltages and timers for handling different battery chemistry.

What do you guys think about this?

http://www.ti.com/product/bq24650

And this looks interesting for low power applications. We could keep a Sharp Memory LCD powered up 24/7 under normal indoor lighting with one of these chips but the solar cell voltage can not be higher than 3v , but I can have those made in any size and shape should we want to. But chip would only be needed by very few people and applications so its probably not worth putting on the module.

http://www.ti.com/product/bq25504

@mattande I actually have. I'm thinking we could do the solar input w/ MPPT, battery charger and DC-DC buck+boost converter all on the MSP430! The buck+boost implementation would be the heart of it, as it would handle charging the battery both from a solar input and the USB input from the Core. We could then implement a second boost converter from the MSP430 to power the Core from the battery or use an off the shelf boost converter (thoughts on this?). Either way it would drastically lower the parts count, since we'd need inductors possibly switches anyway.

What do you think about doing the MPPT stuff in software @RWB? This would let us tweak the algorithm to pretty much any solar panel you'd want to use.

Another advantage is once I get the hardware design done and verify it does what we need, we can go ahead and get the board into production and start working on the full firmware which can be flashed OTA by the time it starts shipping.

I just took a look at the data sheet for this MSP430 your talking about and it looks like a very nice super low power processor. Very cool stuff indeed.

That sounds great. I'm sure we can find a Buck/Boost chip that can handle input voltages up to 20-30v so that opens up the ability to use tons of solar panels with voltages below 30v which is good.

If the boost part of the buck/boost converter works good and is efficient then we could actually charge the batteries from indoor lighting sources and this could be really useful for low power sensor applications.

I still would like the Buck/Boost regulator to be able to handle a constant 2 amps out to a LiFePo4 battery. Then we can throttle that current level down in software or via resistor for setups that do not need that much charging current. I have applications that can use this 2 amp feature so thats why I'm asking for it.

This second boost converter, its going to boost 3.2-3.7v battery to a regulated 3.3v to power the Spark Core right. So would it be a Buck/Boost converter since the battery voltage will range for 2-4v which puts us above and below the 3.3v regulated output voltage?

Shit you can actually make that happen? :smiley: If so then thats freaking awesome! Especially in that form factor. If you can make that work then I have quite a few other product ideas that I could use it in.

For size comparison here is a 5 Amp MPPT Solar charge controller I use in small system I build. Its has a 27v max input voltage rating. It has a decent amount of components on board as you can see so.

They use a MPPT tracking method call "Perturb and Observe" and it works really well. Is that some sort of code that you could easily pull and implement to get the same tracking method setup and working.

Here is another 2 amp 12v board I just found online just a min ago. Its pretty large. Link here

Linear Solar Charging Chip LTM8062

I tried this evaluation board from Linear Technology about a year ago but will not work with a single 3v battery pack, you need 2 cells / 7v battery pack minimum. Plus its not a true MPPT Tracking chip, you can only set the solar panels peak power voltage with a resistor and it will just servo the panels output current to keep the panel from being operated below that preset voltage. You get better performance out of actively tracking the solar panels peak power point as it changes often over the course of the day.

Let me know what you think.

Oh and I hear that OSH Park is turning around boards in 7 days now. That's fast.

Here is a interview Adafruit did with the owner of OSH Park

Actually, @mattande and I are proposing not using a Buck/Boost chip for the solar input/battery charging, instead we'd use two MOSFETs and a inductor hooked to the two of the MSP430's PWM outputs to function as a Buck Boost converter. This is how buck/boost (and just buck or boost) converters work, they feed a PWM signal into a MOSFET, which very quickly switches power on and off into an inductor, which acts to store energy up. Depending on the speed of the switching and inductor size you can control the output voltage.

You can't get energy out of nothing, so to boost voltage you need to trade amps. So if you want to put out 4.2V at 2A to charge a LiPo battery with a 2.5V input, it would pull 3.7A and the switches would need to handle 4.1A. Iin = (Vout * Iout) / (Vin * Efficiency)
Now, the opposite is true for a buck converter, you can get a higher output current from a lower input current if you're stepping the voltage down. Basically you can always trade volts for amps and amps for volts; this is why we have the measurements of watts which tells us total power. (I'm sure you already know this, but it helps for other people to follow along!)

Here's a diagram giving you the basic gist:

So we start at the Input Switch which would be a simple pair of FETs (controlled by the MSP430) to switch between the Solar and Core for input power. That would go to the Power Switching segment which are the FETs and inductor mentioned above, this will either boost the solar input (and do all the MPPT stuff) or buck the Core input, which is then used to charge the battery. Power from the battery is then fed into the Fuel Gauge (monitored by the MSP430) and a separate stand-alone boost converter, which ups the voltage to 5V. This then goes into an output switch, which is again a FET controlled by the MSP430 and fed back into the Core's input pin when it's not hooked up to USB. Thus completely the Circle of Life. (There's also a separate 3V3 LDO fed off the Core's input pin to power the MSP430, not shown.)

Does that make sense?

Here’s what that would look like in 3D (solar input on the bottom):

Use an off the shelf converter with a much higher switching frequency (500KHz-1MHz) to power the +3.3V rail directly. Use the +5V (RAW) pin from the core only for charging. This avoids the LDO loss when powering from solar/battery and the higher frequency chip will have a higher control loop bandwidth to regulate the voltage just as well as the LDO. Use a chip with enable input so when you want to power the core off, turn off its +3.3V.

I would suggest that a reverse current protection diode from +5V (RAW) to the solar input is all that is needed here.

The output switch becomes the enable pin on your +Batt -> +3.3V DC-DC converter.

You may also want to consider a circuit to bootstrap the power to the MSP430 when only the solar power input is present (no battery, no +5 USB).

Very cool I want one too!