Low power operation of Pyboard connected to devices

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
Post Reply
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Low power operation of Pyboard connected to devices

Post by pythoncoder » Tue Sep 22, 2015 8:35 am

Having followed recent discussions on this I became interested in the issue of achieving long term running of a battery powered Pyboard connected to peripheral devices. This requires external hardware. I have produced a design https://github.com/peterhinch/micropyth ... opower.git A schematic, PCB design and driver are provided to enable peripheral power to be reduced to virtually zero before the Pyboard goes into standby. The hardware explicitly supports an e-paper display, nrf24l01 radio and FRAM modules - devices selected as relevant to low power systems - but it can readily be connected to other peripherals.

The above URL includes general notes and calculations on the topic including a minor mod to the Pyboard to reduce standby power. It also has suggestions for improvements to a future iteration of the board. All comments are welcome.

The prototype (everything socketed!).
Image
Peter Hinch
Index to my micropython libraries.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Low power operation of Pyboard connected to devices

Post by dhylands » Tue Sep 22, 2015 2:51 pm

Very nice writeup.

Thanks for sharing.

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Low power operation of Pyboard connected to devices

Post by kfricke » Thu Sep 24, 2015 2:30 pm

Thanks for sharing the design of your project, pythoncoder! It is nice to see the bits and pieces you did drop in this forum over the last months, do fit together nicely in that project.

I do not want to advertise the following product, but from my very limited knowledge and thereby noobish point of view it incorporates some of your ideas quite a bit. It also is open hardware with most design files published. It is an iteration of the discontinued Maple project.
Olimexino STM32 (STM32F103RBT6 based)
Schematics
Other Olimex boards (e.g. their Olimexino NANO) you can even see your MOSFET based power supply to the external components implemented on the UEXT connector. Sadly not on the STM32 one :(

I am not able to implement it, but who is also interested in a STM32F103 port? IMHO this would be a nice and affordable hardware base for a "minimal MicroPython".

(@moderators: Please feel free to spawn this post into a new thread. I do not want to hijack this thread!)

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Low power operation of Pyboard connected to devices

Post by pythoncoder » Tue Sep 29, 2015 6:33 am

To anyone following this I have extended https://github.com/peterhinch/micropyth ... opower.git to include further measurements and coding tips, including the use of the RTC backup registers for nonvolatile storage.

Once again, comments and corrections are welcome ;)
Peter Hinch
Index to my micropython libraries.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: Low power operation of Pyboard connected to devices

Post by Damien » Sat Oct 03, 2015 1:03 pm

@pythoncoder that's a nice project and the document is very well written!

Thanks for providing feedback on the hardware and what could be improved for the next version. At the moment I'm finalising the design for pyboard lite (STM32F411) and it would be good to try and address your points:

1. The LDO. I'm now using an MCP1703A which has about 2uA quiescent current, much better than the previous one.

2. I2C pull ups. This was discussed before (see https://github.com/micropython/pyboard/issues/8). If the pyboard didn't have pull ups then the accelerometer wouldn't work (so at least one bus must have them) and I wanted to make it easy for people to add I2C devices without worring about pull ups. The internal pull-ups on the pins are too high (around 10-40k ohm) so can't use those. Also, to properly enter DFU the I2C inputs should be at a predefined state (ie pull up or down). The solution I think is to use Y3/Y4 as an I2C bus instead of Y9/Y10 or X9/X10. This needs some enhancement to the I2C driver but would give you an option to have a bus without pull ups. It would also mean you can use this bus for I2C slave mode if the master has already provided pull ups.

3. Switched 3.3v output. This is something that's easy to add yourself if needed, but do you think it would be widely used that it should be added as a feature of the board? One problem is lack of IO pins to control it. Also, would it switch the existing 3V3 pins or would there be additional, broken out, switched 3V3 pins connected to the FET?

Note that the lite board does not have the accelerometer fitted.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Low power operation of Pyboard connected to devices

Post by pythoncoder » Sun Oct 04, 2015 7:05 am

There are two objectives behind my suggestions for modifications. Firstly to avoid the need to perform surgery on the Pyboard, and secondly to avoid the need for external components. The first is fixed by the new regulator.

If you provide a switched 3.3V supply, the pullup problem goes away: you merely run the pullups from that supply and ensure in firmware or otherwise that the 3.3V supply is normally on (see below).
would it switch the existing 3V3 pins
I can't see a reason why not. The only one which comes to mind might be if someone wanted to use the pins to source power to the Pyboard but, as I suggested in my notes, I see little point in doing this.
This is something that's easy to add yourself if needed,
For us, but some users lack this knowledge of hardware. This could be addressed with clear instructions.
do you think it would be widely used
The $64000 question. How can we possibly assess this? My gut feeling is that ultra low power consumption is an amazing feature of the Pyboard but it's very possible that 99% of boards get powered only by USB.

The lack of an I/O pin could kill the idea. One idea might be to bring the gate of the MOSFET out to an extra pin. A solder bridge would link the gate to Gnd. If the user wanted to employ the switch, they would remove the bridge and link the gate to a pin of their choice. I'm perhaps showing my age with the idea of a solder bridge: are they feasible with automated production?

With the bridge in place DFU mode would work normally. Users removing the bridge would need to be aware that the pin should be linked to Gnd before entering DFU.

Regarding the I2C pullups where we don't have an onboard MOSFET: the user is then committed to adding external components so two resistors won't be a significant addition. Your solution of an alternative I2C bus without pullups seems good and removes the need for the analog switch required by the existing design.
Peter Hinch
Index to my micropython libraries.

lbattraw
Posts: 21
Joined: Sun May 10, 2015 11:35 am

Re: Low power operation of Pyboard connected to devices

Post by lbattraw » Thu Nov 12, 2015 11:55 am

Sorry I'm late to the party, @pythoncoder what you're thinking of is generally handled via automated assembly using a 0 ohm "resistor" since depositing a solder blob across contacts would be complicated due to the surface tension over the solder mask. Or at least that's the way I'm familiar with.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Low power operation of Pyboard connected to devices

Post by pythoncoder » Wed Nov 18, 2015 5:24 pm

Another approach suggested to me is to use a via with a hole size similar to that used for a through-hole device. The user can cut the connection on the component side with a small drill or a Vero spot face cutter. The hole can then be used to mount a pin or socket header, enabling the connection to be re-established with a jumper.
Peter Hinch
Index to my micropython libraries.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Low power operation of Pyboard connected to devices

Post by dhylands » Wed Nov 18, 2015 6:17 pm

Here's a common example of a solderable jumper:
http://dhylands-examples.blogspot.ca/20 ... witch.html

The small trace between the pads is easily cutable using an xacto knife, and then the solder-blob can be used to go either way. You can remove old solder-blobs using solder-wick.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Low power operation of Pyboard connected to devices

Post by pythoncoder » Thu Nov 19, 2015 3:24 pm

Neat.

A note to anyone following this thread. As I've learnt more about the RTC I've revised the document referenced in the root message. The code in upower.py is significantly improved. In particular it now handles RTC alarms and it better supports operation in the presence of power cycles when an RTC backup battery is present. It is still a "work in progress" and I'll report on any future significant changes.
Peter Hinch
Index to my micropython libraries.

Post Reply