# 2020 DFRobot Lead Acid Charger

**URL:** <https://forum.digikey.com/t/2020-dfrobot-lead-acid-charger/11566>\
**Category:** Weather Center\
**Tags:** eewiki\
**Created:** [January 26, 2021, 4:28pm UTC](https://forum.digikey.com/t/2020-dfrobot-lead-acid-charger/11566 "2021-01-26T16:28:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottRaeker](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@ScottRaeker](https://forum.digikey.com/u/ScottRaeker)\
**Post date:** [January 26, 2021, 4:28pm UTC](https://forum.digikey.com/t/2020-dfrobot-lead-acid-charger/11566/1 "2021-01-26T16:28:29Z")

</div>

- Created by [Robert Nelson](https://www.digikey.com/eewiki/display/~robertcnelson), last modified on [Jan 27, 2020](https://www.digikey.com/eewiki/pages/diffpagesbyversion.action?pageId=90243870&selectedPageVersions=22&selectedPageVersions=23)

 ![image](https://global.discourse-cdn.com/digikey/original/2X/c/c67eab0c002991ba42cd77bfd2d5a86f6b3e1b08.jpeg)

# Introduction

This page will show you step-by-step how to interface a DFRobot DFR0580 Solar Power Management to our Weather Center. [LIVE DATA](https://eng.eewiki.net/WeatherStation/DFRobot.html)

# Hardware Requirements

Power Management:

- [DFRobot DFR0580 Solar Power Management Lead Acid](https://www.digikey.com/products/en?keywords=DFR0580) at Digi-Key
- 4 x [DFRobot SEN0291 INA219 Current Voltage Sensor](https://www.digikey.com/product-detail/en/dfrobot/SEN0291/1738-SEN0291-ND/10279750) at Digi-Key
- 2 x [B B Battery BP12-12-T2](https://www.digikey.com/products/en?keywords=522-1013-ND) at Digi-Key
- [GROVE - I2C HUB (6 PORT)](https://www.digikey.com/product-detail/en/seeed-technology-co-ltd/103020272/1597-103020272-ND/11201130) at Digi-Key
- [XBee SMT Grove Development Board](https://www.digikey.com/products/en?keywords=602-2108-ND) at Digi-Key
- [XBee 3, 2.4Ghz Zigbee 3.0, U.FL Ant, SMT](https://www.digikey.com/products/en?keywords=602-2193-ND) at Digi-Key
- [Digi 2.4Ghz Whip, U.FL Ant](https://www.digikey.com/products/en?keywords=A24-HABUF-P5I-ND) at Digi-Key

# DFRobot DFR0580

This board utilizes a CN3767 Solar Power management IC. This IC requires an 15v~25v within 100W of Solar, it provides; 4A Trickle Charging, Constant Current, Constant Voltage, Float Charging dedicated to 12V Lead-Acid Batteries. It provides over-discharge protection for the battery at 10.8V (releases at 11.8V). In this design we are utilizing 4 INA219 Current sensors to monitor all Voltage rails around the DFRobot DFR0580 Solar Power Management board.

 ![image](https://global.discourse-cdn.com/digikey/original/2X/6/6cd142ac42f7f4bf87830d5f73e3779995733902.jpeg)

# Back Plate Mounts

- Solar BackPlate: [3D design Solar\_BackPlate\_v04 - Tinkercad](https://www.tinkercad.com/things/8YSGvCJLsZb)
- XBee BackPlate: [3D design XBee\_BackPlate\_v07 - Tinkercad](https://www.tinkercad.com/things/5JZ9CleATKo)

XBee 3 Power Monitoring

Power Monitoring, [WeatherStation/XBee\_BatteryCharger/main.py at master · eewiki/WeatherStation · GitHub](https://github.com/eewiki/WeatherStation/blob/master/XBee_BatteryCharger/main.py)

First make sure we are connected to XBee Network:

```auto
while xbee.atcmd("AI") != 0:
    print("#Trying to Connect...")
    time.sleep(0.5)

```

Next, Initialize INA219

```auto
solar_ina = INA219(SHUNT_OHMS, I2C(I2C_INTERFACE_NO), SOLAR_INA219A_ADDR)
solar_ina.configure_32v_2a()

```

Try Reading INA219:

```auto
solar_voltage = str(solar_ina.voltage())
solar_current = str(solar_ina.current())
print_solar = "Solar:" + time_snapshot + ":BusVolt:" + solar_voltage + "V:Current:" + solar_current + "mA:#"

```

Transmit values to xbee

```auto
xbee.transmit(TARGET_64BIT_ADDR, print_solar)

```

INA219 Example library:

This is our hacked INA219 library, it’s was originally written and posted by: [GitHub - chrisb2/pyb\_ina219: This library for MicroPython makes it easy to leverage the complex functionality of the Texas Instruments INA219 sensor to measure voltage, current and power.](https://github.com/chrisb2/pyb_ina219), however it contained many micropython options not supported by the XBee 3.

> <https://github.com/eewiki/WeatherStation/blob/master/XBee_BatteryCharger/ina219.py>

# Output Data

```auto
Solar:153931972:BusVolt:0.236V:Current:-2.0mA:#
Battery:153931972:BusVolt:13.156V:Current:17.0mA:#
5V_Rail:153931972:BusVolt:5.236V:Current:23.0mA:#
12V_Rail:153931972:BusVolt:13.148V:Current:-2.0mA:#

```
