diy solar

diy solar

... powering a microcontroller from the battery or charge controller

jmzorko

New Member
Joined
Jul 1, 2021
Messages
100
Hello, all ...

As a personal project, I'm looking to power a microcontroller from a 48V LFP battery (BigBattery LAMA). The interesting thing is that if the battery is discharging, I want to power it from the LAMA, but if the battery is charging, I want to power it from the charge controller. Since the battery has a single Anderson connector through which the battery discharges and charges, I'm wondering how to do this from that same connector.

Context: my solar inverter is a Sol-Ark 8K, which has CANbus support. I'm planning on using the microcontroller to read the charge / discharge current and voltage, match that against a predefined charge / discharge curve, and format all of that into CANbus packets that I can send to the Sol-Ark via the Sol-Ark CANbus interface. Since sometimes the battery will be feeding the Sol-Ark, and other times the Sol-Ark will be feeding the battery, I'm wondering if there's a special sort of DC-DC converter (to go from 48V to 3.3V to power the MCU) that will work in either case.

I know this is possible, because I also have a Fortress Power eVaultMAX that is already doing this, since it communicates with the Sol-Ark via CANbus. I also suspect that BMSs do this as well (i.e. if the battery they're managing is completely discharged, they still have to get power from somewhere to operate, so I figure they must be getting it from the charge controller). Any insight as to how to do this would be very much appreciated!

Regards,

John
 
I'm only a hobbyist with electronics but I did manage to get a 48v-12v dc converter backed by a LM7805 to run an arduino for a similar purpose.
 
I think you'll find that a BMS is always powered from the batteries through their balance cables, so the direction of the battery pack current is not relevant to their operation.
Because of this they can be active even during a low voltage disconnect and when a charger isn't attached or providing energy.

Your options would be to access the batteries directly (I.e. before the BMS) or power your micro from an independent power source. There are plenty of small 18650 based power sources for Arduino type micros that can charge from USB and act as a tiny UPS for their load if power is removed.

Finding a buck converter that will operate at the relatively high voltages we use can be difficult, I bought a bunch of these recently and have been pleased with their performance: https://m.aliexpress.com/item/1005004216043783.html

The usual LM7805 or XL4015 will be operating well beyond their absolute maximums at 48v, so wouldn't be suitable or reliable.
 
Finding a buck converter that will operate at the relatively high voltages we use can be difficult, I bought a bunch of these recently and have been pleased with their performance: https://m.aliexpress.com/item/1005004216043783.html

The usual LM7805 or XL4015 will be operating well beyond their absolute maximums at 48v, so wouldn't be suitable or reliable.
Up to 120v dc is pretty impressive for that price. Have you been using them for 48-5v?
 
Up to 120v dc is pretty impressive for that price. Have you been using them for 48-5v?
Yep, 56v to 5v continual for several weeks without a problem. I also use the 12v variant for running some LED lights.
An important note for these units in particular is that their PCBs are all labelled as the 12v output version, you need to test with a DMM to be sure which one you have (i.e. 12v or 5v). Shouldn't be an issue if you're only ordering a single type though.
 
Yep, 56v to 5v continual for several weeks without a problem. I also use the 12v variant for running some LED lights.
An important note for these units in particular is that their PCBs are all labelled as the 12v output version, you need to test with a DMM to be sure which one you have (i.e. 12v or 5v). Shouldn't be an issue if you're only ordering a single type though.
Those will work dandy for me. The OP specifically stated 3.3v so maybe not so much for them?
 
Depends on their setup, but once you have a 5v source everything becomes a lot more manageable. If they're using an Arduino or Dev board (STM32 blue pill, NodeMCU, etc) they'll happily run from 5v with the onboard regulator.

Most 3.3v MCUs have a wide enough voltage tolerance to be able to run directly from a single LiFePO4 cell without regulation too. It's a bit dirty, but it works and ensures the lowest possible quiescent current, which sounds like it'll be important for the OP.
 
I purchased a few of those a few months ago, they only have a 100v electro on the input, so their claim of 120v input operation is dubious at best.
 
I purchased a few of those a few months ago, they only have a 100v electro on the input, so their claim of 120v input operation is dubious at best.
Interesting, I just checked mine and they have 160v caps on the input side (or at least they're labelled as 160v :unsure:)

I'd never run these cheap boards from the far east to their bleeding limits in any case. Running at 56v peak on my battery pack leaves a very wide margin of safety.
 
Interesting, I just checked mine and they have 160v caps on the input side (or at least they're labelled as 160v :unsure:)

I'd never run these cheap boards from the far east to their bleeding limits in any case. Running at 56v peak on my battery pack leaves a very wide margin of safety.
Considering the point of origin and price, QC may be subject to change?:sneaky:
 
I think you'll find that a BMS is always powered from the batteries through their balance cables, so the direction of the battery pack current is not relevant to their operation.
Because of this they can be active even during a low voltage disconnect and when a charger isn't attached or providing energy.

Your options would be to access the batteries directly (I.e. before the BMS) or power your micro from an independent power source. There are plenty of small 18650 based power sources for Arduino type micros that can charge from USB and act as a tiny UPS for their load if power is removed.

Finding a buck converter that will operate at the relatively high voltages we use can be difficult, I bought a bunch of these recently and have been pleased with their performance: https://m.aliexpress.com/item/1005004216043783.html

The usual LM7805 or XL4015 will be operating well beyond their absolute maximums at 48v, so wouldn't be suitable or reliable.

Yes, I've decided to either find a suitable source inside the battery (looking to see if perhaps the BMS has a 9V DC wire that I can convert down to 5V) or use a tiny battery just for the MCU. I plan on using a Particle Argon for this project and found CANbus transceivers that should work. I _think_ I can read the battery voltage from the battery tap connecting to the BMS, and I _think_ there are temperature sensors in the BigBattery Lama that attach to the BMS as well (I see wires that look like they might serve that purpose). Assuming these are what I think they are, I can use a few GPIOs to connect to the battery tap, a couple more for the temperature sensors, and be able to read them from the Argon through a voltage divider ... I think. C isn't a problem for me, but analog electronics is one area where my understanding could definitely be improved! This project is for an embedded systems class I'm taking, so I want to do my best and get it working. Plus, it would just be cool to have the Sol-Ark talk CANbus to the Lama(s) like it already does with the eVault.
 
This all sounds very achievable. I was just reading up on the LAMA and found that their BMS supports no external communication at all! Very strange for this day in age.

With a simple voltage divider and a few temperature probes you'll be well on your way to achieving what you're after. If you did want to measure current, an easy approach is to use one of the Allegro ACS7x series current sensors. They're completely isolated from the circuit and have good enough accuracy for general observations.

Have you managed to find complete documentation on the Sol-Ark CAN bus protocol?
I've been working to implement CAN communication with my Growatt inverter and have produced a system that sends the data exactly according to the documentation, however so far it refuses to work. These things can be a bit more difficult than they appear.
 

diy solar

diy solar
Back
Top