Limited electrons availability

A project log for glayer

An mp3 player for kids

OXullo IntersecansOXullo Intersecans 01/01/2019 at 00:390 Comments

What fascinates me about battery-based devices, it's the creative process of limiting power consumption at its minimum. It's certainly a non-trivial task that requires experience, proper tools and dedication.

While developing Glayer I certainly underestimated the task, but at the end I found the results satisfactory.

By design, the player has no power switch and it's always ready to start, unless the battery is empty. This obviously required care in minimizing power consumption at least when idling.

RFID detection

I considered the option of adding a companion detection mechanism for the card, even before having selected the RFID module itself.

The idea was to use a light barrier: after testing a couple of options, I ended up with a Vishay TCST2103, a 950nm paired LED/phototransistor. With a pulse of just 50µs I had a very reliable readout. Going down to numbers, with a 1-second detection period, the calculated average consumption was about 3.5µA (the LED current is set to about 7mA).

I failed to compare this figure with the power consumption of an RFID inventory operation, mostly for the lack of proper instrumentation. But looking at the electrical specs of the PN532 and the indicated 60mA @5V when energizing a properly tuned antenna, in addition to the 25mA of the typical operating current consumption of its core module, the light barrier seemed to me an evident advantage.

The RFID module is kept in low power mode while the light barrier is constantly polling. When a card is inserted the RFID module is awaken and an inventory scan is performed. Once the card is recognized, the RFID module is put again in low power mode. The light barrier keeps checking the card's presence at regular intervals.

One note regarding the Seeed NFC grove module I used: it seems that due to a design mistake, the breakout can constantly draw 40mA.


During the first iteration, the amplifier was integrated in the music maker featherwing. The unit I received was unfortunately faulty (same situation described in this thread). In addition, it was fairly impossible to mod the board to expose the shutdown pins to the microcontroller. The TPA2016 with the convenient TPA2016 amp breakout seemed to be a valuable alternative, with a shutdown current of 0.2µA.


The decoder can be put into powerdown by tying down the XRESET line, with an average consumption of about 19µA. Such line is controlled by the microcontroller (with a minor mod required to the featherwing), but the current software implementation doesn't use it, since it requires some modification to the library (Adafruit VS1053).

Ideally, the chip should be kept in reset when idling and awaken and reconfigured as soon a card is inserted.


The main controller could sleep a lot during idle. The only thing required to be operational is the periodic poll of the card detector. The µC, a SAMD21G, has several power down modes and an appealing option might be implementing Adafruit's SleepyDog library. This is still among the todos.