Jump to content
  • 0

How to Use the AD3 Current & Power Adapter on an ESP32-H2?


siatran

Question

Hello everyone,

My goal is to measure the deep sleep power consumption of an ESP32-H2 using the Digilent Analog Discovery 3. In my previous question on the Digilent forums, Digilent engineer @attila recommended me to use the AD3 Current & Power Adapter to measure the deep sleep current of my ESP32-H2.

Following the instructions from the Getting Started guide (and improvising where need be), I had set up a circuit that uses the Nordic Semiconductors Power Profiler Kit II (PPK2) to provide 3.3 volts. A diagram of the circuit I created can be seen below.

CurrentandPowerAdapterCircuitLarge.thumb.png.2f96c7d259cbb9efe7aea7899794d271.png

In addition, pictures of the actual circuit that I created are shown below.

IMG_8832Large.thumb.png.63f312b254d22615e100762d58b341c8.png

IMG_8833Large.thumb.png.5d916b717ae0aee720c0f25011aeb61a.png

 

On the software side, I am using the Current and Power Adapter Reference WaveForms Workspace given in the Getting Started guide. I powered on my PPK2 to supply 3.3 volts, and I did not turn on the WaveForms supply, as the power supply was coming from the PPK2. When doing so, all I see in the "Scopes" mode of the WaveForms application is that C1, C2, and the current are flat lines, even though the device is on:

Screenshot2024-06-11at10_03_03PM.thumb.png.a04960a78e311991ccc01c9d8b66641c.png

However, this is not the expected energy consumption of my ESP32-H2. In order to double check that my ESP32-H2 was on, I measured the energy consumption of the device. The measurements that I got from the PPK2 (shown below), is what I expect to see from the AD3 and WaveForms application.

Screenshot2024-06-11at10_06_22PM.thumb.png.e46e639f0d608859fc58e36335bab696.png

However, I want to obtain these measurements from the AD3 with the Current and Power Adapter, and not on the PPK2. I described my reasons for doing so in the final three paragraphs of my previous question in the Digilent forums.

When investigating why I was not able to measure the current correctly using the AD3 and the Current & Power Adapter, I found this part helpful from the Getting Started guide:

Quote
  • My current and power in the plot seem to be flat instead of fluctuating like I would expect with my variable power input.

          Make sure the positive 5 V supply is enabled.

This gave me the idea to set up the power supply of the AD3 to 3.3 volts in the WaveForms application:

Screenshot2024-06-11at10_18_05PM.thumb.png.4f3f3f5e7d57a4a91695cc3277255da5.png

I want to note that I did not set the supply to 5 volts, as given in the instructions, as (given my current configuration of the device) using 5 volts will risk frying my ESP32-H2.

When doing so, I noticed that I am able to capture a very small waveform that looks similar to the waveforms I found when measuring my ESP32-H2 current using the AD3 BNC Adapter.

small-waveform.thumb.png.2f63063ccbe66e9f1186ca8f3ff72519.png

However, when I try to zoom in on it, I get a very grainy and low quality resolution of the waveform.

Screenshot2024-06-11at10_27_43PM.thumb.png.bf2d096bb7cea4dbdfa9a1800de2cecb.png

These observations allow me to conclude that I am not using the AD3 Current and Power adapter properly. As a result, I would like to ask the following questions:

  • What am I doing wrong in the setup of the circuit and how I am using the WaveForms Reference workspace given in the Getting Started guide?
  • In the Getting Started guide, I noticed that their setup used green, yellow, blue, and black connectors with "mini-grabber hooks", as can be seen in their final setup image. I tried searching for them in the Digilent store, but I was not able to find these cables. The guide calls them "banana connectors", but even with this information, I'm not sure where I can find these in the Digilent store. Where and how I can purchase these connectors? Given my current setup, will these cables be of any help?

To the best of my knowledge, the only resource I could find on how to use the Current & Power Adapter is the Getting Started guide, so I do not know where else to look.

Any guidance, feedback, and advice on how I can properly use the AD3 Current & Power Adapter to measure the current of an ESP32-H2 under deep sleep (at the granularity of very small currents in uA), using the PPK2 for power supply, would be greatly appreciated.

Edited by siatran
Stated that I could not find much resources that could help me.
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 1

Hi @siatran,

I wrote the Getting Started Guide for the Current and Power Adapter, so let me see if I can help clear up some details, though I think the 4th one is the most critical for you.

1. You must enable the 5 V supply on the Analog Discovery 3 for the Current and Power Adapter to work properly. This 5 V supply is isolated and will not affect your 3.3 V measurement; the 5 V is for the IC present on the Current and Power Adapter to work properly.

2. You don't have your ground connected to black IN (-) and OUT (-) terminals. This is also a required connection as the negative half of the differential oscilloscope input is measuring the voltage on this channel, https://files.digilent.com/resources/add-ons/current-and-power-adapter/CurrentPowerAdapter_sch.PDF; leaving the connection floating as you did will do you no favors to your measurements.
As this is DC power, you will connect the ground pin of the Nordic device both the green capped ground and the black IN (-).
The ESP32 will need to have the ground of its power supply input connected to the black OUT (-) terminal. The green capped ground should be connected to some other ground pin on the ESP32, much like I described in the Getting Started Guide: https://digilent.com/reference/test-and-measurement/current-and-power-adapter/getting-started#connect_the_system_grounds.

3. The banana to minigrabber cables are just random cables I found around the local office. You can obtain equivalent versions from any distributor you prefer Pomona, Mouser, Amazon, etc.

4. As per Table 3 in the Current and Power Adapter Reference Manual, https://digilent.com/reference/test-and-measurement/current-and-power-adapter/reference-manual#current_and_power_adapter_specifications, I do not think you will be able to obtain low uA measurements that you are looking for as the absolute resolution for the smallest range is 350 uA with a +/- 1% full scale accuracy rating.
I am not certain if this specification accounts for the 16-bit with averaging (which is automatically done when sampling at 1/4 of the system clock frequency, so 25 MHz or slower by default), but even if it does not, ~75 uA as your LSB with the +/- 1% full scale accuracy is likely not the resolution you are looking for.

Let me know if you have any questions.

Thanks,
JColvin

Link to comment
Share on other sites

  • 1

Hi @siatran

With DIO-8/9 the gain of the current sense amplifier is set.
https://digilent.com/reference/test-and-measurement/current-and-power-adapter/reference-manual#compatible_products

To eliminate the offset error, quickly calibrate 0 level, under Time/Options: Zero offset or take a measurement and under channel gear menu press Zero: Avg

Link to comment
Share on other sites

  • 1

Hi @siatran,

For clarity, I did not create the workspace, equations, nor adapter itself; those were developed by Mircea Dabacan, PhD, Technical University of Cluj-Napoca Romania, as per 

https://digilent.com/reference/test-and-measurement/current-and-power-adapter/reference-workspace.

All I did was create the getting started guide, do product testing, and organize the information on Digilent's reference site. The Scope Configuration and Settings section of that reference documentation will verify that Scope Channel 2 is used to measure the output of the current sense amplifier.

As Attila indicated, the DIO 8/9 are two Digital I/O pins on the Analog Discovery device itself (not the Basys 3) and are used to set the gain of the current sense amplifier. Eliminating the offset error should be done as he described.

Thanks,
JColvin

Link to comment
Share on other sites

  • 0
Posted (edited)

Hi @JColvin,

Thank you very much for taking the time to help me debug my issues with the Current & Power Adapter. I'm getting closer to where I need to be, and in order to do so, I would like to ask a few follow-up questions.

Using your feedback, I modified my circuit. A diagram of the new circuit I made, along with the picture of the circuit I physically built, are both shown below.

NewCircuitLarge.thumb.png.fbaa816a1b4304060573f14bddf81393.png

PhysicalCircuitMedium.png.92fb360bcfa64166b62d1a7e0cf2e8c7.png

I then turn on the AD3 power supply at 5 volts. I only turned on +5V, and I left the negative power supply off.

Screenshot2024-06-18at12_19_44AM.thumb.png.a8f08dc3f127e6c2d12e22ad1724cc3c.png

After doing so, I was able to get waveforms that look similar to the ones that I captured using the PPK2 in the Waveforms application.

In this screenshot, I was able to get the waveform on wakeup on Channel 2:

Screenshot2024-06-18at12_21_48AM.thumb.png.855e74aeae2e229fc36d8361f81abd00.png

In this other screenshot, the waveform is shown in the "i" channel:

Screenshot2024-06-18at12_22_02AM.thumb.png.7e4fff61e4f37ef2e8c31237f36ca9da.png

When taking both of these screenshots, I am using the example Waveforms workspace that you created in your Getting Started guide. However, with the channel displaying the current "i" in particular, I found an issue:

  • The current is always shown to "offset from" that is more than ~36 mA. In other words, as can be seen in the screenshot above, both the deep sleep and wakeup current are greater than ~36 mA. However, I am expecting for the current to be current to be "offset from" 0 mA. Even though the Current & Power Adapter can only supports a precision of no smaller than 350 uA, I would expect the deep sleep current to be really close to 0 mA/uA.

Furthermore, I noticed that the equation you created for the current:

Screenshot2024-06-18at12_31_45AM.png.0d4e77fd5a69c13d58880dc15c9c009d.png

Depends on DIO8 and DIO9, which exists in the Basys 3 FPGA board that you use in the Getting Started guide. However, I don't believe such pins exist in the ESP32-H2. As a result, I believe this offset problem may becoming from the equation for the current "i", and I need to modify it to accurately measure the current for the ESP32-H2. However, I'm not sure how to modify your current question to accomplish this goal, or even to modify your equation to measure current in a general manner (i.e. agnostic to the device under test).

As a result, I have the following follow-up questions:

  1. How can I modify the current equation you made in the Waveforms workspace to make it calculate current independent of which pin is available in the MCU. In other words, what do I need to change in the current equation, given that my ESP32-H2 doesn't have DIO8 or DIO9 pins on it?
  2. What could be the issue causing the current measurements on the AD3 to have the deep sleep current be around ~36 mA, rather than around ~0 mA? What corrections do I need to make to the circuit, and/or changes to the Waveforms workspace, to get waveforms that match similar to what I found on the PPK2?
  3. This is a trivial question, but is the channel in which the current is being measured Channel 1 or Channel 2? Given the specification, I believe it is Channel 2 is the channel that should be interest of me. However I would like to double check and ask.

At a higher level: I want to use the AD3, with the Current & Power Adapter, to verify that the measurements I got on the PPK2 are actually correct, especially when the device is deep sleep. Although the resolution of the AD3 can only be measured up to no smaller than 350 uA, I believe I can still use it to accomplish this goal. If the AD3 is showing the deep sleep to be oscillating around 350 uA at deep sleep, then I can confirm that my PPK2 measurements are accurate. Although 350 uA is much more than 7 uA, I was actually initially getting ~1.2 mA deep sleep current on my PPK2, before modifying my ESP32 configuration to show ~7.5 uA on the PPK2. I just need to use the AD3 to confirm that my modifications were successful.

In other words, if I get ~350 uA of deep sleep current using the AD3, and not ~1.2 mA of deep sleep, then I can be confident that I configured my ESP32-H2 correctly such that it can perform deep sleep properly. I hope the explanation of my goals can help explain why I am asking the questions I am asking.

Any further guidance and feedback on the circuit of Waveforms configuration that can help me address these issues would greatly be appreciated.

Sincerely yours,

siatran

Edited by siatran
Link to comment
Share on other sites

  • 0
Posted (edited)

Hi @attila and @JColvin,

The "zero offset" setting help solved that issue. Thank you so much!

In addition, I have one more follow-up question. I was able to get a waveform that looks similar to what I got from the PPK2, as can be seen below:

Screenshot2024-06-19at12_19_34PM.thumb.png.c9d39d70454f6121cb11ed304a1ff1e7.png

However, when I zoom in on the deep sleep current, all I get are noisy measurements which oscillate between 3 mA and -1 mA:

Screenshot2024-06-19at12_20_36PM.thumb.png.b19d030dcd5676043a284759dc2421e4.png

In order to see if what I got on the PPK2 was consistent, I turned on the measuring capabilities of the PPK2, keeping the circuit that I made intact. The readings I got from the PPK2 oscillate ~11-12 uA:

Screenshot2024-06-19at1_09_34PM.thumb.png.4307f5e81520490a4258213ed731d133.png

This is the deep measurement I am hoping to get from the AD3. Keep in mind that I am measuring with the PPK2 using the circuit I made that includes the Current & Power Adapter.

As an aside: Since the specs state that the adapter uses a shunt resistor, I believe the resistor is the reason that I am getting deep sleep measurements slightly higher than ~7 uA. If I remove the AD3 and the Adapter from the circuit, I'll get the expected ~7 uA of deep sleep on the PPK2.

As a result, my higher level question is regarding the grainy deep sleep current measurements that I am getting on the AD3. What steps should I take in order to debug why it isn't giving me deep sleep measurements similar to what I would get on the PPK2? Or is the grainy measurements expected on the AD3, and it's indicative of something wrong with how I configured the PPK2 and ESP32-H2.

Any further guidance would be greatly appreciated.

In addition:

Rather than looking at the current "i", I looked at voltage drop shown in Channel 2:

Screenshot2024-06-19at1_37_00PM.thumb.png.c426293b79ff4e4563a5100fc2633edb.png

when I zoom in on the voltage drop under deep sleep, I get ~300 uV:

Screenshot2024-06-19at1_38_05PM.thumb.png.b256b96a8a0908efdf6edbd655de7222.png

This is what I would expect to see in the current "i". However, I'm not sure if looking at Channel 2 directly would give me any accurate or useful information regarding the deep sleep current.

Edited by siatran
Talk about what I found in Channel 2, and how it's close to what I'm looking for.
Link to comment
Share on other sites

  • 0
Posted (edited)

Hi @attila,

Earlier in the week, you told me that:

On 6/19/2024 at 11:53 PM, attila said:

However, I don't see an option to set DIO 8 and 9 to "high" from either Patterns or StaticIO from Waveforms. I read through the documentation, and although it gave me the higher level idea on what's going on, I'm not particularly sure how to set it in Waveforms.

Using the Patterns application in Waveforms, I set DIO 8 and 9 to the value of "3", so their measurements occur in the range of -2.5 A to 2.5 A:

Screenshot2024-06-25at2_25_21PM.thumb.png.5d82fb1d9937bad349671ea365442724.png

 

However, doing so didn't really improve the accuracy of the deep sleep measurement:

Screenshot2024-06-25at2_27_51PM.thumb.png.b82d416f41d8e6d5a062b24f654fddbc.png

Is this the correct way to set DIO 8 and 9 to "high"? What steps can I take so I can see the deep sleep current at the uA level?

I know this may be an extremely trivial question, but can you give me more detail on what I options I need to navigate through in Waveforms in order to set DIO 8 and 9 to high? Any guidance to help set me in the right direction would be greatly appreciated.

Edited by siatran
Link to comment
Share on other sites

  • 0

Hi @attila,

Thank you very much for taking the time to answer my question. Are there any additional configurations I can do to increase the accuracy, or are the waveforms I shown in the previous forum post as accurate as I can get? In other words, I won't be able to obtain uA accuracy at this point. 

However, I believe that wouldn't be the case, as the specs state that 350 uA is the minimum. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...