Sign in

Not a member? | Forgot your Password?

Search blogs

Search tips

Free PDF Downloads

Advanced Linux Programming

What Every Programmer Should Know About Memory

Introduction to Embedded Systems

C++ Tutorial

Embedded Systems - Theory and Design Methodology

Microcontroller Programming and Interfacing

Introduction to Microcontrollers


More Free PDF Downloads

Recent Blogs on EmbeddedRelated

Optimizing Optoisolators, and Other Stories of Making Do With Less
posted by Jason Sachs


Coding - Step 0: Setting Up a Development Environment
posted by Stephen Friederichs


Ada - 7 Segments and Catching Errors
posted by Mike Silva


OOKLONE: a cheap RF 433.92MHz OOK frame cloner
posted by Fabien Le Mentec


Practical protection against dust and water (i.e. IP protection)
posted by Dr Cagri Tanriover


Introduction to Microcontrollers

1 - Beginnings

2 - Further Beginnings

3 - Hello World

4 - More On GPIO

5 - Interrupts

6 - More On Interrupts

7 - Timers

8 - Adding Some Real-World Hardware

9 - More Timers and Displays

10 - Buttons and Bouncing

11 - Button Matrix & Auto Repeating

12 - Driving WS2812 RGB LEDs

13 - 7-segment displays & Multiplexing

See Also

ElectronicsDSPFPGA

Embedded Systems Blogs > Dr Cagri Tanriover > A Useful Current Profiling Method

Dr Cagri Tanriover (contact)
Cagri Tanriover is an Electronics and Telecommunications Engineer with an MSc in DSP and a PhD in Information Theory. He has worked at senior engineering, team leading, ...show full bio

Would you like to be notified by email when Dr Cagri Tanriover publishes a new blog?

  




Pageviews: 1045

A Useful Current Profiling Method

Posted by Dr Cagri Tanriover on Jul 2 2012 under Circuit Design | Test Equipment | Measurement   

 

In one of my recent projects, I had to capture the dynamic current profile of a short-range wireless embedded platform for a number of operation scenarios. Due to the dynamic nature of the current consumption involved, I was unable to use a standard voltmeter for this job. On the time axis, I needed a minimum resolution of 1 millisecond and the accuracy of the current measurement was supposed to be better than 2 mA. This task would be a piece of cake with a Digital Storage Oscilloscope, which I did not have at the time and therefore I had to come up with a cheaper method to get the job done.

The top-level diagram of the solution I came up with is shown below. I used 3.0 V button cell battery as my power source in all of my measurements, however you can use an ordinary DC power supply in your measurements as required by the particular load you use. The load is the device whose current profile we are interested in. The load’s positive terminal is connected to the battery and the ground terminal is in series with a 0.3 ohm shunt resistor (Rs) that is terminated at ground. The shunt resistor needs to have a small value in order not to cause a large voltage drop across the Rs, which decreases the required operational voltage across the load (You can think of Rs as an ordinary wire with a bit of resistance). The power of Rs is usually a high value (e.g. 1 Watt) in order not to get damaged by the current flowing through it. The voltage across the shunt resistor (denoted Vs) varies depending on the current drawn by the load. This current is simply equal to Vs/0.3 amperes.

 

Platform

Note that Vs is typically small due to the small value of the shunt resistor. Therefore, digitisation and the measurement of Vs directly is difficult and an intermediate amplification stage is necessary. In my application, an amplifier with a gain of ~11 was used. If you need higher gains in your measurements, simply adjust the R2/R1 ratio as needed. The overall gain for the amplifier topology provided is ( 1 + [R2/R1] ). I simply used a general-purpose LM324 opamp which worked really well.

The output of the amplifier is fed to an analog-to-digital converter (ADC) that had a resolution of 10 bits per sample and ran at a sampling frequency of 20 kHz. This sampling rate equates to 50 microseconds between successive samples, which is better than what I needed. Higher sampling rates can provide much better resolution in time but remember that your storage requirements will also increase as a result. The digital output of the ADC is converted to milliamps and for each sample a time stamp in milliseconds is also associated. Note that the blocks indicated inside the dotted lines are an integral part of the microcontroller platform (i.e. AtMega2560) I used in my application.

In my application, I dumped the SRAM content after each measurement session due to the memory limitations of the platform I used. However, I also experimented with real-time serial dump of each ADC sample and that method will also work if your measurement resolution requirements are more relaxed. You can easily use a serial terminal program such as TeraTerm to save the ADC samples.

Using the above set up, it is possible to sample current levels as low as 1.15 mA. Figure below illustrates a captured current profile during the RF transmission of the load I used in my project. The repetitive transmission tasks can easily be identified using the dynamic current profile as shown in the figure.

 

sample_profile

 

 

I hope you will find my tried and tested method for current measurement useful in your projects. The best part of it is it allows you to get accurate measurements without an expensive digital storage oscilloscope!


 



Rate this article:
4.2
Rating: 4.2 | Votes: 5
 
   
 
posted by Dr Cagri Tanriover
Cagri Tanriover is an Electronics and Telecommunications Engineer with an MSc in DSP and a PhD in Information Theory. He has worked at senior engineering, team leading, and project management positions at various SMEs and has over 10 years of international industrial experience. He currently works as an independent technical consultant.

Next post by Dr Cagri Tanriover: LCD Control with an MCU
all articles by Dr Cagri Tanriover

Comments / Replies


jms_nh
Said:
A good overview of testing of this type. I'd add that Rs for current levels of this type usually isn't chosen as a high-wattage resistor, but rather on the basis of voltage drop that takes away from the battery voltage. Even at 100mA, a 0.3 ohm resistor has an IR drop of 30mV and an I2R power dissipation of 3mW. Nowadays even the 0603 resistors are rated at 100mW power dissipation, so neither the IR drop nor power dissipation should be a problem here. In power supply circuits when you get to hundreds of milliamps, then you have to worry more about sense resistor wattage.
2 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
karaadam
Said:
How accurate do you need the current profile? After a cascade of low pass filters, like the Rs and the Opamp, it would be only natural to have your high freq components gone. Are these accounted for?
2 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
Cryptoman
Replied:
I was not interested in the current profile changes above 10 kHz for this application as obtaining an average current consumption was more important than capturing the peak and the transient response that have the high frequency components. The frequency response of the opamp stage including the Rs is reasonably flat until 15 kHz, which is well beyond my area of interest. In addition, the RC constant at the input of the OPAMP is ~3 ns that gives sufficient charge/discharge latency for my input signal.
2 years ago
0
Sorry, you need javascript enabled to post any comments.