Categories

[AmpeROSE] Continuous ∫ntegration

Hello, everyone!

Besides looking into the measurement circuit, one of our tasks for this week, was to establish our plan for continuous integration. The continuous integration routine performed on each commit made to our depot should verify if the contributed code complies with our style guidelines, compiles correctly and passes any tests that have been defined.

A necessary first step in this process was to determine what languages will be part of the Amperose project. We decided to use C for the firmware that is executed on our device, and python for the user interface program that will communicate with AmpeROSE through ethernet. With this in mind, we proceeded to define how our code will be evaluated by our continuous integration routine:

Style verification: we’ll use clang-format to verify the style of C code, based on a configuration file we have defined (a slightly modified version of the Webkit standard). For python, we’ll follow the PEP-8 standard (https://www.python.org/dev/peps/pep-0008/), and use the pep-8 utility (https://pypi.python.org/pypi/pep8) to verify code style.

Compilation: C code will be compiled with the arm-none-eabi-gcc toolchain. Python code will be interpreted with python3.

Tests: We will use unittest for Python unit testing, and Criterion (https://github.com/Snaipe/Criterion) for C.

In conclusion the sequence followed by our continuous integration routine will be: install the dependencies of the python program using pep3 –> check the style of python and C code –> compile C code –> run tests. We’re about to start working in earnest with our development board and with pyqt to implement the firmware and the user interface, so having this routine in place will be very useful in ensuring the quality of our code.

[AmpeROSE] Current Measurement

Hello Everyone !!

This week the whole team was focusing on the measurement part of the project. We studied existing architectures, proposed new ideas based on our specs and read a lot of datasheets to get – finally – a first version of the circuit we are going to use.

The measurement part will consist of the following components:

  • Current Voltage Conversion (using shunt resistors)
  • Amplification
  • Anti-Aliasing Filtering
  • Analog to Digital Conversion
  • Shunt Selector (Continuous Calibration)
  • Calibration Current Generator (Initial Calibration)

This can be summed up in the following figure:(Click for larger image)

In addition to the components present in this figure, we will have a battery power supply and an on-board recharging circuit. But we will discuss the power supply in upcoming weeks.

In the following sections, we will go into the details of each part and discuss its circuitry and its components choice.

Here we go 🙂

Current – Voltage Conversion

The first step of current measurement is to convert current into voltage. As discussed in previous weeks, this can be done using either shunt resistors or feedback ammeters. In our application, we will be using shunt resistors.

The input for this level can come from either the Device Under Test (DUT) or the internal current generator used to calibrate the device.

The current will flow into 4 parallel resistors (R1, R2, R3, R4). The resistor R4 is always connected and it is the only one connected when we are using the fourth range. Each time we want to use a lower range (toward range 1), we switch on the corresponding transistor to use one more resistor and when we want to use a higher range we switch it off.

Recall that the ranges are given as:

Current range Active resistors
1 739 µA   →    303 mA R1+R2+R3+R4
2 7.39 µA   →    3,03 mA R2+R3+R4
3 73.9 nA   →    30,3 µA R3+R4
4 1 nA   →    303 nA R4

 

Recall that these calculations were based on:

  • Maximum burden voltage directly on shunt resistors of 50 mV in order to reduce the effect of the measurements as much as possible.
  • Minimal voltage at the output of the amplifiers of 10 mV, because smaller values will be more prone to noise errors.

In order to choose the right measurement interval, each resistor will be controlled by an automatic switch manipulated in the calibration circuitry.

A potential problem arises: the ON impedance of these switches is not always negligible and thus must be taken into account (in measurement interval calculations AND in the calibration process).

Finally, we get the following circuit for this stage:

 

Regarding the switches, the main criterion is the ON resistance. Another useful criterion is switching time. Given these criteria, we have compiled a list of possible switches to use:

 

Reference ON Resistance (mΩ) Switching Time (ns)
ADG 801 / 802 (CMOS SPST Switches) 400 55
FDC606P (P-Channel MOSFET) 35 250
SI2333DDS (P-Channel MOSFET) 28 115
DMP2035U (P-Channel MOSFET) 35 135
DMG3415U (P-Channel MOSFET) 42.5 1150

 

From the list above, we have chosen the SI2333DDS MOSFET as our best switch candidate.

We get that the values of resistors in the above figure are as follow:

R1 = 145 mΩ , R2 = 16.5 Ω, R3 = 1.65 kΩ, R4 = 165 kΩ.

Note that the value of the equivalent resistor is based on the datasheet and is not necessarily the value in the real case. That’s why the initial calibration is crucial to take all these effects into consideration.

Amplification

The output of the current – voltage conversion stage is a small voltage signal. The Amplification stage will then amplify the signal in order to adapt it to the ADC input.

The main specifications for this stage are as follows:

  • A Gain of 82 with a Bandwidth of 100 kHz.
  • A circuit that blocks any current flowing from the measurement stage

Note that the only current flowing into this stage are bias currents of the operational amplifiers if the shunt output are connected to the operational amplifiers inputs.

Amplification will be done using the following feedback circuit:

The choice of the Op-Amps is critical. They must satisfy the following criteria:

  • Ultra Low Bias Currents
  • Gain Bandwidth Product >= 8 MHz
  • Ultra Low Noise
  • High CMRR (High Side Configuration)
  • Low Offset Voltage

Given these criteria, a possible list of op-amps is given as follows:

 

Reference GBW (MHz) Noise (nV/√Hz) Offset Max (µV) Bias Current Max (pA) CMRR Min (dB)
AD8618 24 8 60 1 80
AD8067 54 6.6 1000 5 106
ADA4500 10 14.5 120 2 95
AD8655 28 2.7 250 10 85
MAX44251 10 5.9 6 1300 130
MAX44242 10 5 600 10 90
MAX4488 42 4.5 750 150 90

 

Clearly our criteria specifications will result in a trade-off. It is somehow difficult to find an op-amp that satisfies all the criteria perfectly.

Anti Aliasing Filter

Since we are sampling at 100 kHz, high frequency noises will be aliased into the desired frequency range. To prevent this problem, we must use a low pass anti aliasing filter whose cutoff frequency is equal to the maximal frequency of the signal (50 kHz).

A simple passive RC filter will do the job. Recall that the cut-off frequency of a RC filter is Fc = 1/(2*Pi*R*C).

Given these specifications we get R = 1.45 KΩ and C = 2.2nF.

The anti-aliasing filter will then be as follow:

Analog to Digital Conversion

The amplified and filtered voltage representing the current flowing into the DUT will be placed at the input of an ADC in order to send the current measurement to the microcontroller.

The main criteria for the ADC are:

  • Resolution = 24 Bits
  • Sampling Rate >= 100 kHz

Other criteria include signal to noise ratio, distortion, linear and nonlinear errors…

Given these specifications, the following ADCs may be used:

Reference Number of Bits Output Data Rate Output Format Number of Channels
AD7176-2 24 250 KSPS Serial 2 – 4
AD7760 24 2.5 MSPS Parallel 1
AD7764 24 312 KSPS Serial 1
AD7766 24 128 KSPS Serial 1
AD7768-4 24 256 KSPS Serial 4
ADS127L01 24 512 KSPS Serial 1
ADS1274 24 128 KSPS Serial 4
ADS1672 24 625 KSPS Serial 1
ADS131A02 24 128 KSPS Serial 2

 

We are considering for now AD7176-2. This ADC guarantees > 17 noise free bits when we are sampling at 250 kHz.

This will require a reference voltage of 4.1V. We will then use an adjustable voltage regulator.

Shunt Selection & Calibration

Now for the tricky part. Our first approach was to use a microcontroller to do the calibration. However this approach will result in latency and potentially – for high variations – disastrous effects on the measurement.

Our second approach was to use the fast (2.4 MSPS) but not so accurate internal ADC of the microcontroller as a comparator and performing the calibration in the associated interrupt routine.

This approach is somewhat appealing, however it is not the best. The problem with this approach is that calibration time may take up to 3 us each period (Note that this value is calculated as the sum of a conversion time of a 500 ns and the time taken for each instruction in the ISR, as well as the latency for interrupt handling)

The most efficient approach, it seems, is to use hardware logic for the calibration. We are currently discussing and finalizing the calibration logic. We are thinking of two different ways to approach the hardware logic. The first one is to use a circuit similar to the one used in Nordic PPK. The second approach is to use RS latches.

That’s why we will discuss the calibration logic in detail in next week’s post.

Current Generation & Initial Calibration

Another problem that must be taken into consideration is drifts, offsets and all other errors in the used electronic components. That’s why we must generate a precise current, measure the output measurement of our circuit, and then correct the “correctable errors” in the software.

To generate a current we will use a current mirror. Reference voltage applied to a numeric potentiometer (we will go through the complete range of values) will generate a reference current.

This current will be copied using a current mirror (We can use for example wilson current mirror with 3 transistors or even improved wilson mirror with 4 transistors). This current – with controlled value – will be the input of the measurement stage, during the calibration phase.

By comparing the received and expected values, we can partially correct subsequent measurements. The current generation circuit will be as shown in this figure:

For the digital potentiometer, a possible component is MCP 4351. For the NPN transistors a lot of choices are possible. We can also use MOSFET transistors in Wilson current mirror.

At the beginning of the measurement process, the DUT selector will place our calibration current as input, and then the DUT will be placed as input when this phase is complete.

Note that the switches placed in these figures have been discussed in the current voltage conversion part.

That’s All !!

That concludes our current measurement stage. Since this is a primary design, it is always subject to modifications and improvements.

This week we will finalize the calibration logic and we will have a primary idea on the measurement stage PCB.

Please feel free to give suggestions 🙂

Until next week.

 

AmpeROSE Team

[AmpeRose] Protocol Definition

Good evening, everyone,
This is Michel from team AmpeRose, and this week, I had the task of defining the communication protocol between our device, AmpeRose, and the graphic interface meant to display the measurements.

We had already defined (last week) our main data structure as a 32-bit word. We had also announced that we will be using an Ethernet connection. So we have agreed on using a simple protocol defined as follows:

AmpeRose to PC:

AmpeRose will send 32-bit words to the software, using the Ethernet connection. The MSB (Most significant bit) of these words defines them as data words (0) or control words (1):

 

  • Data word: In the case of a data word, the bits [30:8] will be the measured value, bits [7:2] will be the context pins, and the bits [1:0] will define the caliber. This type of words will be way more common than control.

 

  • Control word: If the word is a control word, its value will indicate if it is an ACK, a NAK, or an error. ACK means AmpeRose has executed a command, NAK means that it has refused. There may be multiple NAK and error words, depending on the level of information we wish to have from this message.

 

PC -> AmpeRose:

The computer will send command words to AmpeRose, over the Ethernet connection. Each value of the 32-bit word will correspond to a specific command. There will be start and stop commands, frequency calibration commands (preset values), as well as commands to choose whether to read from the SD card or do live measures.

Note that some commands, such as switching from direct measures to SD card may only be sent while AmpeRose is in a stopped state, and will solicit a NAK response otherwise. The software may consider a command executed only after receiving an ACK response. Commands sent in a certain order will receive ACK responses in the same order.

Here is a small list of possible commands:

  • Start
  • Stop
  • SetFreq50
  • SetFreq100
  • ReadFromSD
  • Measure

This list is far from exhaustive, and is subject to change at any time. But it should give the reader an idea about how the computer will pilot AmpeRose.

 

Having accomplished my task for the week, I spent some time studying a few examples of measurement circuits, to catch up with my teammates who had the task of defining our own circuit, and try to assist them in this critical task. The results of this endeavor, however, are the subject of a different upcoming post!

[AmpeROSE] Choosing AmpeROSE’s Brains

Hello, everyone!

As the time to start building AmpeROSE draws near, we chose the components for its digital part, including a very crucial one, the: microcontroller. We had some aspects in mind to direct us in choosing it:

  • It should have all the communication interfaces our architecture demands: 10/100 Ethernet, SPI and SDIO for the SD card, and USB.
  • It should preferably be an ARM-based processor of the STM32 line, to take advantage of the familiarity with developed with them and the arm-none-eabi toolchain over these past few months, as part of our courses.
  • It should meet our estimations for operations per second. These are not too constraining, as our sampling frequency is a relatively low 100KHz. For the main task of reading the different bits that compose a measurement (the output from the analog-to-digital converter, the GPIO from the device under test, the two bits describing the current calibration) and concatenating them into a 32-bit measurement word, we estimate 800 000 operations per second, including memory accesses, bitwise-or operations and shifts.

In the interest of building an affordable device, we looked at the two most basic processor families that met these requirements: the STM32F207 and the STM32F407. Searching through our component suppliers, it turned out favourite STM32F407 microcontroller, the STM32F407ZGT6, is available for just under three euros more than any available STM32F207 we could find.

Considering this small difference in price, we lean towards using the STM32F407ZGT6 to build our AmpeROSE prototype, as we have already worked with a development board containing them, which could be used to test some of our code. Furthermore, using this more capable processor ensures us some room should it turn out we underestimated the magnitude of the calculations needed, or to add more firmware functionalities further along in the project.

[AmpeROSE] Unveiling the dark side of feedback ammeters

Hello everyone,

In the bibliographic review momo and I made last week about low current measurements, two main designs were mainly considered : Shunt Ammeters & Feedback Ammeters. We also mentioned a third design that we were studying.

In this post, we will start by discussing that third design, then we will present its disadvantages and the disadvantages of feedback ammeters in general and finally we will conclude that shunt ammeters are the way to go.

So here we go …

General Impedance Converters

Let us consider the following circuit (Widely known as General Impedance Converter):

We will label nodes 1-5 from top to bottom. We have the same voltage at nodes 1, 3 & 5 (Inputs of Op-amps). The input current is the current traversing the impedance Z1 while the output current is the current traversing the impedance Z4 (and then the load impedance Z5). In addition the current traversing Z2 is the same current traversing Z3.

Combining all these information we get the following results:

Therefore by choosing Z1 = Z4 and Z2 = Z3, we have a circuit capable of measuring the current while maintaining a very small burden voltage. Cool !!

But wait ?! The simple feedback ammeter does the same thing ! What is then the advantage of such design ?

When we started studying that design, we thought that feedback ammeters can only be used in low side configuration (How deluded we were !). But in fact, both designs can be used in both low side and high side configurations.

However, the main advantage of GIC based ammeter is actually that it can be used to measure current flowing in both directions while simple feedback ammeters can only measure current flowing from the source to the DUT. But since we are measuring IoT devices, bidirectional measurement is not a necessary feature. Thus this design will only complicate our lives. It was interesting however considering and studying new ideas.

Back to Feedback Ammeters

For now, feedback ammeters look like the perfect match for our specifications. Very low burden voltage, used in both low side & high side configurations, used in all pico-ammeters. Awesome ! However, following a discussion with Alexis Polti, we found out that feedback ammeters are not that awesome.

In the low side configuration, the current that passes through the feedback resistor will re-enter the op-amp (it will sink the current to the ground). In the high side configuration, it is the op-amp who will source current to the DUT. In both cases, current will pass through the op-amp and will be modified by the op-amp consequently. The problem comes from the fact that operational amplifiers act like low pass filters. Thus all current peaks (or even smaller variations) will go undetected. This type of ammeters cannot be used in applications where high dynamic range is needed (our application for example 🙂 ).

Shunt Ammeters … Again …

Finally, after taking all these facts into consideration, we found out that shunt ammeters are actually the most adapted design to AmpeROSE. The main challenge for now is to choose the right shunt resistors (and choosing the right intervals) in order to have an acceptable burden voltage.

Next week, we should have the final schematics of the measurement part. We are looking forward to sharing it with you !!

Until next week !!

[AmpeROSE] Calibration intervals

One of the task done this week is the choice of the calibration intervals that will be used for the automatic calibration of the AmpeROSE. The first thing you need to know is that we are going to use a shunt ammeter, so this work is done to exploit this type of ammeter.

First, we fixed the voltage range that will be measured by the ADC. Since our Voltage reference will be 3 V, the maximum input is 3V.  Then we decided to have a minimum input voltage of 10 mV because it becomes hard to convert a voltage around 1 mV precisely.

With these values and the maximum allowed burden voltage of 50 mV, we can calculate the calibration intervals. First, we deduce the amplification needed from the maximum burden voltage and maximum input of the ADC, we obtain an amplification of 60. Then, we calculate the minimum burden voltage which is 166.67 µV. These values define the intervals which have the following form [Rshunt*50e-3; Rshunt*166.67e-6] (or [x; x*300] where x is the minimum current measured).

With all that we got the following intervals (with an ADC of 24 bits):

Current min (A)

Rshunt(Ω)

Current max (A)

Resolution (A)

Error max

Error min

Interval 1

1.00E-09

166666.6667

0.0000003

1.79E-14

0.0017881393%

0.0000059605%

Interval 2

1.00E-07

1666.666667

0.00003

1.79E-12

0.0017881393%

0.0000059605%

Interval 3

1.00E-05

16.66666667

0.003

1.79E-10

0.0017881393%

0.0000059605%

Interval 4

1.00E-03

0.166666667

0.3

1.79E-08

0.0017881393%

0.0000059605%

 

But here we have a problem which is that we cannot have a resistor of 166.67 kΩ or 166.67 mΩ. Moreover, we cannot have any value we want but only multiples of the normalized values. The closest normalized value for us is 165 which will allow us to have resistor of 165 kΩ in the first interval for example. With the normalized values we obtain slightly different values which are the following ones:

 

Current min (A)

Rshunt(Ω)

Current max (A)

Resolution (A)

Error max

Error min

Interval 1

1,0101E-09

165000

3,0303E-07

1,81E-14

0,0017881393%

0,0000059605%

Interval 2

1,0101E-07

1650

3,0303E-05

1,81E-12

0,0017881393%

0,0000059605%

Interval 3

1,0101E-05

16,5

0,003030303

1,81E-10

0,0017881393%

0,0000059605%

Interval 4

0,001010101

0,165

0,303030303

1,81E-08

0,0017881393%

0,0000059605%

 

These values are good for us because we still are able to measure up to 300 mA and 10 nA.

[AmpeRose] Computer interface design and functionalities

Hello everyone!
Today, as we conclude our second week of working on the AmpeRose, we would like to show you a rough view of the interface of the computer software that will be communicating with AmpeRose.

I’ve had the pleasure of helping in designing this interface, along with Abdelhadi, and this is the end result:

Note that the main focus was on the ergonomics and how to include the functionalities, rather than choosing nice shapes on so on. These aesthetic details are easily changeable and need not be determined this early in the development of the project.

Our interface will show a continuously updated graph of the current, and will boast an auto-adjusting scale.It will also show the maximum value for the current in the window, as well as the activation and disactivation instants of the GPIO pins.

On the left side, you can notice a few statistics values, as well as buttons to control the viewing mode (Trigger or Normal mode, FFT mode), and to control AmpeRose itself(Frequency, Start, Stop, etc…).

Moreover, the user has the possibility of reading live data from the Ethernet connection with AmpeRose, or data stored on its SD card.

And finally, the user will be able to change the names of the GPIO pins, from the edit tab. These pins, connected from the DUT to AmpeRose, will provide the user with the ability to customize the pin names when performing tests.

This interface may still be changed of course (hopefully to include more functionalities). We sincerely hope you liked the interface, and welcome any suggestions!

[AmpeRose] Down from 10MHZ to 100KHZ

Hello everyone,

Sampling frequency is one the most important factor in AmpeRose, therefore it must be well characterized and well defined. In this post, I will show you how we passed from a 10 MHz frequency down to 100 KHz.

Introduction

AmpeRose is not made to measure current consumption of any existing device. In fact, it targets a very specific range of connected devices. It is only concerned by those which are low consumption. In order to profile an IoT device, it is necessary to study the maximum current required by its modules, typically, the communication module which consumes the majority of current. As examples of communication modules:

  • BLE
  • Lora
  • Wifi
  • Zigbee
  • Etc…

BLE (Bluetooth Low Energy)

Bluetooth Low Energy is an alternative to classic Bluetooth, with reduced cost and power consumption, while maintaining an equivalent range of communication.
BLE seeks to address devices with low computing power, low cost of production and life expectancy is to maximize. The idea is to reduce their activity time compared to devices based on classic Bluetooth. Raw performance such as the beginning of transmission will therefore naturally be affected.

  • Main features
Distance/range 50m
Over the air data rate 1 Mbit/s
throughput 0.27 Mbit/s
Latency(from a non-connected state) ~6 ms
Total time to send data < 3ms
Peak current consumption < 6 ms
  • Smallest activation time

                  According to https://www.eetimes.com/document.asp?doc_id=1278927, the shortest package would have 80 bits that would require 80 us to transmit it.

Lora

LoRa technology is designed for low-power wide area network (LPWAN) applications. It has a range of more than 15 kilometers and a capacity of up to 1 million nodes. The combination of low power consumption and long range limits the maximum data rate to 50 kilobits per second (Kbps).

  • Main features
Distance/range 15 km
Data rate 50 kb/s
Total time to send data (average) < 300ms
Power consumption during transmission < 40 mA
Average current consumption (active) 10 uA
  • Smallest activation time

          According to:

                       – https://www.link-labs.com/hubfs/DOCS.linklabs.com/2017/01/lora-scalability_r254.pdf

                       – http://www.semtech.com/images/datasheet/sx1272.pdf

         the shortest packet would have 16 bits that would require 320 us to transmit it.

Wifi

WiFi is an obvious choice for IoT connectivity because WiFi coverage is now almost ubiquitous, but it’s not always the right choice.

The WiFi standard, while being the obvious choice for IoT, has limits in terms of range and energy efficiency. To meet these requirements, the IEEE has published specifications for standards
–  802.11ah
–  802.11ax

  • Wifi HaLow 802.11ah

WiFi HaLow technology is based on the IEEE 802.11 ah standard ratified in October 2016. It was introduced specifically to address IoT’s range and power concerns. The 802.11ah standard uses the 900 MHz ISM unlicensed band to provide extended reach with low power requirements. The use of power is further optimized by using predefined periods of sleep / slumber and achieves a radius of one kilometer. In addition, it requires a separate infrastructure (compared to the WiFi standard) and specialized clients.

  • HEW (High Efficiency Wirless) 802. 11 ax

This technology also adds a number of user-friendly features for IoTs. It retains targeted wake up time and 802.11ah station pooling capabilities to help customers save energy and avoid collisions. This technology holds many promise for use as a means of communication in IoT.

  • Smallest activation time: 802.11 ah

         According to https://www.researchgate.net/publication/301776005_Throughput_and_Range_Characterization_of_IEEE_80211ah,

        the shortest packet would require (160 + 264 + 560) us = 984 us to transmit it considering delta = transmission delay as zero.

  • Smallest activation time: 802.11 ax

        According to https://www.researchgate.net/publication/313844761_AP-initiated_Multi-User_Transmissions_in_IEEE_80211ax_WLANs,

        the shortest package would require ~ 168 us to transmit it while only considering the physical header and neglecting the other parameters.

 

Zigbee

Zigbee is designed to meet the requirements of communication between devices. It is a specification that is built on top of the IEEE 802.15.4, communication standard. Zigbee is intended for low flow, low power and low cost applications. For this reason, it is much simpler than other protocols such as WiFi (IEEE 802.11).

  • Main features
Distance/range 10 m
Data rate 250 kb/s
Total time to send data (average) < 300ms
Power consumption during transmission < 30 mA
Power consumption during standby 350 uA
  • Smallest activation time

         According to

                  – http://voip.netlab.uky.edu/~fei/teaching/cs687_smartgrid/slides/3.zigbee.pdf

                  – http://www.springer.com/cda/content/document/cda_downloaddocument/9783319478050-c2.pdf?SGWID=0-0-45-1593332-p180328094

         the shortest package would require 352 us to transmit it.

 

Conclusion

According to this study, we can see that BLE technology has the smallest activation time of 80 us. Therefore, in order to detect the current consumption during this activation time, we must sample at F= 1/80us = 12.5 KHZ at least. However, by including a margin error, we will therefore sample at 100 Khz at least (smallest activation time : ~ 20 us and respect of Nyquist criterion Fe >= 2fmax).

 

[AmpeROSE] How to measure the current – Part 2

Hello everyone!!

This week’s goal was to go through existing articles and bibliography, and discuss low current measurement. After doing a lot of reading, we now have a clearer vision of the methods used for current sensing and the main challenges in low current measurement.

Mmomo already discussed, in a separate post the two main methods used in current sensing (shunt & feedback – Spoiler: other methods exist: we are currently studying a third method in depth. We hope to share it later on this blog , so stay tuned!!).

In this post, I am going to present you with the main challenges that face low current ammeter designers. Accuracy is, evidently, crucial, when it comes to measuring low currents. That’s why I firmly believe that studying potential error sources in advance is extremely important in order to avoid getting to an impasse. Note that many articles found online study this issue in depth. Our main references are application notes from Keithley and National Instruments.

So here we go …

Measurement error sources

Leakage currents

Leakage currents are usually generated by stray resistance paths between the measurement circuit and nearby voltage sources. These currents can degrade the accuracy of current measurements considerably. This kind of errors is generally remedied by using good insulators (such as Teflon or polyethylene) and avoiding materials such as phenolic and nylon.

Zero Drift

Zero drift is the change of indicated zero offset when no input signal is applied. This offset must be corrected by “zeroing”, which means pulling the mass value back to zero(surprise!). Most electrometers include a means to correct zero drift. AmpeRose will make no exception of this rule!

Generated Currents

Any current generated in the measurement device will add up to the measured current and will introduce measurement errors. These currents include triboelectric effect currents and piezoelectric effect currents.

AC Interference

In order to solve this problem, we will use electrostatic shielding, and a battery.

To sum up, choosing the right measurement method is crucial but one must not ignore all the errors and negative effects that appear when measuring low currents. Some of these errors can be reduced by using appropriate shielding and proper cabling. Others must be resolved with more “tailored” methods. In all cases, we will have to take these errors into consideration in our design.

Next Week

Now that we have a better view on the subject, we will choose the appropriate current measurement method as well as the circuit to implement it. Stay tuned!

We would love to hear any suggestions or tips you might have concerning the current measurement step 🙂

AmperROSE Week 3: Architecting AmpeROSE

Hello, everyone!

In this third week of the project, while part of the team focused on researching ways to measure small currents precisely, the rest (Michel, Bilal and me) focused on defining the overall architecture for the digital part of the device, in particular the method used to communicate with the user interface. This is a post explaining our results in this front:

A general view

Our project is divided in two parts:

  • An analog part responsible for the measuring the current being drawn by the Device Under Test (DUT)
  • A digital part responsible for

The interface between the two parts will be, naturally, an Analog-to-Digital Converter (ADC). Here is a general view of the architecture for the digital part of AmpeROSE, in image form:

Below is a couple of comments on the role that some of these components will play in AmpeROSE’s operation:

SD card

We envision two modes of operation for AmpeROSE:

Online mode

In this mode, AmpeROSE is directly connected to a third party (where the user interface program is running) through Ethernet. In this mode, the measurements will be streamed directly to the user interface as they are collected.

Offline mode

Alternately, it will be possible to use AmpeROSE without a connection . In this mode, the measurements will be stored in a SD card, from which they may be recovered later.

GPIO

AmpeROSE is intended as a tool to aid in the profiling and optimization of the energy consumption of iot devices. Thus, it should provide a way to associate meaningful information about the state of the computation with the current measurements.

The solution we have adopted is to add six input pins to AmpeROSE, to which GPIO pins from the DUT may be connected. The user user will then be able to instrument the code running on the DUT to change the state of said GPIO pins in order to reflect the state of the program. For instance, a pin could be toggled depending on whether the device’s WiFi module is on of off.  These inputs will be sampled at the same rate as the current, and their will be associated with the corresponding current measurement when it’s streamed the user interface or saved in the sd card.

ADC

Three measurement ranges will be provided by AmpeROSE:

  • 1 nA      –   1 uA
  • 1 uA      –   1 mA
  • 1 mA     –   1A

One of the main jobs of the processor will be to automatically calibrate the measurement stage to the adequate range as the current being drawn from the battery changes. For the moment, a preliminary calculation indicates that we will not need more than 24 bits (a more detailed calculation is planned very soon). Therefore, we plan to use a 24 bit ADC. Each measurement will then be a 32 bit word consisting of: 24 bits of measurement + 2 bits to indicate the range + 6 bits with the sampled states of the 6 inputs from the DUT.

USB

USB2.0 is a widespread interface supported by a multitude of systems,  from computers to embedded devices. Theoretically, it can transfer data up to 60MB/s. However, due to bus access constraints, the effective throughput of the High Speed signaling rate is limited to 35 MB/s.

Transferring a word at 10 MHZ would give a maximum rate of 32 * 1000000 = 40MB per second > 35 MB/s, therefore, USB2.0 is not well suited for our purpose.

Of course, we could choose USB3.0 that provides an effective data signaling rate of 400 MB/s, however, it is not supported by all devices, and the use of it would add strong constraints in order to use AmpeRose as a precision device to measure low current.

In conclusion, USB will only be used as power supply to charge the battery.

Fast Ethernet

Fast Ethernet is a standard network interface also supported by many systems. It can transmit data up to 100MB/s, so it supports our maximum throughput of 40MB/s at 10 MHZ. In addition, it supports full duplex mode, which means that, while transmitting data to the third party, AmpeROSE will be able to receive commands from it.