Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] current draw of sensor in simple circuit

Status
Not open for further replies.

somebody1

Newbie level 2
Newbie level 2
Joined
Oct 31, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,309
I have a simple circuit on a breadboard and I've been doing some current measurements that do not seem to make sense. The schematic is here: https://www.circuitlab.com/circuit/ygk99b/screenshot/1024x768/

There is an MCU and a sensor, communicating over I2C. The MCU reads from the sensor every 10 seconds and the remaining time the sensor should be off and should not be drawing any current. The sensor is powered from an output pin of the MCU ("Pin6" in the diagram). When the sensor is not in use Pin6 is set to low and also SCL and SDA are switched to general purpose outputs and are also set to low. So, at that point all pins of the sensor should be 0V (and they are, as measured with the multimeter).

The MCU consumes about 0.1mA when not reading the sensor. I've measured the current between the MCU and the VCC pin on the sensor (AM2 on the diagram) and it appears to make sense: when reading from the sensor the current is around 1 mA and when the sensor is supposed to be powered off it is 0. I've also tried to measure the current on the SCL and SDA lines when the sensor is off and they show 0 as well.

Now, the problem: when I measure the current between the battery and the breadboard (AM1 on the diagram) it always shows about 1.5 mA, regardless of whether the sensor is on or off. If I physically disconnect the wire between the sensor's VCC pin and the MCU then it drops to about 0.5 mA. And if I disconnect SCL and SDA it drops to around 0.1 mA, which is what I would expect when the sensor is not powered.

I think I'm missing something very basic here. Are some of the measurements simply wrong for some reason? If not, then where is that current going when all pins of the sensor are set to 0V?
 

Guidelines for IC's say to tie unused input terminals to either ground or V+.

The reason is because the inputs can pick up ambient EM or static charge, which is amplified and which may cause switching currents to be drawn inside the IC (whether or not the current goes to an output pin).

I don't know that this is happening in your MCU, but your schematic shows a few pins are unconnected. Try adding a pullup or pulldown resistor to these. See if the meter shows reduced current drain.
 
Remember to take into consideration the currents through R1 and R2. When SCL and SDA are outputs at zero potential, the potential difference across R1 = potential difference across R2 = 3V. So current through R1 = current through R2 = (3/4700)*1000mA = 0.64mA. So total current through R1 and R2 = 0.64mA * 2 = 1.28mA. The resistors are not exactly 4.7k and due to the tolerance of the resistors, the current through them is also not exactly 1.28mA.

Hope this helps.
Tahmid.
 
Guidelines for IC's say to tie unused input terminals to either ground or V+.

The reason is because the inputs can pick up ambient EM or static charge, which is amplified and which may cause switching currents to be drawn inside the IC (whether or not the current goes to an output pin).

I don't know that this is happening in your MCU, but your schematic shows a few pins are unconnected. Try adding a pullup or pulldown resistor to these. See if the meter shows reduced current drain.

Thanks. That didn't seem to be the problem here but it's good to know.


Remember to take into consideration the currents through R1 and R2. When SCL and SDA are outputs at zero potential, the potential difference across R1 = potential difference across R2 = 3V. So current through R1 = current through R2 = (3/4700)*1000mA = 0.64mA. So total current through R1 and R2 = 0.64mA * 2 = 1.28mA. The resistors are not exactly 4.7k and due to the tolerance of the resistors, the current through them is also not exactly 1.28mA.

Hope this helps.
Tahmid.

Thanks, I think that was the problem. When I first measured it it looked like without the sensor connected there was no extra current but I think I must have measured it incorrectly. I removed the part that asserts the SCL and SDA signals low and now most of it is gone. There is still about 0.25 mA which seems to be leaking through SCL in the sensor and the datasheet says that to avoid that SCL should be asserted low, which is why I was doing that but I missed the part where it says that if you do that you should not use a pull-up resistor for SCL but have the master drive it up instead. I will see if my MCU can do that or if not I will leave it like that.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top