I recently made a project, it's a watch powered by the MDBT42Q and a CR2032 coin cell, whch is 220 mah.
full details here: https://iamericmin.github.io/tm5.html
It's an updated version of a previous watch that also used an MDBT42Q and a smaller CR1225 cell, which is only 50 mah. The old watch lasted about two weeks, but mine can't go more than two days!
The only culprit I can think of is the external crystal. I added a 32khz crystal with 22pf caps to the new watch, maybe that's why? The previous watch just tracked time with its internal crystal.
Also, the Espruino website says that MDBT42Q modules go to deep sleep automatically when proper conditions are met. So I'm really baffled here :'(
Any help would be greatly appreciated. Thanks!
You can remove the crystal to test. Also you probably build a custom Espruino firmware because otherwise adding crystal probably makes no difference. So maybe it is the custom build?
It could be also serial port being open - at startup it tries to guess if serial pins are pulled high and serial is attached. If yes it keeps serial console open which eats a lot of power.
No, I used the regular MDBT42Q firmware from Gordon. I didn't build a custom one. Would enabling the crystal draw more power? Also I don't think I have my serial pins high but I'll check.
Enabling crystal as a source for softdevice/bluetooth would possibly draw less power than using internal RC. I guess that is the point of adding it.
Hi - the watch looks great! When I saw it on Twitter I linked it from espruino.com too :)
I think @fanoush could be spot on with the UART. Are you using pin D8 for anything? http://www.espruino.com/MDBT42Q#pinout
If D8 is high at startup then the firmware will assume that it is connected to a UART and will enable the UART hardware, which draws a few mA (if I recall). All you'll need to do is add Serial1.unsetup() to onInit (or just to your code if it's saved to flash as-is) to disable it.
Also the crystal is usually connected to D0/D1 I think? The standard firmware doesn't use it, but worse than that it uses D0/D1 as the default LED and button - so it's possible that it is putting them in a state that'd draw a bunch of power (although afaik they should both be 0v normally). It'd be worth trying without the crystal anyway.
Or, you could compile your own firmware, enable the crystal in code and move LED1 and BTN1 but honestly I'd try and avoid that for the moment. nRF52 is actually pretty good at calibrating the internal RC oscillator using the high-speed crystal, so you'll find it's reasonably good at keeping time even without the 32k crystal.
I'd really suggest trying to measure the current draw though. For quick debugging I just sandwich a two wires between the coin cell's '-' side and the PCB, so I can put a volt meter in series with the cell... Hopefully that'd work for you too - then you could at least see if it draws a bunch of power when not running any code, and could try adding code in until you see the high power draw.
You could also try setSleepIndicator(LED1) or whatever indicator LED you have available - it'll show when Espruino is waking up to execute code, and if it's lit up a lot you'll know it's because of some code you have running :)
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem