Gemma M0 Power problem (2x2032)

Hi,

I have a Gemma M0 connected to two Neo Pixel jewels I used Mu editor CircuiyPython and the USB port for power and coding. After I had the code running, I switched power to 2x 2032 coin cells in your 2 x 2032 Coin Cell Battery (PID: 783). At first the Gemma LED turns green and after several seconds the LEDS begin to show their patterns. However after about 30 seconds the Gemma green LED goes purple and an red LED flashed next to the Gemma slide switch. The LED pattern freezes. I retested with the USB power and everything works as I expected. as far as I know I have the latest Gemma code

Any clues as to why the Gemma is freezing after 30 seconds on CR2032 power? They are brand-new batteries straight from the store. Do you need a copy of the code to review?

Thanks

robboz4

Posts: 44
Joined: Tue Nov 20, 2012 7:01 pm

Re: Gemma M0 Power problem (2x2032)

Coin cells don't have enough stored energy to run NeoPixels for very long. They're designed for devices like clocks that use very little current, and their output falls dramatically if you try to draw more than about 50mA from them.

The actual cause of failure is probably voltage loss to the coin cell's internal resistance.

All power sources have some amount of resistance, which acts like a resistor between the ideal output voltage and the load. A power source whose nominal output voltage is 5V and whose internal resistance is 1 Ohm would lose 1V if you tried to draw 1A from it. The load would see an actual supply voltage of 4V.

For batteries, internal resistance is an approximation of how well the chemical process inside the battery can produce more energy. As an analogy, you can think of a hose sending water into a bucket with a hole in the side: the hose is the battery's ability to release more energy, the hole is the load, and the bucket is the amount of energy the battery can deliver at the moment. If the hole in the side of the bucket is larger than the hose, the water level in the bucket will fall even though the hose is pumping in as much water as it can.

The same kind of thing happens when you try to draw more than about 50mA from a coin cell. The chemicals can't release new energy fast enough to replace the energy you're pulling out, so the output voltage falls. If you run the numbers through Ohm's Law, it looks like the current is flowing through a resistor whose value is increasing.

If you want a small, NeoPixel-friendly power source, try a small LiPo:

They're a little larger than a coin cell, but have very low internal resitance. Lithium chemistries are really good at releasing energy quickly.

Posts: 60652
Joined: Thu Feb 11, 2010 2:51 pm

Re: Gemma M0 Power problem (2x2032)

Hi!
Thanks for the reply. I thought it might be a power problem, but was curious as to why I get a purple led and a red flashing one. I couldn’t find any clues as to what that combination meant. I have Lithium batteries available, so I’ll use them.
Cheers

robboz4

Posts: 44
Joined: Tue Nov 20, 2012 7:01 pm

Re: Gemma M0 Power problem (2x2032)

CircuitPython uses the NeoPixel to provide basic debugging information when something goes wrong.

Posts: 60652
Joined: Thu Feb 11, 2010 2:51 pm

Re: Gemma M0 Power problem (2x2032)

Thanks for the link. For some reason I could find it on my searches, but I have it now!

robboz4

Posts: 44
Joined: Tue Nov 20, 2012 7:01 pm