Precise realtime current consumption measurement in IoT TestBed

Background The Internet of Things, similar to wireless sensor networks, has been integrated into the daily life of almost everyone. These wearable, stationary, or mobile devices are in multiple locations, collecting data or monitoring and executing certain tasks. Some can monitor environmental values and interact with the environment, while others are used for data collection, entertainment, or even lifesaving. To achieve the wireless part of the system, the majority of sensor nodes are designed to be battery-powered. While battery power has become increasingly ubiquitous, it tends to increase the global carbon footprint of electronic devices. This issue can be mitigated by employing some form of energy harvesting so that batteries can be refilled and the gadget lasts longer, but this does not alter the reality that batteries are still used and eventually discarded. Methods In this paper, the authors emphasize the significance of power consumption in battery-powered devices. To be able to monitor devices’ power consumption, one of the measurable parameters is current. When users know the exact current consumption, they can decrease it by polishing the program or tweaking the duty cycle, making radio transmit fewer data or less frequently, thus decreasing overall power draw. Results In order to simplify current consumption monitoring, the authors have developed a testbed facility that provides real-time current consumption measurements, which may be used to enhance the duty cycle and battery life of the aforementioned devices. Conclusions While minimizing total current consumption is a great way to extend the battery life and, thus, the carbon footprint, the primary culprit in the Internet of Things is radio communications. This transmission is the primary source of current consumption. By determining the exact amount of current drawn during transmission and adjusting it, users can significantly extend battery life.


Introduction
The reduction of electrical energy consumption to extend the battery life of wireless devices is one of the main challenges for modern Internet of Things (IoT) systems 1 .The term "IoT" is commonly associated with everyday objects that are internet-connected and embedded with intelligence.In numerous ways, IoT and Wireless Sensor Networks (WSN) are comparable today.One could argue that WSN is an integral component of the IoT 2 .The total energy consumption of wireless IoT devices is affected by multiple complex factors: (i) the electrical design of the device 3 , (ii) the efficiency of the firmware 4 , (iii) duty cycle of sensor node activity 5 , (iv) duty cycle of the wireless radio 5 , (v) disturbances and interference from other devices deployed in the same environment 6 , (vi) wireless packet collisions 7 and other, which are often noticed only after the deployment of IoT devices.
Because of the complexity of the aforementioned factors the theoretical estimation of energy consumption in real environments is exceedingly complicated, but the empirical evaluation of these factors during the development phase is encumbered by the fact that IoT devices are frequently deployed in situations where they are not accessible and permanent connection to the power grid is not possible 8,9 , such as environmental or agricultural monitoring [10][11][12] , agile manufacturing 13 , etc..This can be solved by combining a system for electrical energy consumption monitoring and a wireless IoT testbed, that could be deployed in a real environment for testing of different operating modes.
This paper describes the architecture and electrical design of a current consumption monitoring solution for the implementation in the "EDI TestBed", a testbed facility(a term defined by Judvaitis et al. 14 ) developed in the "EDI" -Institute of Electronics and Computer Science, Riga, Latvia, further referred to as TestBed V1.This work is built upon the previous iteration of the testbed facility (TestBed V1), which consists of (i) a softwarecontrolled power management unit (PMU), (ii) a digital voltmeter circuit, (iii) a current consumption measurement system, and (iv) full access remote control of the device under test (DUT).
Additionally, several lessons learned describing improvements and requirements for the next iteration of EDI TestBed further referred to as TestBed V2, are provided.

Related work
This section outlines a number of electric current measurement systems that are well-suited for implementation in the IoT.We will begin by providing an overview of the EDI testbed facility.EDI TestBed, which was created by the Institute of Electronics and Computer Science and is referred to as "TestBed V1" in this article, has been described in detail in the available literature.

•
The process of creating the TestBed V1 and its primary operational features are described by Ruskuls et al. 15 .The necessity of testbed facilities in the world of WSN is discussed in this article.
• The architectural design of the measuring system for electric current consumption, which is employed by the TestBed V1, is elaborated upon in the paper by Lapsa et al. 3 .This article describes the strategy employed to resolve the issues of electric current consumption as well as the obstacles encountered.
• A technical implementation of the back-end system is described by Judvaitis et al. 16 .

•
The article by Salmins et al. 17 describes the mobility aspects of WSN development and proposes a solution for the TestBed to alleviate this issue.

•
The article by Judvaitis et al. 18 outlines the future development strategies and incorporates the DevOps functionality into the TestBed V1 core functions.
• TestBed V1 evaluation and practical use cases are provided by Judvaitis et al. 19 and by Elkenawy and Judvaitis 20 .
Previously effective at monitoring energy consumption, TestBed V1 3,15 has since become obsolete due to the increasing range and accuracy limitations caused by the evolution of power technologies and the expansion of IoT systems.TestBed V1 electric current consumption monitoring subsystems operate as follows: • Configurable power supply can be managed to produce a constant voltage in the range from 0.78V to 4.7V by using an adjustable Low-dropout (LDO) voltage regulator; • Current consumption monitoring system range and accuracy depends on the chosen ammeter circuit that acts as a double range shunt ammeter with the ability to choose the range by switching shunt value between 10Ω and 0.82Ω.The output voltage value is captured by a 16-bit 500kHz analog-to-digital converter (ADC) and interpreted as a current value by knowing the shunt resistor value.Measured current range is between 0.1μA-100mA with a maximum relative error of 0.4% There are multiple versions of current measurement systems available for IoT systems.Although most of them lack one or more features that are available and ready to use in the testbed facility.
SPOT -scalable power observation tool 21 , represents a lowcost (< 25$) device for testing low-power IoT nodes.It measures current consumption using a single shunt ammeter channel.Despite the cost, SPOT has an impressive sampling frequency value for 1MHz and good current sense accuracy below 1μA that makes it possible to accurately calculate overall energy consumption value.But SPOT still has two major disadvantages: • It doesn't have a built-in power management unit.
• Current measurement range is only up to 45mA which makes it unsuitable for testing most of the wireless sensor network devices, as current consumption during radio transmitter often exceeds 45m.
The Raspberry Pi compatible energy measurement platform for wireless IoT devices "EMPIOT" 22 , just like TestBed, works using the shunt ammeter approach.The main purpose of this platform is energy consumption testing for each node of an IoT system.The compatibility of EMPIOT with the Raspberry Pi platform allows it to design a wide range of experimental IoT systems.The shortcoming of this system's accuracy -0.1mA.
SANDbed 23,24 is the wireless sensor and actuator network (WSAN) development system that has a testbed facility approach with more use cases than the regular current consumption logger.As with all testbed facility functions, it has the same issues caused by the compromises between price, functionality, and quality.This system has an unusual current range switching solution, it switches between three current ranges instead of a common single or double range solution: 100mA, 200mA, and 500mA.But this solution also has a lot of limitations namely the limited current measurement accuracy, which equals to 2% and maximum sampling frequency value -400kHz; RocketLogger 25,26 , is an open-source energy harvesting logger.Portability allows us to use it for IoT system design.Rock-etLogger has a significant advantage over all aforementioned solutions -its current measurement accuracy, is obtained by using a double current measurement range with a different ammeter technique for each channel.
• Shunt ammeter for a high current range (2mA-500mA) with a shunt value 50mΩ • Feedback ammeter for a low current range (10nA-2mA) with a feedback resistance 680Ω For low-current circuits, the measurement accuracy is 0.03% + 4nA, and for high-current circuits, it is 0.09% + 3μA.Rocketlogger has an in-built configurable PMU with a range from -5V to +5V and a digital voltmeter with 5.5V range and 0.02%+13μV accuracy that allows users to calculate consumed energy using voltage supply from both RocketLogger and external source.
Despite all of its advantages, Rocketlogger has too low a sampling frequency to calculate communication device energy consumption per bit, this limitation comes from 64kHz ADC.
Over time, the essential characteristics of power measurement solutions for IoT devices have demonstrated a consistent nature.This persistence is characterized by enduring technical compromises that restrict the variety of devices that can be effectively tested.A good example is a device described in a paper 27 written in 2022.Since the authors were unable to identify a specific name for this device, it will be referred to as the High Dynamic Range Current Measurement System (HDRCMS) going forward.This paper outlines an IoT device designed for quantifying energy consumption.The device uses a 12-bit ADC and operates at a frequency of 5MHz.It employes a negative feedback current measurement technique to accurately measure energy consumption.This allows for the testing of communication devices as well.Nevertheless, the results indicate significant inaccuracies in the measurements, with a load regulation error of 0.16% and linearity error of 0.32%.
Although the device exhibits impressive performance within the current range of 1μA to 150mA, making it suitable for a wide variety of devices, its voltage range does have some restrictions.Notably, the maximum voltage threshold of 2.5V excludes devices operating with supply voltages higher than the set limit.The main difficulty in power measurement solutions continues to be the presence of unavoidable compromises, highlighting the subtle trade-offs involved in the pursuit of versatile and precise measurements in the ever-chaning field of IoT devices.
While TestBed V2 development previous experience and related works were taken into account to release a non-compromised energy harvesting measurement system with a wide measurement range, high accuracy, and fast sampling frequency to allow wide IoT system type testing.
In the systematic review of available testbed facilities by testbed facilities have any current consumption measurement capabilities, for some of them precise specifications can not be found, and for those that do provide a specification the precision or frequency is not compatible with the latest IoT devices.
The Table 2 shows the different parameters of each identified testbed facility and the EDI TestBed V1.The data is populated with additions from related work section in this article.

Architecture
EDI TestBed has been in development for some time now 15 , and throughout the years has been improved in numerous ways 3,[16][17][18][19][20] .One of the key functions of TestBed has always been energy consumption monitoring, and this function has been improved in several iterations.While the base idea stays the same, there are several improvements to functionality by increasing the resolution and reliability of the TestBed energy consumption measurement system.
Figure 1 depicts the basic functionality of the TestBed V1 current measurement system.Current meter circuitry uses shunt ammeter approach 3 described in detail in subsection High current measurement mode While there are other available current measurement methods 29,30 , this was chosen due to its affordability and ease of use, as the number of components required to accomplish the desired outcome is relatively modest.
The TestBed V1 current measurement scale is set from 100nA up to 100mA.The goal was to measure the consumed current during the nodes' duty cycle, which includes sleep and active mode.During the sleep phase, current consumption is measured in μA while during the active phase, which involves sensor data gathering and radio communications, current consumption can increase and is measured in mA.To be able to measure the current in a range so wide, there were two different precise resistors R sense placed in series with the device under test (DUT) (R load ).The actual resistor used is selected based on the actual current consumed.
The desired power supply for the DUT is +5V DC, which can be provided by an external power supply or a Universal Serial Bus (USB) 2.0 connection from a computer.In this regard, the TestBed V2 maximum reading frequency increased to 500kHz with a 1MHz sampling frequency.
The TestBed V1 has two different variants: (i) Stationary 15 , and (ii) Mobile 17 .The stationary TestBed workstations are placed throughout the EDI building and are supposed to be used only in laboratory conditions, see Figure 2. The mobile TestBed facility workstations have an Ingress Protection (IP) rating of 54 enabled enclosure and are meant to be used outside see Figure 3.

Practical lessons learned from original EDI TestBed
At the time of development, current consumption above 100mA for a WSN node was considered too high, but recently it has become more common to get devices with current consumption much higher than 100mA.For this reason, the 100mA range is defined as a shortcoming and the authors aim to increase it in the latest revision.In addition, the lowest readable current has a 100nA value, this value also has to be improved.For example, the STM32L476xx Microcontroller (MCU) in ultra-low power mode can consume as little as 30nA of current 32 .
ESD protection diodes protect the power supply but do reduce the input by around 0.5V.While, according to USB 2.0 specification 31 , this is within the acceptable range, it makes the system provide power only to low-power functions.While utilizing TestBed V1, we observed that in some instances, the DUT did not function properly, rebooting at, what appeared to be, random intervals or failing to turn on at all.Later, we discovered that there were extra 200 -400mV voltage drops along the USB cables we used, which caused our DUTs to reboot when more power was required or not power up at all when the voltage losses were bigger.In later stages of development, we were able to replace our cables and improve power reliability 3 .
The original current measurement system is suppressed by the small voltage spectrum.While it works on all USB 2.0 devices, it does exclude some USB 3.x devices and different automotive and urban devices.At the time of creation, 5V systems were chosen due to the USB standard, but a closer study reveals that the power supply range should be changed, widening the available spectrum from 3.3V to 15V to expand support for additional devices, as common IoT hardware has similar power requirements 33 .In addition, Power over Ethernet (PoE) has been increasingly used in home security and in other fields 34 .

Requirements
This section describes the set requirements for the new Test-Bed V2, taking into account the latest research and lessons learned from TestBed V1.The block diagram was made to visualise the architecture of the design of TestBed V2 4.

Functional requirements
Functional requirements for the new TestBed V2 describe the basic functionality of what the system is supposed to do and its parameters.While we do describe the whole system, the main premise is the current consumption measurement system.

PMU requirements:
• The TestBed V2 adapter provides the DUT with a controlled voltage source; This indicates that the voltage input to the DUT is precise and stable.
• The TestBed V2 adapter can simulate battery charging and discharging; This requirement remains the same as in the TestBed V1, so that the user may see what to expect from a device as the battery voltage drops by simulating battery discharge.• The TestBed V2 adapter can be powered by a variety of external power sources; If the TestBed V2 adapter can only be supplied by grid power, this can be troublesome, hence additional power supply choices, such as PoE, battery, and external power adapter, must be available.
• To power the TestBed V2 adapter multiple power sources can be used simultaneously; This need is precautionary so that when the TestBed V2 adapter is simultaneously attached to the battery and external power supply, there are no conflicts.
• The TestBed V2 adapter can measure the DUT current consumption in real-time.

Connectivity requirements.
Certain criteria have been established to improve TestBed V2 connectivity with DUT.While using TestBed V1, we realized that various wired and wireless connection protocols would be desirable in addition to the USB serial communication option.

•
The TestBed V2 adapter uses standardized wired and wireless digital interfaces to communicate with the DUT and the TestBed server; To reduce the likelihood of user error, communication must be established in accordance with specific standards, such as supplying the USB 2.0 Type A connector with only 5V DC.In addition, wireless connectivity is being added between the TestBed V2 adapter and the DUT.All employed communication protocols and interfaces must adhere to predetermined standards.

•
The device can be used as a standalone device.
The TestBed V2 adapter consists of numerous modules, such as the power supply and current measuring module.Each of them should be capable of functioning independently.The user should be able to utilize the current measurement module without the TestBed V2 power source, instead powering it directly from a personal computer or laboratory desktop power supply.

Debugging interface requirements.
Requirements for DUT debugging during the development life cycle.There are numerous debugging methods, and their respective requirements for successful and straightforward debugging are outlined here.
• Debug and update DUT firmware remotely; Important characteristics of testbeds include the capacity to remotely update and reprogram the DUT.This useful feature permits the simultaneous reprogramming of many DUTs.

• Reset the DUT operation remotely;
This requirement is useful if the DUT has crashed and is unresponsive, in which case a physical reset must be performed.In most circumstances, this is accomplished via a push button or switch on the DUT, but in our scenario, the reset must be toggled remotely.

• Serial communication channel between the DUT and a remote client/device;
A DUT has to appear as a serial communication device, as a seamless pass-through of the chosen communication channel, this helps with development, as from the client's perspective the DUT is directly connected to the client's development platform.
• Logging capability for the DUT.
A complete log file of data input and output from DUT.
Casing requirements.The TestBed V2 adapter has safety mechanisms for protecting its hardware and connected DUTs in dangerous operational conditions.
IP 54 is the most common rating for devices and is the easiest to achieve, the original TestBed already achieved this IP rating.But it only protects the device from dust and splashing water 35 .
If the TestBed V2 should be used in a more moist environment, for example, a swamp, a lakeside, or in a strong rain, then the rating must be up to IP 57.The protection from dust stays the same, but in addition to that we are increasing protection from being submerged in water up to 1m in depth.In addition, dangerous operational conditions also include protection from overheating.

Operational requirements
The requirements on how and in what conditions the system is supposed to operate are described further.From a theoretical point of view the requirements related to the current consumption measurement of Internet of Things devices have increased recently, the most demanding hardware can achieve as low as 0.03μA current consumption in the most aggressive current saving mode 36 .On the other hand, the narrow Band Internet of Things devices can consume up to 280mA 37 .The voltage of some of the mentioned Internet of Things devices can go from 3.3V up to as high as 15V 38 .Based on the latest IoT devices available on the market we have set a demanding list of requirements for the PMU: • Output current range up to 1A TestBed V2 can also be utilized as a power supply for connected DUT via TestBed Adapter.Thus, TestBed V2 PSU is a universal power supply with an intuitive interface, as it accepts a range of input power sources and prepares them for DUT.
As the TestBed is designed to represent a wide range of operational conditions, authors have distributed the TestBed adapters throughout the EDI main building, including outdoors.TestBed V2 offers control over output voltage and output current, as well as the "stable mode" that attempts to adjust as much as possible for fluctuations in current and voltage.The output voltage and current of the power supply will depend on the power supply topology selected for the testbed facility.

High current measurement mode
For high current range measurements we are still using a shunt ammeter circuit see Figure 5.This method measures gained voltage across a shunt resistor.The current (I) measurement is obtained by dividing this voltage drop measurement (V DROP ) with the known value of the resistor (R S ).
R S is connected in series with a DUT that introduces a voltage drop error to the circuit.The weak point of this circuit can show up if R S is too high compared with a load impedance.So shunt resistance should be as low as possible, to reduce voltage drop across it.For our implementation we have chosen a 50mΩ resistor as a shunt resistor as it will create only 150mV drop if there is 3A load through the measuring circuit, this is the specified upper limit of the current measurement.Also 50mΩ resistor provides the capability to theoretically measure current form 1nA up to 3A using 32bit ADC if there is no noise but in the real world, it is not possible due to noise and voltage drift in the whole measuring circuit.Calculations for this 50mΩ resistor were done using a spreadsheet for visually providing information about ranges, voltage drop, and current capability, spreadsheet is in supplementary data 39 in the Shunt-and-gaincalculations.xlsx file.

Low current measurement mode
In the low current architecture, a feedback ammeter technique is used 5.The feedback ammeter's most significant difference is smaller voltage drop (V DROP ), which makes it possible to measure smaller current changes with a smaller error rate.The current (I) measurement is obtained by dividing output voltage (V O ) with known shunt resistance (R S ) By utilizing an operational amplifier it is also possible to get readings faster than using a shunt ammeter measuring due to the nature of voltage settling across the resistor, if it is needed to measure small current by using the shunt ammeter method then the shunt resistor (R S ) nominal must be high, and that with capacitance form wiring makes large settling time for such circuit.
The specified requirements for power and electric current consumption measurements are presented in Table 3, which emphasizes the differences as compared to EDI TestBed v1.

Simulation
During the TestBed V2 development phase many main component simulations and evaluations were done, these simulations were performed to reduce prototyping iterations and to gain a deeper understanding of how the integrated circuit(IC) will perform in conjunction with other electrical components.
The described simulations are published in supplementary data 39 in the Simulations folder.The circuit simulations for the most important parts of the developed adapter, with the respective file name in brackets, are as follows: (i) main power converter, (ii) TestBed V2 power supply part responsible for DUT power, (iii) multi power input rail part(testbed_ideal_diode file), (iv) "over the top" operational amplifier functionality(opamp_ adc_buf file), and (v) low current feedback amperemeter part(feedback_amp file).
TestBed V2's main power part was simulated due need to check for noise, "Voltage for Input-to-Output Control" and how positive and negative power rails will work.This consisted of buckboost converter LT8210 40 testbed_main_bb _positive_negative file which is used to adjust voltage accordingly from one of the used input rails.Power is regulated accordingly to the next power paths component -LDO LT3045-1 41 , this is achieved by utilizing special LT3045-1 functionality "Voltage for Input-to-Output Control" (VIOC) which controls converter before LDO so that LDO doesn't need to deal with huge voltage difference maximum point detection between input and output of it as LDO by its principle converts voltage difference in heat, furthermore this reduced whole system power and heat waste.The LDO choice was also based on noise parameters as the chosen LDO also has very low noise in the output.As this part is also responsive for negative power rail there is another voltage converter 42 which is in inverter mode to produce negative voltage from positive rail.On the negative voltage circuit buck-boost converter was also used together with negative voltage LDO 43 using the VIOC feature, also to reduce heat and power waste in the system.The resulting circuit produces positive and negative voltage rails that further is used in measurement circuits as they provide very low noise due to design and component choices.
During the development and simulation process for DUT power supplytestbed_psu_filter file, a simple approach was chosen, using LT3081 44 which can be regulated from Digital to Analogue converter(DAC).DAC wasn't included in simulation as simulation as it wasn't necessary.Also, LDO should have the potential to regulate the voltage from 0 to the input rail voltage.In simulation regarding this part protection against a scenario where DAC could provide higher voltage than power supply voltage was included using over-the-top operational amplifier LT6015 45 .In cases where DUT should have a very stable voltage output, there is an implemented capacitor filter for power rail fluctuation if needed.For the TestBed V2 input power rails, there was a need to check and simulate if the system could be powered from different power paths simultaneously not damaging the device itself and also not damaging the power rails.Such an option was simulated with the so-called ideal diode LTC4359 46 which instead of real diodes uses MOSFETs to turn on or off power rails according to the input rail state.For testing purposes, a simulation was created where operational amplifier LT6015 characteristics were tested together with the earlier mentioned over-the-top feature.Another simulation was created for a low current measurement circuit with ultra-low noise operational amplifier ADA4522 47 whose output was fed in ADC driver LTC6363 48 .

Evaluation and results
In this section, the authors describe how they developed the Test-Bed V2 according to requirements and lessons learned from TestBed V1.A brief introduction to the system as a whole is given, with the main emphasis on the current measurement system.The important concept that was kept in mind during the development of the TestBed V2 was versatility and as such diverse supply voltages and operation conditions were the primary features that were maximised.
TestBed V1 utilizes a "multi-processor for multi-function" approach 15 , which results in an exponential increase in complexity with each new feature.In contrast, the new TestBed V2 architecture is planned to utilize a single microprocessor that is powerful enough to perform data processing and support all required TestBed V2 features, increasing the data processing speed and streamlining the system development.To develop the TestBed V2 current measurement system we took inspiration from the RocketLogger architecture Described in Section 2, which enables measurements in two ranges: (i) ultra-low current consumption measurement for sleep mode performance study and (ii) normal operating mode for active state analysis.This approach gives the ability to seamlessly switch between two modes, which gives uninterrupted data to the user about the DUT's current consumption.This means that there is no need to manually switch the current measurement mode while DUT is in sleep or active mode.The two different current measurement modes utilize two different current measurement techniques: A shunt ammeter -for a high current range, and a feedback ammeter for a low current range.
The TestBed V2 adapter inherits the same paradigms as the TestBed V1 itself 3.2.The adapter's primary objective is versatility and with this in mind, the primary focus has to be on developing user-friendly software for the TestBed V2 adapter, which works as a bridge between the TestBed V2 infrastructure and the DUT.The DUT can be operated via the TestBed V2 adapter either as a USB device or as an independent device linked via a terminal block.If the USB topology is employed, it is possible to connect with the DUT via the Testbed V2 adapter using the built-in USB hub or to move the DUT to an independent USB port using pass-thru mode, where another device communicates with the DUT.

Hardware choices
In the initial phase of development, we reduced the number of available ADCs and MCUs that are compatible with our requirements Described in Section 3.2 by looking at their theoretical characteristics.Later we built breakout boards with chosen ADCs and operational/instrumental amplifiers to test real-world performance, to see if by some means the said theoretical performance, like sample frequency in conjunction with test MCUs and single board computers (SBC) e.g, Raspberry PI, RockPI, could not be achieved.
ADC for the current measurement system was chosen to fulfill predefined requirements 3.2 but also consider MCU capabilities to be reasonable.As potential candidates the LTC2335-18 49 and LTC2500-32 50 were chosen.LTC2335-18 was considered due to 1MHz data acquisition speed for measurements, 8 channel multiplex for flexibility and possible design simplicity, 18bit sampling resolution, and SoftSpan feature.SoftSpan enables each output range to be configured via software individually.This can also reduce the complexity of the Printed Circuit Board (PCB).LTC2500-32 on the other hand was also chosen due to 1MHz data acquisition speed and 32bit precision filtered output capabilities.Both ADC supported 100Mhz SPI data transfer frequency that could be sufficient to manage data transfer frequency of 1MHz.
As the TestBed V1 was a multi-processor system, we decided to redesign everything to be more centered but with a more powerful microprocessor.The options were narrowed down to single board computers that could run Linux distribution and had good documentation, (i) Raspberry Pi 4 51 , (ii) Hardkernel Odroid C4 52 , (iii) Radxa RockPi 4 53 and (iv) Nvidia Jetson Nano 54 .Ultimately, the Nvidia Jetson Nano was chosen due to the included Compute Unified Device Architecture (CUDA) cores, which offer possibilities to develop machine learning algorithms and systems powered by artificial intelligence.

Printed circuit board
From acquired requirements, authors designed a six-layer PCB with "Altium Designer" (industry standard for PCB Design) 55 , with open source alternatives available, like "KiCad" 56 , including a power supply unit as well as current measurement system as a single board unit.The necessity to migrate from the twolayer PCB of TestBed V1 to six layers on TestBed V2 was the increased complexity of the new PCB.This PCB is designed to interface with Jetson Nano and act as a bridge between both DUT and Jetson Nano.In Figure 6 is seen the 3D design of said PCB designed with "Autodesk Fusion 360" 57 software, with open source alternatives available, like "Blender" 58 or "FreeCad" 59 .

Casing
The first sketch of the TestBed V2 design was made on a piece of paper, see Figure 7.In the design it can be seen that the enclosure is supposed to act as a passive cooling system for the whole device, therefore improving the thermals and IP rating, because there are no holes for air cooling.All of the necessary ports are routed to the side and are meant to be sealed.To improve the radio coverage the antennas are pulled out of the enclosure so that no metal enclosure would harm the radio reception.
The next step was to use 3D computer-aided design (CAD) software to design a suitable enclosure for TestBed V2, taking into account the PCB that had been designed, see Figure 6, and the fact that the first prototype will be 3D printed using ABS Plastic.There are only TestBed V2 components included inside the enclosure at this stage -power supply, current consumption monitoring system, and central processing unit, which is the Nvidia Jetson Nano 54 developer kit, see Figure 8.As in the sketch, all of the connectors are pulled to the side of the enclosure.As this enclosure is supposed to be plastic, it is impossible to cool the system using it as a housing, so one side of the enclosure has been designed so that air could flow freely cooling the Jetson Nano and other components on the board.To increase the airflow additional cooling fan is attached and fitted to one of the sides see Figure 8.During testing and while choosing the final platform for ADC communication, there also were tests on RockPI and Raspberry PI platforms.Authors tested maximum data acquisition speed from ADC using SPI protocol and hardware connection between ADC and test platform.Additionally to SPI protocol hardware pinout there were used ADC specific trigger pins as BUSY, CLOCK, and DRL to be aware of ADC state.The state of ADC was important as during ADC sampling there should not be data reading as it renders the ADC sample invalid.The BUSY signal meant that ADC was in the sampling phase, the CLOCK signal additional to the SPI clock signal was used as the ADC sampling start signal, and the DRL signal was used as a flag to determine available data on ADC for reading.From the platform side of tests this was done by utilizing kernel module functionality to test platform capability of driving ADC and receiving data streams, used test code is published in supplementary data 39 in the Testbed V1 SBC modules folder.Unfortunately, it was not possible to reliably utilize them even in real-time kernels, as the maximum possible frequency of data would be only ~ 300 kHz on ADC not considering actual data reading.ADC sampling takes around ~ 600ns, while less than 400ns are required to establish the SPI data connection, retrieve data, and prepare for the next transfer.If data is read during an ADC sample cycle, it becomes invalid due to SPI transmission and mixed data stored in the memory buffer of the ADC.In addition, at these sample frequencies and with the SBC continuously triggering for data read, since the ADC triggers an interrupt signal on the SBC for data transfer, the SBC became unusable and unresponsive for any other job.During these tests, the authors decided to discard the concept of using any SBC to communicate directly with ADC from the MCU.

Main boards
During research of other available data reading options from ADC, authors tested different MCU and SBC options like Arduino DUE core board.
Using this "Arduino DUE core" board in conjunction with ADC breakout board 9 by utilizing the same data acquisition and ADC triggering methods as earlier mentioned with SBCs except for the kernel module part as its not applicable to test MCU it was possible to acquire data with a sampling frequency of 300kHz not only triggering as it was with SBC's.Additionally, it was also possible to explore each ADC feature such as data averaging and filtering in the case of 32-bit ADC by utilizing a second SPI data channel of ADC, all of the features are available in ADC datasheet 50 and commented on test code that is published in supplementary data 39 in the Testbed V1 due core test folder.However, given the output capabilities of the chosen ADC and requirements described in Section 3.2, this sampling frequency was insufficient.The MCU board based on an STM32H743VIT6 was the next board evaluated, used test code is published in supplementary data 39 in the STM32H743 CubeMX test folder.Additionally, the same testing scheme as was done with the "Arduino DUE core" board there was used an option to ignore data ready flags, but instead generate a clock for triggering ADC sampling and rely on manufacture-defined timing constraints of ADC, so after triggering ADC sample wait in idle at least 630ns and then without reading any data ready flag assume that data has been captured and use DMA to offload Central Processing Unit (CPU) with direct registry writing and reading to further offload CPU processing cycles, the authors were able to achieve with this scheme a sampling frequency above 900kHz.Research revealed that this was one of the most powerful MCUs on the market at the time in terms of MCU clock speed, pin count, and implementation, so the decision was made to stick with this type of MCU that was a little bit more powerful so that it could perform not only data acquisition but also other tasks, like DUT power supply management and data processing for host system over USB.MCU developed by STMicroelectronics was used after exhaustive research into quicker and more accessible computer platforms.As its clock frequency was 480MHz, the GPIO frequency was also significantly increased.

Discussion
Even though the development of EDI TestBed V2 is not finished yet, we collected sufficient data 39 to verify that we are moving in the correct direction.In future iterations, we intend to isolate the current measurement device and the power supply unit onto different PCBs.When designing both of them, we noticed that most components and functionality required for the power supply unit are already populated on the current consumption PCB, therefore the decision was made to integrate them onto a single PCB for prototyping and usability considerations.
The results achieved for the current measurement functionality of testbed facilities described in this article provide the way for any testbed facility to implement a capable current measurement system.If more testbed facilities would contain a reliable way of current measurements for devices under test, it would improve the quality of developed devices with regards to not only the quality of the product but the overall emission impact as well.Although at the current version, the cost of developing such a current measurement system is quite high, we believe that the cost will reduce in time.Still, the developed system should remain applicable for at least an 8-year period based on the previous iteration.The design choice to integrate the power supply unit into the current measurement system also increases the usefulness of the system because it reduces the chance of external factors impacting the results of the measurements.When the power supply system is out of the scope of the current measurement system, it can have side effects that impact the current measurement system in an unpredicted way, for example, increased background noise.
The EDI TestBed v2 could be utilized to enhance current wireless networks as well as for the creation of new ones.Our current consumption measuring system can identify the highest consumers and time periods, allowing users to utilize the data as they see fit.For instance, one could determine that it is preferable to use an additional Ultra Low Power (ULP) MCU in addition to the main MCU so that the main MCU can be shut down for the duration of sleep, or that there is no need, since the MCU used in the system has a superior sleep mode than the ULP MCU, and waking the MCU can actually decrease the battery's lifetime.Due to the variety of use cases, these findings may vary, for instance, there may be varying needs for the frequency of sensor readings, resulting in variations in the duty cycle.

Conclusions
The article deals with the complex task of precise current measurements for low-power embedded devices within an IoT testbed facility, showcasing how the field of available IoT devices has changed during the last 8 years and how the current state-of-the-art current measurement systems in a form-factor suitable for deployments in a testbed facility has not kept up.The novel solution for the current measurement system for the testbed facility including a capable power supply unit is justified, presented, and evaluated.Based on the initial results, the approach shows promising signs for future current measurement applications for IoT testbed facilities.
• Simulations (folder containing simulations of circuits of TestBed V2)

○
In the paper it should clearly be indicated what is the novelty / the differences between the presented system and the state-of-the-art solutions.

○
The paper should also include a table / graph comparing the performances of the proposed system with the ones available in the literature.

○
A system architecture diagram of the testbed V2 should be included to add more clarity on the system functions and input/outputs, etc.

○
The discussion section should provide an analysis of the results.

○
A conclusion section is missing.

Minor comments:
In the introduction, the authors provide a definition of IoT in the following sentence: "for modern Internet of Things (IoT) systems, which are typically represented as a combination of a wireless sensor network (WSN) and a data processing block1,2".Can you indicate where in these papers [1] and [2] such definition has been given?

○
In the text, some references to sections miss the section title/number.

○
In some parts of the paper "Shunt ammeter" is written shut ammeter.Please correct.The English should be improved in some sections of the manuscript.

○
Please check again in paper [19] the value of the Current measurement maximum range (It should be 45 mA).

○
In Figure 9, the ranges and the units are missing in the axes.Reviewer Expertise: Smart Manufacturing for space systems, IoT, space structures I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.
We have created a table that shows the differences between the identified testbed facilities with current measurement capabilities and the TestBed v1 facility. 1.
The paper should also include a table / graph comparing the performances of the proposed system with the ones available in the literature.
We have created a table that shows the differences between both versions of EDI TestBed.Together with the table described in previous comment, it can be seen how this research and the developed device impacts the IoT current consumption field. 1.

3.
A system architecture diagram of the testbed V2 should be included to add more clarity on the system functions and input/outputs, etc.
We have added a block diagram of the proposed TestBed v2. 1.

4.
The discussion section should provide an analysis of the results.
We have improved the discussion section with an analysis of the results.1.

5.
A conclusion section is missing.
We have added a conclusion section to the paper.1.

6.
In the introduction, the authors provide a definition of IoT in the following sentence: "for modern Internet of Things (IoT) systems, which are typically represented as a combination of a wireless sensor network (WSN) and a data processing block1,2".Can you indicate where in these papers \[1\] and \[2\] such definition has been given?
There has been a mistake in the manuscript editing process which has been fixed.We have also rewritten the paragraph so it would be understood better. 1.

7.
In the text, some references to sections miss the section title/number.Since the Europe Open Research template does not contain numbering for the sections, this was missed.We have fixed the issue. 1. 8.

10.
In some parts of the paper "Shunt ammeter" is written shut ammeter.Please correct.The English should be improved in some sections of the manuscript.
We have gone through the paper and fixed spelling errors.1.

11.
Please check again in paper \[19\] the value of the Current measurement maximum range (It should be 45 mA).
In Figure 9, the ranges and the units are missing in the axes.
We have added the missing axes, although they are not as clearly visible as we would like.To remedy that we added the explanation in the caption of the figure. 1.

13.
Competing Interests: No competing interests were disclosed.Carmen Delgado Pinillos i2cat Foundation, Barcelona, Spain This paper presents the design of a power meter for IoT devices.Since there are too many IoT devices, which are normally powered by batteries and these batteries have dangerous chemicals, being aware of the battery usage and how to make the best use of it is crucial.Authors try to solve this by proposing this device, capable of measure the current consumption.This is the second version of their testbed, and the reviewer has the feeling that the information is a bit mixed.The paper talks about V1 in order to explain the weaknesses that the V2 tries to solve, but this should be clearer explained.Authors could include a table with the differences of the two versions.
The state of the art could be better formulated by making sure the differences between previous works are detailed.For example, when explaining 3, 13, 14, 15, 16 and 17.
Apart from this, the details of the design and implementation are clearly explained and the device might be very useful in many applications.

Is the work clearly and accurately presented and does it cite the current literature? Partly
Is the study design appropriate and does the work have academic merit?Yes

Are sufficient details of methods and analysis provided to allow replication by others? Yes
If applicable, is the statistical analysis and its interpretation appropriate?

Not applicable
Are all the source data underlying the results available to ensure full reproducibility?Yes

Are the conclusions drawn adequately supported by the results? Yes
Competing Interests: No competing interests were disclosed.
Nyquist frequency that represents a maximum reading frequency, f S -ADC Sampling frequency.

○Figure 2
Figure 2 appears in reference [13].The figure caption should contain the reference where the figure was taken from.○ In Equation (1) Fs should be the sampling frequency.

Figure 2
Figure 2 appears in reference \[13\].The figure caption should contain the reference where the figure was taken from.The figure was made by one of the authors of this paper.Nonetheless we have added a reference to the original paper as well.1.

Reviewer Report 27
June 2023 https://doi.org/10.21956/openreseurope.16378.r32554© 2023 Delgado Pinillos C.This is an open access peer review report distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Table 1 .
It is concluded that only 6 out of 32 available Judvaitis et al. 14based on the available dataset 28 , all of the testbed facilities with current consumption capabilities are summarized in

Table 4 . ADC parameters.
ADCTo test both ADCs 4 in question authors set up a test bench where both ADCs were mounted on breakout boards with additional components as per both ADCs datasheets and wiring underneath for communication and data acquisition 9.During testing of 32bit ADC there were multiple hardware and software iterations during selecting adequate MCU and software combination, the software used in the tests is added as additional data to this publication39.The first tests were performed on the Arduino DUO platform using SAM3X8E 32bit ARM Cortex M3 MCU.Those tests were for proof of concept to see if it is possible to acquire any data and how the ADC performs.During testing ADC performance and communication we also used the DSLogic U3Pro16 logic analyzer MCU where the clock source and logic analyser were used as the data acquisition device.The only proof of concept data was captured as screenshots during the XM1000 mote bootup stage via low-speed USB connection 10.

of methods and analysis provided to allow replication by others? Yes If applicable, is the statistical analysis and its interpretation appropriate? Not applicable Are all the source data underlying the results available to ensure full reproducibility? Yes Are the conclusions drawn adequately supported by the results?
PartlyMajor revisions should be applied to the paper.

Is the work clearly and accurately presented and does it cite the current literature? Partly Is the study design appropriate and does the work have academic merit? Yes Are sufficient details of methods and analysis provided to allow replication by others? Partly If applicable, is the statistical analysis and its interpretation appropriate? Not applicable Are all the source data underlying the results available to ensure full reproducibility? Yes Are the conclusions drawn adequately supported by the results? Yes
System for IoT Applications.IEEE Transactions on Instrumentation and Measurement.2022; 71: 1-9 Publisher Full Text ○Competing Interests: No competing interests were disclosed.