Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: Adding a charging circuit to a project.

  1. #1

    Adding a charging circuit to a project.

    Hi everyone, I want to add a battery and charging to my project. I was looking at a chip like: MCP73831 (http://ww1.microchip.com/downloads/e.../20001984g.pdf)

    Click image for larger version. 

Name:	Screenshot from 2018-01-16 13-41-24.png 
Views:	18 
Size:	15.6 KB 
ID:	12627

    I pasted the typical application, and was just wondering how best to attach this to teensy 3.6

    My plan is to take VUSB (TEENSY) and put it in VIN (MCP73831). Then for output to connect VBAT (MCP73831) to VIN (TEENSY). And of course cutting the VUSB/VIN (TEENSY) jumper.

    Since I am pretty clueless I looked at the Adafruit Teensy adapter (https://github.com/adafruit/Adafruit.../schematic.png) which uses the same chip, but I see that my plan is not what Adafruit appear to do. They seem to just use VIN (Teensy). And I am quite confused now how their circuit even works.

    Click image for larger version. 

Name:	Screenshot from 2018-01-16 13-49-46.png 
Views:	22 
Size:	25.1 KB 
ID:	12628

    Name:  Screenshot from 2018-01-16 13-50-20.png
Views: 170
Size:  4.5 KB

    This is how Sparkfun do it for a standalone charger (https://cdn.sparkfun.com/datasheets/...croUSB_v10.pdf) , which makes more sense to me, but can't imagine how to hook the Teensy up to this.

    Click image for larger version. 

Name:	Screenshot from 2018-01-16 14-20-35.png 
Views:	21 
Size:	29.0 KB 
ID:	12631

    Thanks for any help as always.
    Last edited by alialiali; 01-16-2018 at 01:22 PM.

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,718
    Note, I'm a software guy, so I can't help with the detailed electronics.

    There are two approaches that I've seen for adding a charger to Teensy products using the Teensy USB micro-B connector:
    • You cut the VIN/VUSB trace, hook the Teensy VUSB pin to the VIN of your charger, and connect grounds. You connect the VOUT pin of your charger to the Teensy's VIN pin. Thus the power always goes through the charger. It allows for you to put an on/off switch that will disconnect the Teensy's power whether it comes from battery or USB. One example of this is the onehorse chargers that are designed to be soldered under or over the Teensy directly: https://www.tindie.com/products/oneh...ttery-charger/.
    • The other approach is the one the Adafruit feather adapter uses. There you hook up the Teensy VIN and ground to the charger. If there is power coming from Teensy's VIN pin, then the charger charges the battery. If there is no charge on Teensy's VIN, the charger then supplies the voltage from the battery. On this one, you do not cut the trace wire between VIN and VUSB.


    In a previous thread, I measured the voltages of the two different chargers that the Teensy gets here:


    Another Adafruit charger to look at is the Adafruit Pro Trinket Lion/Lipoly backpack charger:
    Last edited by MichaelMeissner; 01-16-2018 at 02:15 PM.

  3. #3
    Aha! Thank-you very much Michael. The second approach seems easier to me. (I'm not a software or a hardware guy )

    Quote Originally Posted by MichaelMeissner View Post
    Note, I'm a software guy, so I can't help with the detailed electronics.

    There are two approaches that I've seen for adding a charger to Teensy products using the Teensy USB micro-B connector:
    • You cut the VIN/VUSB trace, hook the Teensy VUSB pin to the VIN of your charger, and connect grounds. You connect the VOUT pin of your charger to the Teensy's VIN pin. Thus the power always goes through the charger. It allows for you to put an on/off switch that will disconnect the Teensy's power whether it comes from battery or USB. One example of this is the onehorse chargers: https://www.tindie.com/products/oneh...ttery-charger/ that are designed to be soldered under or over the Teensy directly.

    In this case charger's VOUT pin is the pin that goes to the battery?

    Quote Originally Posted by MichaelMeissner View Post
    • The other approach is the one the Adafruit feather adapter uses. There you hook up the Teensy VIN and ground to the charger. If there is power coming from Teensy's VIN pin, then the charger charges the battery. If there is no charge on Teensy's VIN, the charger then supplies the voltage from the battery.

    And this would fail if you cut the VUSB/VIN jumper...

  4. #4
    Senior Member pictographer's Avatar
    Join Date
    May 2013
    Location
    San Jose, CA
    Posts
    627
    I'd like to put a plug in for LiPo battery charger add-on for Teensy 3.1 from onehorse. You can look at the plans for another example. It's "appallingly small" and the pinout is designed to fit over a little portion of a Teensy.
    Last edited by pictographer; 01-16-2018 at 05:01 PM. Reason: Fixed the link. Thanks, Defragster!

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,440
    Quote Originally Posted by pictographer View Post
    I'd like to put a plug in for LiPo battery charger add-on for Teensy 3.1 from onehorse. You can look at the plans for another example. It's "appallingly small" and the pinout is designed to fit over a little portion of a Teensy.
    onehorse/lipo-battery-charger-add-on-for-teensy-31/ [p#4 link missing a ":"]

    Also this higher current charger version Up to 800 mA charge current for larger LiPo support - also "improved with lugs to make the switch more robust and less prone to tearing off"

  6. #6
    Thanks, I saw the onehorse charger. Seems a very neat circuit. But in the schematic, the Teensy pins are not labelled so I got even more confused.

    From the link above:

    Click image for larger version. 

Name:	2014-08-21T01_54_49.161Z-LiPoSchema.jpg 
Views:	34 
Size:	61.8 KB 
ID:	12632

  7. #7
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,718
    Quote Originally Posted by alialiali View Post
    Thanks, I saw the onehorse charger. Seems a very neat circuit. But in the schematic, the Teensy pins are not labelled so I got even more confused.
    The onehorse board is designed explicitly for the Teensys. If you look at the actual board, and not the schematic, the PCB labels the 3 pins that must be connected (VIN, VUSB, GROUND) on the Teensy (you must cut the VUSB<->VIN trace). You can mount the board under the Teensy or on top, using long male header pins. I tend to mount the charger on top of the Teensy, so that I can mount the Teensy flat on a PCB or breadboard.

    I couldn't tell from your original post, whether you were designing your own PCB and wanted to lay out the charger, or if you were doing a one-off board. If you are doing a one-off board, the onehorse charger is pretty good. If you are going to build lots of the board, then doing the layout with the raw chips would be better.

  8. #8
    Junior Member
    Join Date
    Oct 2017
    Posts
    18
    May'be this is helpful/inspiring:
    I am currently making a PCB for this schematic that I found online:
    http://blog.zakkemble.co.uk/a-lithiu...-load-sharing/

    That combines a MCP73831 and a fet to create a schematic that can perform loadsharing. Lipo's don't like to charge and provide power simultaneously.
    This schematic basically disconnects the battery from the load when USB power is applied. When USB power is removed the schematic switches back to the lipo

  9. #9
    Member
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    41
    Yes I would be interested.

  10. #10
    Thanks for all the help everyone. I've sketched some out and sent some small test boards to the fab. As always this community has been great.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •