Pico battery connection and USB programming?

Posted on
  • Hi, I would like to connect Espruino Pico permanently with battery in my project.
    I thought to do it like that:
    would like to charge it by this module, but
    I am not sure I need to install some switch there when I want to programming it by USB?
    should I disconnect battery circuit from espruino when I program it or I can leave it?
    I already linked FET/B0, not sure I did right

    I would like to make some circuit which let me programming pico by USB, use battery for powering pico when not connected to USB and charge battery by this module,
    I had read in one of posts on the forum that FET can overcharge battery when USB is connected, is it ?

    battery module

  • Ok, so you're using a separate charger module?

    If so then everything is fine. Connect:

    • The charger to the battery
    • The battery to the Pico, via the 'Bat' pin (or a JST connector soldered on the bottom)
    • Power the charger from the Pico's 5v pin
    • Make sure the FET/B0 jumper is disconnected (it's only needed if you intend to charge the battery using the Pico, which isn't recommended!)

    And I think that's it...

  • Thanks Gordon,

    and what do you think about charging battery from Pico? I thought to use voltage divider and then connect it to analog pin to read it and "stop" fet from charging by software,
    would my code be ok for this?

    function stop(){
    function charge(){
    function check(){
     var a = analogRead(A5)*E.getAnalogVRef()*2;
      if(a>3.7) stop();
      else if(a<3.71) charge();
  • I thought you were using a separate charger? You posted a link to something that I thought you were planning to use.

    But if you are trying to charge with just the Pico, you do need that jumper shorted. You actually need:

    function stop() {

    As setting to 1 is 3.3v, which won't fully turn the FET off. There is a tutorial on that here: http://www.espruino.com/Pico+FET+Output

    ... but I wouldn't recommend doing this - maybe with NiMH batteries, but for LiPos they can get very unhappy if overcharged. Much nicer to just use a special charger IC -
    the new shim collection board has outlines for LiPo charger ICs on a lot of the shims too.

  • Before I thought to use charger and next read about FET on Pico, I tested it yesterday and It looks like I espruino can "protect" the battery by software, but I'll follow your recommendations
    thank you,

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Pico battery connection and USB programming?

Posted by Avatar for bigplik @bigplik