Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
anthonyrubalcaba
 
Posts: 10
Joined: Wed Jun 14, 2017 8:09 pm

Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by anthonyrubalcaba »

Ok so I'm probably missing something very simple, but let me start by saying I've successfully made hundreds of functioning projects using Trinket 3V, 5V, M0, itsybitsy, teensy, and PixelBlaze. I've used dotstars, neopixels, WS28everything, apa10stuffs, and SKclones. You can see all of my work here: https://www.instagram.com/sunandmooncouture/

Up until today I liked to imagine I was somewhat of an expert.

Today I tried wiring up a Trinket M0 with the lipoly backpack I always use, power button, USB-C charging port, the adafruit 2,200 mah cylinderical battery, and 3 neopixel strips 18px long each. However, I usually write arduino code in the arduino program, build and upload to the trinket. This time I plugged in my Trinket M0 and the drive opened up with a main.py sketch. Cool, I know C++, C#, Python, and a bunch of other programming languages. This should be easy.

The problem: the LEDs only turn on when I connect the trinket to the computer via the USB micro plug. When I disconnect from the PC, and use the battery, the Trinket powers up but the LEDs don't turn on.

What I've tried:

connecting the voltage wire for the LEDs to the USB pin on the trinket, works when the USB micro cable is connected to the PC, but not when run on battery. That makes sense.

If I connect the trinket to the pc via usb
- the voltage wire of the LED strips is connected to the USB pin = LEDs run rainbow pattern
- voltage wire is connected to the 3V pin = LEDs run rainbow pattern
If I disconnect the trinket from the PC, and use the battery:
- Trinket powers up, but LEDs are off
- connected voltage wire to 3V pin = LEDs off
- connected voltage wire to USB pin = LEDs off (this makes sense)
- connected voltage wire to battery pin = LEDs off
- connected voltage wire to BAT pin on lipoly backpack = LEDs off

Now I used my multimeter to measure voltage on all these pins in all scenarios, and they are always at 3.2V when they should be, so the LEDs are getting proper voltage.

other notes:
on battery, the trinket shows 1 green light for the ON, and the built in dotstar led is lit purple.
on USB, the trinket shows 1 green light for the ON, but the onboard dotstar is only purple for a second then turns off.
This makes me think the trinket is doing something different when powered by USB vs battery.
there are 3 neopixel strips running off 1 trinket, so I have a 1 to 3 wire connection for each of ground, power, data.
Attachments
20220821_172602.jpg
20220821_172602.jpg (814.39 KiB) Viewed 383 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by adafruit_support_bill »

Please post the code you are using.

User avatar
anthonyrubalcaba
 
Posts: 10
Joined: Wed Jun 14, 2017 8:09 pm

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by anthonyrubalcaba »

It's the default main.py that came with the trinket m0

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by adafruit_support_bill »

Your default main.py runs a rainbow pattern on neopixel strips? Please post the text of it.

User avatar
anthonyrubalcaba
 
Posts: 10
Joined: Wed Jun 14, 2017 8:09 pm

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by anthonyrubalcaba »

so on the trinket m0 learning page: https://learn.adafruit.com/adafruit-tri ... cuitpython

they state "we suggest installing the Trinket Default Zip"
which is a link to here: https://learn.adafruit.com/adafruit-tri ... /downloads

which downloads a main.py which I've attached below
Attachments
main.py
(2.54 KiB) Downloaded 10 times

User avatar
anthonyrubalcaba
 
Posts: 10
Joined: Wed Jun 14, 2017 8:09 pm

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by anthonyrubalcaba »

Anyways I got the LEDs working once I installed the MU editor and opened the serial connection via REPL
I saw this error in the serial console:

MpyError: Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.

so I went to mpy-update, downloaded the 7.x to match the version of circuit python on my trinket, reinstalled the libraries, and it started working.

However, I still don't understand why it was working on USB but not on battery.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by adafruit_support_bill »

Not sure. I will check with the CircuitPython team.

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by adafruit2 »

thats very weird and shouldnt happen ... can you replicate it?

User avatar
Arminlande
 
Posts: 8
Joined: Sat Jun 18, 2022 2:09 pm

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by Arminlande »

I have the same Issue but with ProTrinket 5v 16mhz and a 3700mAh LiPo-Battery. Powering 3 ledstrips(ws2812b) with 98 Leds ( 2 x 32 leds; 1 x 34 leds).

Also when i connect the protrinket to the computer via the Usb-micro cable the trinket works fine and the program is working, all leds are doing what they supposed to

but when its powered by the battery the trinket is powered(green led onboard is on) and ledstrips wont work anymore

also when its powered by battery the red led from the protrinket is blinking 4 times then goes off and only the green led is still on
Attachments
7bcde35a-329c-4aa4-b688-86b982fbba34.jpg
7bcde35a-329c-4aa4-b688-86b982fbba34.jpg (298.62 KiB) Viewed 309 times
bad4f6dc-cd1c-4dcc-802e-6840fb872e6d.jpg
bad4f6dc-cd1c-4dcc-802e-6840fb872e6d.jpg (283.1 KiB) Viewed 309 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by adafruit_support_bill »

Please post a photo of the battery and its connecting cable.

User avatar
Arminlande
 
Posts: 8
Joined: Sat Jun 18, 2022 2:09 pm

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by Arminlande »

i needed to change the battery plug because it was different then the socket from my powerboost 1000(i changed + and -)
Attachments
19e319ff-eec3-4e7f-abe8-6b611fb74880.jpg
19e319ff-eec3-4e7f-abe8-6b611fb74880.jpg (410.44 KiB) Viewed 293 times
94384b6c-f5b1-4d6b-a027-3748117a0236.jpg
94384b6c-f5b1-4d6b-a027-3748117a0236.jpg (86.72 KiB) Viewed 293 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by adafruit_support_bill »

OK. Measure the voltage between BAT and GND on the Powerboost.
Then measure the voltage between 5v and GND to make sure that the PowerBoost is working properly.

User avatar
Arminlande
 
Posts: 8
Joined: Sat Jun 18, 2022 2:09 pm

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by Arminlande »

between BAT and GND its 3,82V
and between 5v and GND its 5,2 V

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by adafruit_support_bill »

Looks like you are connecting the 5v from the PowerBoost to the BAT pin on the Trinket. The minimum voltage for stable regulation on the battery input is 5.5v. Since the PowerBoost is designed to emulate a USB power source, you should connect to the VBUS pin instead.

Also note that your wire colors are exactly the opposite of the NEC color-code standards for DC circuits in North America. Black is for GND and Red is for the positive voltage supply. (In Europe it would be Blue for GND and Brown for V+)

Other than confusion, it is not a big deal for a standalone circuit. But for any kind of installation, it would not pass inspection.

User avatar
Arminlande
 
Posts: 8
Joined: Sat Jun 18, 2022 2:09 pm

Re: Trinket M0 Circuit Py - LEDs only turn on when powered via USB, not battery

Post by Arminlande »

OMG! it's working. Thank you so much for the amazing suport! This was my first own project, and i really needed your help.
And i will change the color of the wires, ofcourse.

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

Return to “Trinket ATTiny, Trinket M0”