Gemma M0 Neopixels work with battery, but not USB

Wearable electronics: boards, conductive materials, and projects from Adafruit!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
adamsd5
 
Posts: 14
Joined: Thu Oct 04, 2018 12:07 am

Gemma M0 Neopixels work with battery, but not USB

Post by adamsd5 »

Hello,

I have soldered some individual neo pixels (those small circular ones) as wearables. I wrote python code to change the lights. All of this works just fine when I boot the device up against a battery pack. However, when I have the usb cable plugged in, the device doesn't work. Sometimes the lights blink in crazy erratic ways. I suspect that the USB power/ground is somehow messing up the device.

Should I expect to be able to run the neopixels just off USB?

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

Re: Gemma M0 Neopixels work with battery, but not USB

Post by adafruit_support_bill »

Neopixels expect a logic HIGH level of 0.7 * VCC. If VCC is 3.3v, then any signal above 2.3v is good. If VCC is 5v, then it needs a signal level of 3.5v. So, when powering pixels from 5v, you will have trouble controlling them with a 3.3v processor like the M0.

You can use a level shifter like this to increase the control signal voltage: https://www.adafruit.com/product/1787

User avatar
adamsd5
 
Posts: 14
Joined: Thu Oct 04, 2018 12:07 am

Re: Gemma M0 Neopixels work with battery, but not USB

Post by adamsd5 »

That ... is exceedingly useful information. Rarely have I had a forum reply as concise or that made as much sense. Thank you!

User avatar
adamsd5
 
Posts: 14
Joined: Thu Oct 04, 2018 12:07 am

Re: Gemma M0 Neopixels work with battery, but not USB

Post by adamsd5 »

Follow-up question here... I noticed the Gemma M0 has a 3.3v output pad. I decided to just power my neopixels from that pad so that no matter the power source, the signal is strong enough to change the lights. It works like a charm. This is what I needed to be able to have the system plugged into my laptop, use Mu, and iteratively update the code.

But lately, a new thing is happening. When I press the button, the code runs for about 5-10 seconds, and then the onboard light goes amber, then off, then solid bright white. Note that the code has run for long enough that I know it is not hitting a bug. The time seems to not always be the same either. I've also tried a few known good programs and they do the same thing. If I disconnect the USB and power with the battery again, the program runs indefinitely.

Can you explain what the white light means? Could it be overheating perhaps trying to regulate the power? (Is this a bad use of the 3.3v source?)

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

Re: Gemma M0 Neopixels work with battery, but not USB

Post by adafruit_support_bill »

I noticed the Gemma M0 has a 3.3v output pad. I decided to just power my neopixels from that pad
Not a good idea. The 3.3v regulator on the Gemma is not capable of supplying a lot of current. It would be very easy to overload it with a few neopixels.

User avatar
adamsd5
 
Posts: 14
Joined: Thu Oct 04, 2018 12:07 am

Re: Gemma M0 Neopixels work with battery, but not USB

Post by adamsd5 »

Cool, thanks. I shall do it right. :)

User avatar
Antolepo
 
Posts: 1
Joined: Tue Aug 27, 2019 5:41 am

Re: Gemma M0 Neopixels work with battery, but not USB

Post by Antolepo »

Hi! I bought a gemma M0 recently, and only used it with USB to upload sketches and to power it up. Today, I finished my project (8 Neopixels on a hoodie), and it was working perfectly when pluged into my computer, and since I was ready to wear my project, I unpluged the usb cable, and pluged in the recommended 3x AAA battery pack with JST connector from the adafruit learning guide (that I also bought on adafruit.com) and NO lights came on, not even the power light. I've checked if any of the switches where on Off, and they were all On, so then I checked for the polarity of the batteries, and they were right, so then I've mesured the voltage with a multimeter and it was giving me 4,8 volts, which is right too! I've also tried using other AAA batteries but still nothing! How frustrating is that! Everything took me 4 hours to sew together, and the gemma was working fine with USB but it's not working with the JST connector (when the USB cable is disconected of course). My gemma M0 is sewn onto my hoodie! I thought that you guys tested every board before sending them out, but looks like I've got a defective one.

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

Re: Gemma M0 Neopixels work with battery, but not USB

Post by adafruit_support_bill »

@Antolepo - Please post photos showing all your soldering and connections.

User avatar
adamsd5
 
Posts: 14
Joined: Thu Oct 04, 2018 12:07 am

Re: Gemma M0 Neopixels work with battery, but not USB

Post by adamsd5 »

adafruit_support_bill wrote:Neopixels expect a logic HIGH level of 0.7 * VCC. If VCC is 3.3v, then any signal above 2.3v is good. If VCC is 5v, then it needs a signal level of 3.5v. So, when powering pixels from 5v, you will have trouble controlling them with a 3.3v processor like the M0.

You can use a level shifter like this to increase the control signal voltage: https://www.adafruit.com/product/1787
Okay, I had one of these from a previous purchase: https://smile.amazon.com/Icstation-TXS0 ... ial&sr=1-3
Datasheet here: http://www.ti.com/lit/ds/symlink/txs0108e.pdf

I believe I have wired it properly by hooking up:
- 3.3 voltage to VA
- Gemma M0 neopixel output control to A1
- Gemma Vout to VB
- Gemma ground to GND
- B1 to the neopixel strip

I believe this is the right setup, so that when I change the driving voltage of the Gemma M0, the "B" side of the converter will match the power going to the neopixel strip. However, it isn't working at 3.3v (battery) or 5v (USB). I've attached the wiring and solder joints (as ugly as they are). I've tested the connections and the voltage between GND and VA or VB are correct. I can see the A1 signal bouncing around, but my multimeter isn't going to tell me much (I think?). I get stuff on B1 too, but can't make sense of that either. Maybe I need to borrow an oscilloscope and see what I can measure on A1/B1?

Here's the Gemma M0:
Gemma M0.jpg
Gemma M0.jpg (157.72 KiB) Viewed 217 times
Here's the Level Converter:
Level Converter.jpg
Level Converter.jpg (162.24 KiB) Viewed 217 times
Note that I treat "yellow" as "neopixel signal out". So the yellow wire connected to the gemma M0 connects to the green wire on the level converter. The blue wires connect. The Vout and GND on the Gemma M0 go to the neopixel strip and to the Level Converter. Hopefully that describes my setup well. What did I miss?

I've ordered the exact device you suggested, which I'll try on a breadboard. If it works, is there a version that comes on a tiny board like the one I used here? I find the little chips hard to work with.

Oh, and one more side-question. I'm using a Gemma M0 with Circuit Python. It works, but it is a bit slow. Is there something that would work similarly, but maybe have a faster processor? (If it also gives a better solution for driving neopixels, all the better!)

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

Re: Gemma M0 Neopixels work with battery, but not USB

Post by adafruit_support_bill »

Not all level shifters are created equal. We have found that the 74AHCT series logoc chips have the best characteristics for driving Neopixels. I haven't tried the TXS0108E, but many of the bi-directional types are a bit slow for Neopixel signals.

Your photos don't show all the wiring. An overview shot would be helpful. I only see one GND connection to the level shifter. You will need a common ground for all the components.

User avatar
adamsd5
 
Posts: 14
Joined: Thu Oct 04, 2018 12:07 am

Re: Gemma M0 Neopixels work with battery, but not USB

Post by adamsd5 »

I will add more pictures. The shifter ground goes to the Gemma ground which is the neopixel ground. They are all connected.

I have also ordered the recommended one and will try that when it arrives. It just doesn't fit the wearable theme very well imo. I will also just try a raspberry pi zero which has a 3.3v output rated for 500mA, which should be plenty for my 20 pixels (mostly not lit).

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

Return to “Wearables”