Connecting batteries to the SparkFun Qwiic Micro Development Board

I’m looking for a confirmation that if I want to connect a battery holder without soldering then I can’t use the board at https://www.sparkfun.com/products/15423 (and I need another board), though I don’t know if that can be confirmed. Also, why does a SparkFun page say that it uses 3.3V, and an Adafruit page says that Qwiic uses a different voltage (3V)?

Thank you.

I’m looking for a confirmation that if I want to connect a battery holder without soldering then I can’t use the board

There is a spot on the back of the board to add a battery jack but you'd need to solder that on.

Also, why does a SparkFun page say that it uses 3.3V, and an Adafruit page says that Qwiic uses a different voltage (3V)?

Because the adafruit page is technically wrong. However, 3.3v is commonly referred to as "3 volt" and 3 volts would technically be enough voltage for things to work. (Potato/potaatoe)

You could connect 2 AA sized batteries to the power wires on the qwiic port in a pinch and that would work as a battery connector if you really didn’t want to solder.

YellowDog:
You could connect 2 AA sized batteries to the power wires on the qwiic port in a pinch and that would work as a battery connector if you really didn’t want to solder.

Thank you.

Because even that sounds like it might be too new to me to do (at this time), I’d like to know if there is a microcontroller board that has both a 4-pin JST connector (for the qwiic system) and a 2-pin JST connector (for a coin cell battery, if there is that type of connector for that type of battery).

Coin cells don’t have any connectors. I don’t know of a board that fits your description off the top of my head, you will need to browse the sparkfun catalog and see what’s available.

I tried it a different way. This happened.

  • - I got my sketch working.
  • - I unplugged my laptop, which I uploaded from.
  • - I plugged in 3 AA alkaline batteries, using micro-USB.
  • - Three red power LEDs (one on each of my three boards) lit.
  • - Two LEDs on a stick didn’t continue doing what they did before, which they were supposed to continue doing.
  • - In addition to the power LEDs, those two were the only ones that were supposed to continue doing something.
  • Thank you.

    Maybe this picture of some of the parts mentioned in post #240178 (above) is useful. It also doesn’t work when I plug the laptop back in.

    The QWICC Micro board is using SAM21D processor. I do not see your sketch, but if you try to set and do some USB output, the SAM21D will not perform any activity without the PC connected. You can take some learning from viewtopic.php?f=117&t=59257. Else share your sketch to see whether we can help.

    paulvha:
    Else share your sketch to see whether we can help.

    Here it is, thank you.

    /*
      Blinks two green LEDs on a stick
      Modified from another's sketch
    */
    
    #include <Wire.h>
    #include "Qwiic_LED_Stick.h" // Click here to get the library: http://librarymanager/All#SparkFun_Qwiic_LED_Stick
    
    // Might need to be made into a comment if using a different microcontroller.
    #define Serial SerialUSB
    
    LED LEDStick; //Create an object of the LED class
    
    void setup() {
      Wire.begin();
      Serial.begin(115200);
    
      //Start up communication with the LED Stick
      if (LEDStick.begin() == false) {
        Serial.println("Qwiic LED Stick failed to begin. Please check wiring and try again!");
        while (1);  // Stops it from going forward because it might be broken
      }
    
      // To keep them off, makes sure LEDs 0 to 9 aren't red, green, or blue.
      // Maybe this part of the sketch can be written better, but it works for now
      for (int i = 0; i < 11; i++) {
        LEDStick.setLEDColor((i - 1), 0, 0, 0);
      }
      Serial.println("Qwiic LED Stick ready!");
    }
    
    void loop() {
      // Makes two LEDs green.
      // Maybe this part of the sketch can be written better, but it works for now
      for (int i = 0; i < 3; i++) {
        LEDStick.setLEDColor((i - 1), 0, 255 / 16, 0);
      }
      Serial.println("They are on.");
      delay(750);
      LEDStick.LEDOff();  // Turns them off
      Serial.println("They are off.");
      delay(750);
    }
    

    I have taken my QWICC micro development board and the standard blink and added similar serial prints as you have in the sketch. For a battery, I have connected the USB cable to a powerbank (5v). Connected to the PC or powerbank the leds will blink. No problem. So in your case, that is not the issue as you do not have while (! SerialUSB.available());

    I do not have your led strip but worked on AP102 leds before. I am more concerned about whether the power provided by the batteries is enough.

    For test :

  • Try to reduce the brightness to LEDstick.setLEDBrightness(10). it will reduce brightness for all leds in one go. By default the brightness is set to max (31) by the attiny85 on the strip and thus maximum power consumption.

  • Try to use only one led, not 2.

  • Try to remove the extra board that is connected to the ledstick

  • Measure 3V3 on the pins on the side of the board.

  • Try to use a powerbank or LIPO instead of 3 batteries.
  • Looking that sketch, when you do LEDStick.setLEDColor((i - 1), 0, 0, 0); and i =0 you try to set LED number -1 . That one does not exist. Luckily enough the issue is caught by the code in attiny85 and thus neglected.

    sketch used :

    void setup() {
      
      SerialUSB.begin(115200);
      delay(2000);
      SerialUSB.println("Blink LED  ready!");
    
      // initialize digital pin LED_BUILTIN as an output.
      pinMode(LED_BUILTIN, OUTPUT);
    }
    
    // the loop function runs over and over again forever
    void loop() {
      digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
      SerialUSB.println("Led is on.");
    
      delay(1000);                       // wait for a second
      digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
    
      SerialUSB.println("Led is off.");
    
      delay(1000);                       // wait for a second
    
    }
    

    Thank you, Paul. That is going to take me a while.

    paulvha:
    Connected to the PC or powerbank the leds will blink.

    I’m wondering whether there are two problems. Did you connect the PC or powerbank after unplugging what I unplugged? After I unplugged the PC and then plugged it back in, I wasn’t able to use that PC to make it continue working. The PC had the IDE on it, and provided power.

    I can unplug and plug it in and it works every time. Try my sketch and see what happens. If you have the IDE monitor open during unplug and plugging back in on some operating systems it will create a new port (either COM or ttyACMx). You can check that by then closing the IDE monitor and check in Tools/Port. It might have gotten a different number.

    paulvha:
    Try my sketch and see what happens.

    Thank you.

    It looks like the blue LED on the microcontroller is working, with power from the PC (both before it is unplugged and when it is plugged back in) or the batteries.

    Removing the while loop made it work.

    If I’m having another problem with my project, that isn’t related to batteries, should I reply here or create a new topic?

    new topic… keep it clear what the issue is