i was wondering . is it a good idea to use the given circuit to shut down i2c bus to save power ?
i am using atmel 328p and io expander. io expander wont have any input it has only outputs.
if the circuit does make sense then what kind of mosfet will i use . will i use a level shifting mosfet or will i use a power mosfet ?
i am thinking that before using the bus . turn on the mosfet so that the pull ups shorts to vcc, then use the i2c as normal . then turn off the mosfet so that the mosfet gets disconnected to vcc.
i do understand this will introduce more reistance , Rds ON of the mosfet .
manveen_singh:
i was wondering . is it a good idea to use the given circuit to shut down i2c bus to save power ?
No.
The I2C bus idles HIGH. Current is only being used when the master/slaves pull the bus LOW.
That only happens for a very short time, when data is exchanged.
Leo..
And... you can't switch high-side with an N-channel fet that way.
Pull up voltage will be "VCC minus Vgs(th)", which might be less than 3volt on a 5volt Arduino.
Time to study mosfet theory.
Leo..
Wawa:
No.
The I2C bus idles HIGH. Current is only being used when the master/slaves pull the bus LOW.
That only happens for a very short time, when data is exchanged.
Leo..
srnet:
Did you try this on a breadboard, replace the MOSFET with a bit of wire, so easy enough ?
no i did not . this is all theorictical.
have you worked with io expanders before ? if yes
do they retain thier state if atlem is powered down?
for example . i have turned on 4 leds with an io expander. then i disable i2c bus and turn the mcu off . io expander will get its power .(io expander is not turned off)
will the 4 leds remain on ? or io expander changes its state to high z and turns off the LED ?
manveen_singh:
no i did not . this is all theorictical.
When looking at minimising power, its essential to try stuff for real, all sorts of unexpected things can happen when you start switching stuff on and off.
I have not worked with IO expanders, apart from the PCF8574 for driving LCD displays, but if I wanted to know what happened to them under various conditions I would check on a breadboard. You can get all sorts of rubbish info from the Internet anyway.
srnet:
When looking at minimising power, its essential to try stuff for real, all sorts of unexpected things can happen when you start switching stuff on and off.
yes thank . i did not have these parts as of now so i was creating theorys .
srnet:
I wanted to know what happened to them under various conditions I would check on a breadboard.
raschemmel:
And while we're at it, I2C pullups should be 4.7k, not 10k. It might work with 10k but all the circuits
I've seen had 4.7k pullups.
I2C specs say 1-10k, and the actual value you need depends on the bus speed and bus capacitance. As long as the rise time is short enough (depending on the speed you want) you're fine.
Most breakouts that I have here use 10k, so if you have three of them on the bus you're down to 3k or so (3x10k + the Arduino's pull-ups in parallel). I'm pretty sure Arduino's pull-ups are enabled, as I have had I2C run fine without any external pull-ups. So that's another problem for OP's scheme.
Switching I2C's pull-ups off (assuming perfectly successful) would leave the bus floating. That sounds like a really bad idea as the inputs on the connected devices would be triggered, and they will react to it in unpredictable ways as the signal is random. That also likely means an increase in power consumption. Inputs should NEVER be left floating.
srnet:
When looking at minimising power, its essential to try stuff for real, all sorts of unexpected things can happen when you start switching stuff on and off.
I have not worked with IO expanders, apart from the PCF8574 for driving LCD displays, but if I wanted to know what happened to them under various conditions I would check on a breadboard. You can get all sorts of rubbish info from the Internet anyway.
manveen_singh:
i was wondering . is it a good idea to use the given circuit to shut down i2c bus to save power ?
i am using atmel 328p and io expander. io expander wont have any input it has only outputs.
if the circuit does make sense then what kind of mosfet will i use . will i use a level shifting mosfet or will i use a power mosfet ?
i am thinking that before using the bus . turn on the mosfet so that the pull ups shorts to vcc, then use the i2c as normal . then turn off the mosfet so that the mosfet gets disconnected to vcc.
i do understand this will introduce more reistance , Rds ON of the mosfet .
Change the MOSFET to a pFET, and use it to switch the Vcc to the bus as well as the pullups, then you'll have something. Power down the devices on the bus as well as the pullups...
wvmarle:
I'm pretty sure Arduino's pull-ups are enabled, as I have had I2C run fine without any external pull-ups. So that's another problem for OP's scheme.
in atmel chip we can always disable those pull ups.
High value pull up resistors are just fine for one or two slaves on a breadboard, close to the Arduino.
The internal ~33k pull up of an Uno/Nano might already be enough.
But if wire capacitance (length) comes into play, stronger pull up is required.
Most breakout boards use 10k resistors, so you can use up to five modules on one bus.
If 4k7 pull up resistors are used, then pull down could go over pull down limit of standard I2C (3mA) with more than two slaves.
There is also a FastMode+ I2C standard, with 30mA max pull down current.
Good for > 5meter wire distances and/or higher transfer speeds.
5volt Arduinos can do 400khz FM+
Forget about power efficiency. Power is only 'wasted' during the very short data transfer.
Leo..
3mA pull up with 5volt logic calculates to 5/0.003= 1k67 minimum combined pull up resistance.
The Arduino can do a lot better than that, but it's best to stay above that for "standard I2C" slaves.
The datasheet of the chip will tell you if the chip is "standard" or "FM+".
Leo..