QT-PY ESP32-C3 - Running off Lipo battery?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
gotapi
 
Posts: 6
Joined: Wed Feb 12, 2020 3:43 pm

QT-PY ESP32-C3 - Running off Lipo battery?

Post by gotapi »

Hello,

I am trying to run my QT-PY ESP32-C3 off a lipo battery. Im using your product "Adafruit Micro-Lipo Charger for LiPo/LiIon Batt w/MicroUSB Jack - v1" https://www.adafruit.com/product/1904?g ... usQAvD_BwE to transfer the power from the lipo to the board.

To test if it would work. I just added a simple code that flickers the neopixel light. The light never flickers. I tested the voltage output on the board and it was reading 3.3 volts. So the QT-PY ESP32-C3 is getting power ok.

Any suggestions?

Thanks,
Travis

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: QT-PY ESP32-C3 - Running off Lipo battery?

Post by dastels »

I'm not clear on what you are doing. Please post photos of your circuit.

https://www.adafruit.com/product/1904 is a LiPo charger. 5v comes in the USB socket and is used to charge the connected battery.

Dave

User avatar
gotapi
 
Posts: 6
Joined: Wed Feb 12, 2020 3:43 pm

Re: QT-PY ESP32-C3 - Running off Lipo battery?

Post by gotapi »

Ok, I probably made an incorrect assumption that the ground and battery pins where output on the https://www.adafruit.com/product/1904.

Here is an image of the wiring
Image

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: QT-PY ESP32-C3 - Running off Lipo battery?

Post by dastels »

OK. Now I understand. Yes, they are output. They are directly connected to +/- on the battery. What you have should work fine. Although, technically, you should connect BAT/GND on the charger to the BAT/GND pads on the bottom of the QtPy under the USB connector. That would also allow use of the USB connector for programming without having to disconnect anything.

The next thing is the code you used to manipulate the NeoPixel. Can you post it here?

Dave

User avatar
gotapi
 
Posts: 6
Joined: Wed Feb 12, 2020 3:43 pm

Re: QT-PY ESP32-C3 - Running off Lipo battery?

Post by gotapi »

Thank you so much for the reply and the help.

That makes way more sense. I'll wire the BAT/GND on the charger to the BAT/GND pads on the bottom of the QtPy.

Here is my testing code that runs fine when plugged into my computer but doesn't run when powered by the current configuration I posted.

Code: Select all

#include <Adafruit_NeoPixel.h>

// How many internal neopixels do we have? some boards have more than one!
#define NUMPIXELS        1


Adafruit_NeoPixel pixels(NUMPIXELS, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);
void setup() {

  Serial.begin(115200);
// say hi
  Serial.println("Hello!");


  // Wait until serial port is opened
  while (!Serial) { delay(1); }
  
  // put your setup code here, to run once:
 pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
  pixels.setBrightness(20); // not so bright
}

void loop() {
  // put your main code here, to run repeatedly:
  flickerNeoPixelLights();
  delay(500);
}


void flickerNeoPixelLights() {
  
  // set color to red
  pixels.fill(0xFF0000);
  pixels.show();
  delay(500); // wait half a second

  // turn blue
  pixels.fill(0x0000FF);
  pixels.show();
  delay(500); // wait half a second

  //turn magenta
  pixels.fill(0xFF00FF);
  pixels.show();
  delay(500); // wait half a second
  
  // turn off
  pixels.fill(0x000000);
  pixels.show();
  delay(500); // wait half a second
}

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: QT-PY ESP32-C3 - Running off Lipo battery?

Post by dastels »

It's likely this:

Code: Select all

  // Wait until serial port is opened
  while (!Serial) { delay(1); 
No serial port is getting opened without the USB connection. As a test, comment out all mentions of Serial.
Serial isn't used in the code, so you can just get rid of

Code: Select all

  Serial.begin(115200);
// say hi
  Serial.println("Hello!");

  // Wait until serial port is opened
  while (!Serial) { delay(1); }
Dave

User avatar
gotapi
 
Posts: 6
Joined: Wed Feb 12, 2020 3:43 pm

Re: QT-PY ESP32-C3 - Running off Lipo battery?

Post by gotapi »

Dave,

Code: Select all

  // Wait until serial port is opened
  while (!Serial) { delay(1); 
Was 100% the cause. Now I am off and running.

I do very much appreciate your time in answering my questions!

Sincerely,
Travis

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”