Moteino USB - Reduce FTDI current on sleep

Started by akstudios, January 31, 2018, 06:22:07 PM

akstudios

UPDATE: See this post and this post later in the thread for an important update of differences between these higher consumption DIY Moteinos and stock Moteinos made by LowPowerLab. Essentially this behavior was only reproduced on the DIY Moteinos, not on any stock LPL Moteino-USB. The culprit appears to be the initial diode used in the DIY design, which replaced with the LPL recommended diode - reverts to the expected low current consumption.

While testing power draw by the FTDI, it appears that the Atmega328P's TX pin reverse powers the FTDI through its RX pin and keeps it in idle state, which results in some slightly higher current consumption on the Moteino USB. I modified an R5 Moteino USB by adding a voltage lever shifter -- Texas Instruments SN74LVC1T45 which has a VCC isolation feature. This was able to reduce that extra current draw to almost 0 when USB is unplugged. Current draw of the modified Moteino USB in deep sleep (WDT on) is around 6.6uA, almost same as the actual Moteino's 6.5uA. Device works normally when USB is plugged in.

SN74LVC1T45  Datasheet: http://www.ti.com/lit/ds/symlink/sn74lvc1t45.pdf

This is modification is based on a stack exchange answer I found here: https://electronics.stackexchange.com/a/141560/147274

The idea is pretty straight forward on how it's connected:



It isolates side A from side B when one of the input voltages is 0V as the ports are at high impedance in this state. When USB is connected, FTDI goes back to 3.3V, and normal activity is resumed.

Here are some pics:





The part is about $0.50. Just putting it out there if someone is looking for such a solution.

EAGLE files available here: https://github.com/AKstudios/MoteinoUSB-LP

-AK

Felix

Thanks for the contribution!
Will consider this for a future revision.


Felix

Awesome  ;)
Although I reckon this level shifting might be done with just 1 transistor.

perky

Quote from: Felix on January 31, 2018, 09:10:50 PM
Awesome  ;)
Although I reckon this level shifting might be done with just 1 transistor.
N-channel MOSFET, and a pull-up resistor on the FTDI_RX if there isn't one already.

Mark.

Uncle Buzz

#5
Quote from: perky on February 01, 2018, 07:00:13 AM
N-channel MOSFET, and a pull-up resistor on the FTDI_RX if there isn't one already.

Mark.

Hi,
I don't see where putting N-mosfet and a pull-up resistor to lock sinking current by FTDI_RX, could you be more explicit ?
Thanks

EDIT : maybe your proposal deals only about the level shifting function

perky

#6
Tie the N channel MOSFET gate to FTDI3.3V, tie the source to FTDI_RX, tie the drain to D1_TX, put the pull-up between FTDI_RX and FTDI3.3V. When the FTDI is powered up D1_TX will flow through the MOSFET onto FTDI_RX (using the intrinsic diode initally when pulling low). When the FTDI is powered down the gate will be at 0V and the MOSFET will block current from the D1_TX to FTDI_RX. See diagram below.

Mark.

Edit: It's actually debatable whether pull-up is really needed, as when the FTDI is powered up the source cannot go lower than 3.3V - Vgs(th) when the D1_TX is at a logic 1. So if a low gate threshold MOSFET is chosen such that (3.3V - Vgs(th)) > Vih then the pull-up wouldn't be needed.

Uncle Buzz

Thank you for the schema.

To my mind, as Vgs is a typic value and can be slightly different, and if you removed LDO of your moteino and use a lower supply than 3.3V, the pullup resistor is highly recommended if you don't want to test each mosfet before using it.

Are you sure the "non saturated" Vgs phase will not slower the transition between low and high state and reduce the bauds transmission ?

The unidirectionnal level shifting is still a good option with only one SOT-23-6 component.

perky

#8
It's actually the response of the intrinsic diode to pull it low then the turn on time of the MOSFET, but the impedance of the driver is low and the capacitance of the gate is low too. It won't have an appreciable slowing down effect at serial baud rate frequencies. I would put a pull-up on for the same reasons you said just to be safe, you also need a noise margin too which would mean even lower Vgs(th).

BTW this technique is used with I2C for level shifting and isolating powered down I2C buses from each other, that's good for at least 400kHz fast mode I2C:

https://www.nxp.com/docs/en/application-note/AN10441.pdf

Mark

akstudios

Update on this: I tested perky's circuit and voila! The MOSFET even gets rid of the 0.1-0.2uA power consumption of the unidirectional level shifter as well.

Here's the circuit recreated in EAGLE:



Here are some images:





Board files here: https://github.com/AKstudios/MoteinoUSB-LP

Nice low-cost improvement for the MoteinoUSB!

perky


Uncle Buzz

Maybe same idea could be used on PCB with I2C sensors, so it will be possible to cut-off power of these sensors instead of put them in standby or powerdown mode when they still burn some µA... Without this tip, I2C bus will power sensors and it's useless to cut-off power pins.

are SDA and SCL both drived by sensors or only SDA, and SCL by moteino ?

LukaQ

#12
I would cut both... but remember, that you may have external pullup resistors (internal might not be enough for correct operation at 3.3v), which would also need to be cut from the sensor

perky

Quote from: Uncle Buzz on February 14, 2018, 06:56:03 AM
Maybe same idea could be used on PCB with I2C sensors, so it will be possible to cut-off power of these sensors instead of put them in standby or powerdown mode when they still burn some µA... Without this tip, I2C bus will power sensors and it's useless to cut-off power pins.

are SDA and SCL both drived by sensors or only SDA, and SCL by moteino ?

Already used for I2C when powering down devices and logic level shifting:
https://www.nxp.com/docs/en/application-note/AN10441.pdf

Mark.

akstudios

perky - how would you use that app note for powering down the bus? It's clear on how to do level-shifting, not sure how to power down the I2C bus without the resistors still consuming power.