Professional Documents
Culture Documents
Lab 6 - IoT Sensor Node Power
Lab 6 - IoT Sensor Node Power
Teaching Solution
U3813A/14A IoT System Design and
Validation Fundamentals
Lab 6: IoT Sensor Node Power
Answer Sheet
Lab 6: IoT Sensor Node Power IoT Systems Design and
(Answer Sheet) Validation Fundamentals
Table of Contents
Notices ......................................................................................................................................................................... 2
Copyright Notice .................................................................................................................................................... 2
Edition .................................................................................................................................................................... 2
Printed in: ............................................................................................................................................................... 2
Published by: ......................................................................................................................................................... 2
Technology Licenses ............................................................................................................................................. 2
Declaration of Conformity ...................................................................................................................................... 2
U.S. Government Rights ........................................................................................................................................ 2
Warranty ................................................................................................................................................................ 2
Safety Information .................................................................................................................................................. 2
Objective ....................................................................................................................................................................... 5
Pre-Lab Setup Instructions ........................................................................................................................................ 5
Equipment Required .................................................................................................................................................. 5
Accessories Required ............................................................................................................................................... 5
Software Required ..................................................................................................................................................... 5
Task 1 – Connect Sensor Node Zigbee with Gateway Zigbee ..................................................................................... 6
Task 1a – Set Up the Gateway ................................................................................................................................. 8
Task 1b – Connect the DIGITAL TEMP SENSOR to the BeagleBone ................................................................... 11
Task 1c – Set Up the Sensor Node ......................................................................................................................... 14
Task 1d – Verify Gateway-Sensor Node Zigbee Network Setup ............................................................................ 17
Task 2 – Characterize Static Power of the Sensor Node ........................................................................................... 23
Task 2a – Measure the Total Current Consumption of Sensor Node (U3810A) .................................................... 24
Exercises ............................................................................................................................................................. 27
Task 2b – Measure the Current Consumption of the Zigbee Module ..................................................................... 30
Exercise ............................................................................................................................................................... 33
Instructor Answer ................................................................................................................................................. 33
Task 2c – Measure the current consumption for the DIGITAL TEMP SENSOR .................................................... 34
Task 2d – Calculate the current consumption for the BeagleBone module ............................................................ 37
Exercise ............................................................................................................................................................... 37
Task 3 – Characterize Dynamic Power Consumption ................................................................................................ 38
Task 3a – Measure the Dynamic Current Consumption for the Zigbee module ..................................................... 42
Task 3b – Measure the Dynamic Current Consumption for the U3810A ................................................................ 45
Task 4 – Measure Dynamic Power Consumption from Sleep to Wake in One Sweep .............................................. 48
Exercise ................................................................................................................................................................... 52
Instructor Answer .................................................................................................................................................... 52
Objective
In this lab, static and dynamic power consumption for sensor nodes will be introduced. The measurement will cover
the sub-circuits available in sensor nodes.
IMPORTANT
You must complete Lab 1 before you start this lab. There are basic operations that are covered in Lab 1 will not
be covered in this lab. The instructions to install and set up the necessary USB drivers for serial and SSH
connections with BeagleBone are also included in Lab 1.
Equipment Required
1. Keysight U3810A IoT development kit with new BeagleBone Wireless CPU
2. Keysight 34465A Digital Multimeter (DMM) with DIG & MEM option.
3. Laptop or desktop PC running on Windows with internet access (Linux and MacOS may work but are not
presently on Keysight’s list of supported platforms). The laptop or PC must have at least three USB ports
available or you will require a USB hub.
Accessories Required
1. 3x Micro-USB cables
2. 1x XB XCVR (On-board XBee3 module)
3. 1x XB1 or XB2 XCVR (On-board Xbee3 module accessory)
4. 1x Digital temp sensor (On-board digital temperature sensor accessory)
5. 4x Banana jack (4 mm) to J-hook (2 red, 2 black)
6. 2x SMA (f) to SMA(f) RF Coaxial Cable
7. USB hub (Optional to support the use of more than three USB ports)
Software Required
1. Digi XCTU (https://www.digi.com/products/xbee-rf-solutions/xctu-software/xctu)
2. WinSCP (https://winscp.net/eng/download.php)
3. PuTTY (http://www.putty.org/)
Before you continue, you will need to connect the two Zigbee modules with RF coaxial cables as shown below.
NOTE
Before you begin the experiment, configure the Keysight U3810A IoT Development Kit as a “cape” on top of the
BeagleBone CPU, and with the jumper configuration shown below.
The diagram above might appear dark in print outs. Refer to Appendix C – Keysight U3810A Technical
Documents for the searchable PDF to help you locate the locations of the jumpers, connectors and components.
Do not connect voltages greater than 3.3 V to GPIO pins as this may damage the
WARNING
BeagleBone CPU. These over-voltage sources include the VIN pin on the Arduino
Shield and DC Power connectors, +5VRAW, and +5VSYS on interface connectors such
as J10, JP55, and TP51.
Micro-USB
3. Launch the Digi XCTU program (version 6.3.10 or above). You will use the XCTU software on your
computer to communicate with the Zigbee module that is mounted on the Keysight U3810A.
4. Click this icon to add a new device.
NOTE
When the Zigbee module is not detected using Add a radio module (+ icon), use the Discover radio
modules connected to your machine (search icon).
5. Add a new device and select the COM port other than the Keysight U3810A. The XCTU software will
automatically detect the Zigbee device connected through USB. When you click Finish, watch the TX and
RX LEDs flash to confirm the correct XB1 device is added.
Note down this COM port number (this is how you recognize your gateway in XCTU) and do not change
any default settings for UART connection (9600 bps, 8-bit Data, No Parity, 1 Stop bit, and No Flow
Control). This will be your Zigbee gateway.
NOTE
If you are shown this prompt (below), press the RESET button B2101 near the Zigbee module on the
XB1 XCVR board to proceed. This is because the Zigbee module might still be sleeping.
2 1
NOTE
When you are prompted with the “Some settings have an empty value and will not be written.”
message, you can ignore it and click OK to continue.
8. Click Read button to read back the settings from the Zigbee module.
9. Configure the following gateway settings below.
ZS ZigBee Stack 1 Set or read the Zigbee stack profile value. This must be
Profile the same on all devices that will join the same network.
NI Node Identifier Gateway Defines the node identifier, a human-friendly name for
the module.
The default NI value is a blank space. Make sure to
delete the space when you change the value.
DL Destination FFFF Set or read the lower 32 bits of the 64 bit destination
Address Low extended address.
NOTE
It is recommended to use the vertical scroll bar (at the right) to scroll about the XCTU configuration page.
Avoid using the mouse wheel as you will likely change some settings by accident.
Another option is to type “CE” in the Parameter Window to locate the entry cell quickly.
10. Click Write button to apply the settings to the gateway Zigbee module.
11. Click Read button to make sure that the settings are correctly written into the Zigbee module. You may
want to click Write and Read button again to make the changes effective.
Take note that the Operating PAN ID (OP) and Operating Channel (CH) are now updated. Record the
Operating PAN ID (OP) and Scan Channels (SC) values. You will need these values to configure the
Sensor Node Zigbee module settings.
NOTE
A successful startup will indicate that MY=0 which is the 16-bit address of the coordinator and AI=0.
The Zigbee coordinator now allows other devices to join this new PAN based on its Node Join Time
(NJ) value. The default NJ=FF indicates the coordinator will always allow joining.
From To
The LM75 operates on a 2.8 to 5 V power supply. Pull-up resistors are needed for proper I2C communication;
however, the sensor modules already contain pull-up resistors, so you don’t need to connect them manually.
In this task, you will set the hardware address (A0 – A2) to 000 by connecting these three pins to ground. There is
only one I2C device involved in this task.
U3810A
LCD
In order to verify the connections to this point, you will need to power up the U3810 and the BeagleBone to run a
test program.
2. Connect a micro-USB cable from your PC to the J15 USB port.
J15
3. Open Device Manager on your computer and identify the USB serial port of the Keysight U3810A.
NOTE
There are many ways to open Device Manager and the procedures may vary. One way that works on all
versions of Windows OS is to press the Windows Key + R, type devmgmt.msc in the resulting pop-up
window, and press Enter.
4. Login to the BeagleBone using PuTTY software via serial connection with the following credentials.
Username debian
Password temppwd
NOTE
Refer to Lab 1 for more information on the procedures on how to establish a serial communication
between BeagleBone and PC.
5. For the lab codes might have been modified in previous lab session, you will need to reset the codes. Run
the following commands to reset the lab codes.
cd ~
sh LabCodeReset.sh
6. Run the following command to change your current working directory.
cd LabCode/M1-L6
7. Compile and run M1_L6_T1_connectZB. You should see the LM75 temperature on the LCD.
gcc M1_L6_T1_connectZB.c -lmraa -o M1_L6_T1_connectZB
./M1_L6_T1_connectZB
8. Place your finger on the LM75 sensor to warm it. When the display shows an increase in temperature, this
shows that your connections are set up correctly. When the value shown remains unchanged, review your
connections and correct your mistakes before running M1_L6_T1_connectZB again.
9. Press Ctrl + C to end the program.
NOTE
− J103 USB (upper left) allows your computer to directly communicate with the Zigbee module marked XB
XCVR.
− J15 USB (left side) powers the BeagleBone and allows your computer to directly communicate with it.
− J2103 USB (lower right) allows your computer to directly communicate with the Zigbee module marked
XB1 XCVR.
J103
J15
J2103
1. Connect a micro-USB cable from your PC to J103 USB port on the U3810A.
2. Launch the Digi XCTU program (version 6.3.10 or above). You are now using the XCTU software on your
computer to communicate with the Zigbee module that is mounted on the Keysight U3810A.
3. Click this icon to add a new device.
NOTE
When the Zigbee module is not detected using Add a radio module specifying the port settings (+ icon),
use Discover radio modules connected to your machine (search icon).
4. Select the USB serial COM port that corresponds to the Keysight U3810A. The XCTU software will detect
the Zigbee module once it is connected through USB-Serial converter. When you click Finish, watch the
TX and RX LEDs flash to confirm the correct XB device is added.
Note down this COM port number (this is how you recognize your sensor node in XCTU). Do not change
any default settings for UART connection (9600 bps, 8-bit Data, No Parity, 1 Stop bit, and No Flow
Control). This will be your Sensor Node (and Router) Zigbee.
NOTE
If you are shown this prompt (below), press the B101 button next to the Zigbee module on the XB1
XCVR board to proceed. This is because the Zigbee module might still be sleeping.
5. Select the sensor node Zigbee module (Keysight U3810A) in the XCTU software.
6. Click the Default button followed by Write button to reset the Zigbee module configuration. Click Read
button to read back the settings from the Zigbee module.
7. Configure the Sensor Node settings below.
8. Click the Write button to apply the settings to the gateway Zigbee module and click the Read button to
ensure that the settings are correctly written into the Zigbee module. You may want to click Write and
Read button again to make the changes effective.
NOTE
The OP and CH are now updated (same as the OP and CH of the coordinator, respectively). A
successful join will update the MY value with the 16-bit address of the sensor node and AI=0.
Each Zigbee module should have a steady green and a flashing red LED on the U3810A. Otherwise,
disconnect all USB connections. Reconnect the PC to the BeagleBone USB port, the Sensor Zigbee
USB port and to the Gateway Zigbee USB port respectively.
2. You should see a ‘Discovering remote devices’ pop-up window that lists down the Zigbee modules
discovered in the same network. Ensure that the other Zigbee module is listed.
6. Click Cancel button after verification. Click the sensor node Zigbee.
7. Change to the Consoles working mode (at the top-right corner).
9. Click the gateway Zigbee which should be in Console Mode and click Open to establish communication.
Both Zigbee modules can now communicate directly.
10. Type something in the Console log of either the gateway or sensor node Zigbee and do it again with the
other module. You should see the same message appear in the other Zigbee module, as shown in the
example below. This verifies that both Zigbee modules are communicating with each other.
Sensor node Zigbee console:
NOTE
In the case when both Zigbee modules are not able to communicate to each other, verify:
a. All the settings are set correctly as per the instructions.
b. The value for Zigbee Stack Profile (ZS) is the same for both Zigbee modules.
c. Assure that the PAN ID (ID) and Scan Channel (SC) of the sensor node ZigBee is set to the OP
and SC of the gateway Zigbee.
d. In this lab, both gateway and sensor node Zigbee modules are connected to the same PC. To
demonstrate that both Zigbee modules can communicate wirelessly, connect each Zigbee
module to a different PC and try sending message between them.
11. If you have not already done so in a previous task, switch to “Configuration working mode” and click the
Profile icon to save both of your Xbee configurations for use in subsequent labs.
NOTE
If you have not already saved these Zigbee configurations as profiles, you may save time and assure
accurate configurations by copying and extracting the files from the lab code directory in the BeagleBone
to your computer. You may then use the M1_L6_T1_GATEWAY.xpro and M1_L6_T1_SENSOR.xpro
profiles for this Task.
Go to Profile > Create configuration profile and select the profile. For the Router (Sensor node
Zigbee), change the PAN ID (ID) and Scan Channel (SC) to match the OP and SC of the Coordinator
(Gateway Zigbee). Save the profile Router profile you have customized to your network.
The xpro file saved by XCTU is a zip format file. You can use zip software to unzip the file to examine the
contents. Do not use XCTU version older than 6.3.10, the format saved is an xml format.
For more details, read the XCTU change log (XCTU > Help > Change Log).
Now, you will connect the BeagleBone to the XB in the Sensor Node (the Keysight U3810A)
12. Remove the USB connection J103 from the XB XCVR circuit. The absence of voltage on the USB
connection J103 (in red) automatically configures the Zigbee module in the XB circuit to communicate with
the BeagleBone CPU through UART1 with the signal flow (in green) below.
13. Click the network icon on the Gateway Zigbee on XCTU to confirm that the Zigbee radios are still
connected. Press Cancel on the gateway network dialog to continue.
14. If you have not already done so, run the following command to change your working directory to
/home/debian/LabCode/M1-L6/.
cd /home/debian/LabCode/M1-L6
15. Run the following command to verify that M1_L6_T1_static.c and mraa_beaglebone_pinmap.h are
present.
ls
NOTE:
Before you compile and execute the code, inspect it to understand how it works.
NOTE
The nohup and & in conjunction with exit is used to assure that the program continues running after the
USB cables are unplugged by ignoring terminal warnings (for example, HangUP) and redirecting the
program’s output from serial stdout to a file named nohup.out. The ability to run the U3810A without the
USB is useful when operating from an alternative power source such as a battery.
It is normal to expect the nohup command to return the following message as it indicates that it is being
pushed to the background and all the outputs from the command are logged in the nohup.out file:
nohup: ignoring input and appending output to 'nohup.out'
When you complete this lab or wish to change what the CPU is doing, you may end the program running in
the background. Execute ps -ef in Command Prompt to list the active processes. Here is a condensed
version of the processes displayed.
./M1_L6_T1
In the example above, find the ./M1_L6_T1_static program in the CMD column. You can also use the
command below.
ps -ef | grep M1_L6_T1_static or ps -a | grep M1_L6_T1_static.
In the example above, the process ID for that task is 1271. Execute kill 1271 in the Command Prompt.
./M1_L6_T1
Then, execute ps -ef again and observe that process 1271 has terminated. The M1_L6_T1_static program
is no longer running when it is not listed in the CMD column.
19. Observe the LCD as it should display temperature readings from the digital temperature sensor (LM75).
a. The program reads the temperature data from LM75 every 100 ms, and then display and transmit
the data to the LCD every second.
b. Observe the console for the gateway Zigbee where the temperature data will be transmitted from
the sensor node Zigbee (Keysight U3810A) to the gateway Zigbee (connected to the PC)
every 100 ms.
NOTE
The M1_L6_T1_static program is running in the background. Exiting this session will not end or kill the
program.
With the M1_L6_T1_static program is running in the background, continue to the next task. You will need to restart
the program in the background if you are running the next task on another day.
NOTE
This is a continuation from the previous task where the M1_L6_T1_static program is running in the background.
At the Command Prompt, you can type ps -ef and verify M1-T6-L2static is in the process list.
If it is not, type nohup ./M1_L6_T1_static & command to to run the program before you continue on this lab.
With the program running in the background, maintain the USB connection at J15 to the U3810A as it will supply
sensor node power.
For those who are using LiPo battery, verify the polarity visually and with the DMM before
WARNING
connecting it. Below are the images that show correct polarity.
+
-
+
-
1. Turn on the Keysight 34465A DMM and use the test probes supplied to perform a DC voltage
measurement across the 0.1 Ω current-sensing resistor R1 at TP1 and TP2 test points. This voltage divided
by the resistance I = V/R will be a calculation of the current. Be sure to consult the Exercises on how to
maximize the accuracy of this measurement.
Jumper in place
2. Press “Shift” > “Math” > Statistics > Show to turn on the statistic mode.
3. Stop the data acquisition when the sample values reach 100.
4. Record the average DC voltage and calculate the current I in the table below.
5. With the JP1 Jumper still in place, reconnect the test probes to the 10 A current terminals of the DMM and
to the U3810 as shown below. The 10 A terminals assure minimum resistance (50 mΩ) through the DMM.
NOTE
Burden voltage is the V = I x R “droop” created by the current-sensing resistance or the resistance of the
DMM measurement circuit. No DMM can provide instantaneous auto-ranging capability to cover the
wide current range of an IoT device – the momentary high-resistance before up-ranging would appear in
the circuit and create an instantaneous voltage droop that could cause the CPU to reset.
For example, the sleep mode current measurement can be measured by the DMM using a small range
(10 mA), which improves resolution and accuracy at the expense of a higher burden voltage (0.027 V /
10 mA = 2.7 Ω). Active current (300 mA + peaks) is measured on a high range, either 1 A (0.27 V
burden voltage / 1 A = 0.27 Ω) or 10 A (0.05 V burden voltage at 1 A = 0.05 Ω). Hence, you must
manually set the DMM to the 1 or 10 A range to measure the current consumption for the entire sleep to
active process.
7. Remove JP1 Jumper and press Shift > DCI to perform a DC current measurement. When power is
accidentally disconnected, you may need to wait and restart the program after the CPU restarts.
NOTE
By default, the NPLC setting (Shift > DCI > Aperture) is set to 10 each time you power the DMM. The
NPLC and Aperture set the DMM’s integration time where the longer the integration, the more the DMM
can reject power line and other noise. However, a shorter integration will allow the DMM to capture short
spikes better when precise amplitude of the spike is to be measured.
8. Restart the measurement in statistic mode: press “Shift” > “Math” > Statistics > Clear Readings.
9. Press the STOP button on DMM when sample values reach 100.
10. Record the average current (I) in the table below.
11. Press “Shift” > “Utility” > Manage Files > Save Screen to save a screenshot of the measurement result.
You may also change the filename and the save location (either a USB flash drive or to internal memory).
Here’s an example of a screenshot of the measurement result.
You may also use Keysight BenchVue to capture the screen directly on your computer (Refer to Appendix
B – Saving Screenshots with Keysight BenchVue).
12. After completing the measurement, place back jumper JP1 and carefully remove the two test probes.
Exercises
Exercise 1 – Current measurement accuracy
Which measurement is more accurate? Explain why.
Instructor Answer
The error in first method, measuring the voltage across the 0.1 Ω resistor, results from the resistor accuracy, the
resistance of the copper traces added to the resistor value and the measuring instrument accuracy. The error in
the second method, measuring by inserting the current meeter into the circuit, results only from the accuracy of the
measuring instrument. However the burden voltage due to the resistance of the instrument plus that of the wire
length must be considered. For this 148 mA measurement, the first method is likely more accurate.
Can you use this measurement to improve your curerent measurement accuracy? Explain how. Can you compare
the accuracy of this measurement versus the measurement using the DCI function on the DMM?
Instructor Answer
For cases a., b. and c. above, red resistor symbols have been added to show trace resistance locations. The PCB
is designed to have negiligable resistance at pin 1 of JP1.
In a. you should obtain a measurement of < 1 mΩ since no trace resistances are found in the 4-wire measurement.
If you temporarily change the DMM function to 2-wire ohms, you will obtain a measurement of >> 0 Ω due to the
resistance of the two measurement leads to the DMM.
In b. you should obtain a measurement of somewhat higher than 100 mΩ since all four trace resistances are now
included in the measurement. The two upper (vertical) resistances are errors since the device current you are
intending to measure does not flow through them. The two lower (horizontal) resistances are in the current path so
your measurement of those two plus the 0.1 Ω resistor is appropriate and will improve your measurement accurracy
if you use this new measured value as your R in your improved I = V/R calculation.
Case c. improves upon the previous measurement by eliminating the error of the upper right side (vertical)
resistance, assuming the pin 1 trace resistance is small. You may use this new measured value as your R in your
improved I = V/R calculation for best results.
You can see that the 0.1 Ω resistor’s 1 % tolerance represents a small error when compared with trace resistances.
This is why the DMM’s DCI function may be more accurate than a voltage measurement across the 0.1 Ω sense
resistor. However if the DMM’s burden resistance is higher, then you must take into account its burden voltage.
With the M1_L6_T1_static program is running in the background, continue to the next task.
For the configuration of this task, the current to the XB circuit is derived from +5VSYS. The overall sensor current
flows from the USB connector J15 through the Ideal diode U2 to +5VRAW on the U3810A and on to the
BeagleBone CPU. The CPU generates +5VSYS and +3.3 V, and sends it back to the U3810A board. The current
consumption of the CPU may be determined by subtracting of the XB module and the sensor from the the total
current consumption. You will do this at the end of the lab.
First, you will measure the actual resistance of the current-sensing resistor in the power circuit of the Zigbee
module. The current to the XB circuit flows from the DCPA to the BeagleBone and then through the +5VRAW
output of the BeagleBone is as shown below.
1. Turn on the Keysight 34465A DMM and use the test probes supplied to perform a 4 wire ohms
measurement across the 0.1 Ω current-sensing resistor R101 at TP101 and pin1 of JP101 test points as
shown below.
2. Press “Shift” > “Math” > Statistics > Show to turn on the statistic mode. Stop the data acquisition when
the sample values reach 100.
3. Record the average measured resistance R101 in the table below.
4. Now, measure the current consumption of the Zigbee Module. Use the test probes supplied to perform a
DC voltage measurement across the 0.1 Ω current-sensing resistor R101 at TP101 and TP102 test points.
Using the value of R obtained from the 4-wire measurement above, this voltage divided by the resistance
I = V/R will be a calculation of the current:
5. Press “Shift” > “Math” > Statistics > Clear Readings to restart the measurement in statistic mode. Stop
the data acquisition when the sample values reach 100.
6. Record the DC voltage and calculate the current in the table below.
With the JP101 jumper in place, reconnect the test probes to the 3 A current terminals of the DMM and to TP101
and TP103 (3.3VCC) the U3810 as shown below. Choose the 1 A range. Due to the higher resistance through the
DMM (0.27 Ω), lower measured current and burden voltage, you will achieve better resolution and accuracy.
7. Remove jumper JP101 and press Shift > DCI to perform a DC current measurement. As current now flows
through the Keysight 34465A DMM, the DC current value measured should be around 15 mA. When power
is accidentally disconnected, the Zigbee module should not need to be reprogrammed when power is
reconnected.
NOTE
By default, the NPLC setting (Shift > DCI > Aperture) is set to 10 each time you power the DMM. The
NPLC and Aperture set the DMM’s integration time where the longer the integration, the more the DMM
can reject power line and other noise. However, a shorter integration will allow the DMM to capture short
spikes better when precise amplitude of the spike is to be measured.
Exercise
Which measurement is more accurate? Why?
Instructor Answer
The error in first method, measuring the voltage across the 0.1 ohm resistor, results from the resistor accuracy, the
resistance of the copper traces added to the resistor value and the measuring instrument accuracy. The error in the
second method, measuring by inserting the current meeter into the circuit, results only from the accuracy of the
measuring instrument. However the burden voltage due to the resistance of the instrument plus that of the wire
length must be considered. For this lower current, 30 mA measurement, the second method may be better.
11. After completing the measurement, place back jumper JP1 and carefully remove the two test probes. Here
is an example of a screenshot of the measurement result.
With the M1_L6_T1_static program is running in the background, continue to the next task.
Task 2c – Measure the current consumption for the DIGITAL TEMP SENSOR
NOTE
This is a continuation from previous task where the M1_L6_T1_static program is still running. While it’s running
in the background, continue this lab with the procedures below.
As the current to the DIGITAL TEMP SENSOR is expected to be quite low, burden voltage will not be a problem.
Hence, you will use the DCI function of the DMM for this measurement.
1. Remove jumper JP15 and connect the test probes (using J-Hooks connected to jumpers) from the Keysight
34465A DMM to JP15 pins 1 and 2:
a. Connect JP15 pin 1 to the I terminal on the Keysight 34465A DMM (to measure current)
b. Connect JP15 pin 2 to the LO terminal on the Keysight 34465A DMM.
The DIGITAL TEMP SENSOR current should now flow through the Keysight 34465A DMM.
6. After completing the measurement, place the jumper back to JP15 and carefully remove the two test
probes.
7. Use the kill command to stop the M1_L6_T1_static program running in the background. Use command
ps -ef to find the process ID (PID) for M1_L6_T1_static. Type kill followed by the PID to end the
M1_L6_T1_static background process.
For example, type kill -9 1282 to end that process with a PID of 1282.
Exercise
Based on the experiments in Task 2, complete the calculations below.
At least some signal was capture in the continuous case, but what if the signal being measured contained a single
impulse? In this case, the digitizer might miss it entirely as show below:
However, you can “digitize” the signal more accurately when you increase the sample rate of the DMM or change to
the Keysight DCPA
NOTE
This is a continuation from previous task where the M1_L6_T1_static program is still running. Use command
ps -ef to find the process ID (PID) for M1_L6_T1_static. Type kill followed by the PID to end the
M1_L6_T1_static background process. For example, type kill -9 1282 to end that process with a PID of 1282.
With the M1_L6_T1_static program is running in the background, continue to the next task.
NOTE
Remember to run the program with nohup and & in conjunction with & so that the program can run in
the background.
4. Observe the LCD. It should display a temperature reading from the LM75.
a. The program reads and accumulates 120 temperatures from the LM75.
b. Then it transmits all 120 temperatures to the gateway (the Zigbee module that is connected to the
PC) at 100 ms interval. The whole process takes about 12 seconds.
c. Observe the gateway console in XCTU. You should see the temperature values transmitted from
the sensor node Zigbee to the gateway Zigbee.
d. After data transmission, the sensor node will be idle for 20 seconds.
NOTE
Since the program XCTU runs on the PC, the PC must be connected to an XBee module to allow data
transfer. The cable between the PC and U3810A J103 has been removed, isolating the PC from the
sensor XBee. As the Gateway USB is still communicating to the PC through J2103, this explains why
the XCTU console log will display the data received from the Sensor XBee.
Task 3a – Measure the Dynamic Current Consumption for the Zigbee module
You will now use the measurement setups of previous tasks to measure the current consumption of the Zigbee
module and the sensor node (U3810A).
1. Turn on the Keysight 34465A DMM and set up to perform a DCI measurement of the Zigbee module.
Refer to Task 2b – Measuring the current consumption for the ZigBee module for more details on the
procedures.
2. Set the range to 1 A to assure minimum resistance through the DMM.
3. Remove JP101 jumper and press Shift > DCI to perform a DC current measurement. When power is
accidentally disconnected, the Zigbee module should not need to be reprogrammed when power is
reconnected.
Now the current should flow through the Keysight 34465A DMM. The DC current value measured should
be around 14 to 15 mA.
4. Select “Acquire” > Acquire > Digitize on the front panel of 33465A.
5. Configure the sampling rate and duration to 10 kHz and 150 s respectively.
NOTE
By default, the NPLC setting (Shift > DCI > Aperture) is set to 10 each time you power the DMM.
Changing to Digitize mode will change the NPLC to its minimum value. A higher sampling rate will need
a lower NPLC for faster measurement. You can check the NPLC value after power up and check it back
after you have increased the sampling rate of Digitize mode (Shift > DCI > Aperture).
6. From the front panel of 33465A, select “Display” > Display > Trend Chart.
7. Start the digitizing measurement. It will stop after 150 s.
8. After completing the measurement, place back the jumper JP101 and carefully remove the two test probes.
A sample screenshot is shown below.
Busy Reading
Temperature
Data
9. Press “Display” > Zoom to zoom in and see the signals clearly.
10. Observe that the interval of two active data transmissions is about 32 seconds (20 s idle and 120 s reading;
each transmission interval is 100 µs).
11. Pan the signal to view the interval clearly and use the cursor function to measure the interval.
On the other hand, the sensor transmission period is about 12 seconds (120s data sampled at 100µs
interval). The measured period is slightly higher than calculation because the UART transmission (between
the Zigbee module and the BeagleBone module) may incur some delay.
You can also measure the peak current using cursor function (change it to Y) now. Again, you can see
additional information when performing dynamic current measurement.
12. Record the peak current of the Zigbee module in the table below.
With the M1_L6_T3_dynamic program running in the background, continue to the next task.
4. From the front panel of 33465A DMM, select “Acquire” > Acquire > Digitize.
5. Configure the sampling rate and duration to 10 kHz and 200 s respectively.
NOTE
Upon powering up of the DMM, the default value of NPLC is 10. Changing to Digitize mode will change
the NPLC to its minimum value. A higher sampling rate will need the NPLC to be lower for faster
measurement. You can check the NPLC value after power up and check it back after you have increased
the sampling rate of Digitize mode (Shift > DCI > Aperture).
6. From the front panel of 33465A DMM, select “Display” > Display > Trend Chart.
7. Start the digitizing measurement. It will stop after 150 seconds.
8. After completing the measurement, replace the jumper connector in JP1. Carefully remove the two test
probes from TP1 and TP2. A sample screenshot is shown below.
9. Note the peak current for Zigbee module in the Task 3 Exercise at the end of this task and save all the
screenshots. Refer to Task 2b, step 11 for instructions on how to save screenshot.
10. Record the peak current of the Zigbee module below.
NOTE
The DMM measurement aperture (input bandwidth) is a function of sample rate. When you increase the
sample rate (for example 50kHz), you may see a peak current that is higher than the 10 kHz sample rate.
This measurement is more accurate due to higher input bandwidth, but you must sacrifice the digitization
duration due to limited memory.
Peak current is important for designing a voltage converter (LDO or DC-DC converter) as it is the limiting
factor of how “small” a voltage converter can be. When the peak current is low, you can use voltage
converter with lower current rating that could save cost and potentially PCB space.
Additional Information
BeagleBone runs embedded Linux, which is a complex operating system for embedded systems. Hence, there are
many background activities (such as housekeeping scripts from the OS, monitoring scripts, and networking daemon
programs such as WLAN and Bluetooth®) when executing the C program. This creates difficulties in identifying a
specific activity (sensor reading, wireless transmission and idle) through the current traces. However, you can still
see the differences in the current measurement profile when you disable the BeagleBone WLAN or Bluetooth®
radio.
These are the commands to disabling and enabling the WLAN and Bluetooth®:
1. It is important to always execute the command rfkill unblock wlan after completing the
procedure in which you used the command rfkill block wlan. This must always be
WARNING done before your BeagleBone CPU is shutdown or rebooted. For more information see
Appendix.
2. This task uses the M1_L6_T4_sleepwake.c program. This file replaces the while loop codes section of
M1_L6_T3_dynamic.c with the code below:
mraa_gpio_context button1, button2, button3;
button1 = mraa_gpio_init(B1);
button2 = mraa_gpio_init(B2);
button3 = mraa_gpio_init(B3);
while (1)
{
usleep(100000);
int B1_val = mraa_gpio_read(button1);
int B2_val = mraa_gpio_read(button2);
int B3_val = mraa_gpio_read(button3);
if(!B1_val)
{
home_LCD();
clear_LCD();
LCD_Print((uint8_t*)"PwrBtn Resume");
system("systemctl suspend");
sleep(5);
}
else if (!B2_val)
{
home_LCD();
clear_LCD();
LCD_Print((uint8_t*)"Start WiFi");
system("systemctl start wpa_supplicant");
sleep(5);
}
else if (!B3_val)
{
home_LCD();
clear_LCD();
LCD_Print((uint8_t*)"Stop WiFi");
system("systemctl stop wpa_supplicant");
sleep(5);
}
home_LCD();
clear_LCD();
LCD_Print((uint8_t*)"Push B1 B2 B3");
}
NOTE
Remember to run the program with nohup and & in conjunction with & so that the program can run in
the background.
This program will need root privilege to turn on and off WLAN and go into sleep mode.
4. If you have not already done so, turn on the Keysight 34465A DMM and set up to perform a DCI
measurement of the sensor node (U3810A). Refer to Task 2a – Measuring the total current consumption of
sensor node (U3810A) for more details on the procedures.
5. Set the range to 3 A to assure minimum resistance through the DMM, set the range to 3 A.
6. Remove JP1 jumper and press Shift > DCI to perform a DC current measurement.
7. Before you proceed, ensure that the BeagleBone is connected to your WLAN router. Refer to the
“Configure BeagleBone to connect to WLAN network” task of Lab 1 for the instructions.
8. Press the B3 button to disable Wi-Fi connection in the BeagleBone module. Observe that the module is
now consuming from 135 to 167 mA.
9. Press B2 button to enable Wi-Fi connection to the BeagleBone module. Observe that the module draws
about 212 mA (average) when enabled.
10. Press B1 button to put the processor into sleep mode. Observe that the module is consuming only about
36 mA (average).
11. From the front panel of the Keysight 34465A, select “Display” > Display > Trend Chart to configure the
display to Trend Chart.
12. From the front panel of the Keysight 34465A, select “Acquire” > Acquire > Digitize to configure the
acquisition mode.
Duration 10 seconds
15. Press the Run/Stop button on the Keysight 34465A DMM to start the measurement.
16. Wait for a minute before you press the PWR BTN to wake the BeagleBone.
17. The BeagleBone Black Wireless module will wake up from sleep and the current consumption will increase
sharply within a short period. This activity is captured by the Keysight 34465A DMM. A sample screenshot
is shown below:
18. Use the cursor (Press “Display > Cursors) to measure the current consumption level from sleep mode
(36 mA) to active mode (200 mA).
19. Disconnect the J15 USB cable to power down U3810A.
Exercise
Capture the power down waveform and save the screenshot.
Instructor Answer
NOTE
Burden voltage is the V = I x R “droop” created by the current-sensing resistance or the resistance of the DMM
measurement circuit. No DMM can provide instantaneous auto-ranging capability to cover the wide current
range of an IoT device – the momentary high-resistance before up-ranging would appear in the circuit and create
an instantaneous voltage droop that could cause the CPU to reset.
For example, the sleep mode current measurement can be measured by the DMM using a small range (10 mA),
which improves resolution and accuracy at the expense of a higher burden voltage (0.027 V / 10 mA = 2.7 Ω).
Active current (300 mA + peaks) is measured on a high range, either 1 A (0.27 V burden voltage / 1 A = 0.27 Ω)
or 10 A (0.05 V burden voltage at 1 A = 0.05 Ω). Hence, you must manually set the DMM to the 1 or 10 A range
to measure the current consumption for the entire sleep to active process. Using the 1 A range will limit
measurement accuracy to 100 µA and be even worse on the 10 A range.
A DC Power Analyzer can provide zero burden voltage and auto-ranging capability, which greatly improves
the accuracy of current measurement. The DCPA will be discussed in a later course, U3817A/18A.
You have reached the end of this lab and will need to reset the lab codes for future lab sessions. This is to remove
any modifications made in the lab for future lab sessions. Run the following commands to reset the lab codes.
cd ~
sh LabCodeReset.sh
NOTE
Resetting the lab code will erase any changes made in the LabCode directory. If there are any files that you want
to keep, copy them out of the LabCode directory tree first.
3. Select the appropriate driver from the Drivers folder and install.
4. During the installation, Windows 10 users may see this message. Select the Install this driver software
anyway.
5. If you receive this error, follow the steps to troubleshoot this issue.
a. Go to Device Manager. When you see this other device with the Property Manufacturer: Unknown:
then you will need to load the Microsoft version of the RNDIS Device Driver. You also may need to
reload the driver if you change USB Ports. Right-click on the RNDIS device:
f. A warning might appear and click Yes to bypass. Upon the successful installation of the driver, you
should see the new driver in the Device Manager tree.
6. You may check connectivity to the Beaglebone board by ping it from a Command Window:
ping 192.168.7.2
7. Refer to Auto Boot Up Display Setup in Getting Started Guide to connect and power up the U3810A.
8. Use PuTTY and log in into the BeagleBone module with the following details.
− Host Name: 192.168.7.2
− Port: 22
− Connection type: SSH
NOTE
The connection from PuTTY to the BeagleBone is not using serial connection. It uses the USB RNDIS
device network which is a virtual Ethernet network so that you can use TCP connection toBeagleBone.
This method is used since USB2 and its UART will be required for communication to the Zigbee
module in this lab. The Intel Eclispe IDE method is also possible and is covered in the Appendix.
9. Once you have logged in to the BeagleBone module, go to M1-L1 directory and compile
M1L1_LCDAnimation.c program.
cd LabCode/M1-L1
gcc M1_L1_LCDAnimation.c -l mraa -o LCDAnimation
10. Execute the compiled C code:
./LCDAnimation
11. After LCD Animation program is executed, an animation should appear on the LCD as shown below.
12. Press Ctrl + C in the PuTTY window to stop the LCD animation program.
2. Make sure your instrument is connected to your PC, then add your instrument to the BenchVue software.
3. Find the Digital Multimeter app from the applications list and install it. Launch the Digital Multimeter app.
5. Go to Screen Image.
7. Use the toolbar at the right side to draw lines, shapes, highlight and texts on the image.
U3810-66501 Board
Diagram.pdf
U3810-66501
Schematic.pdf
2. Only connect a USB cable from your computer to J15 of the U3810A. The JP1 should be in place while the
JP55 should not be placed.
J15
JP1
JP55
3. Press the Windows key and type Device Manager or type the Run and type devmgmt.msc to open the
Device Manager. Find the COM port that connects to U3810A. Note down the port number. You will need
this to configure the serial communication using PuTTY.
If you see the warning below, the driver was not automatically installed by Windows.
4. Run your PuTTY software and connect to the COM port that you have identified earlier using Serial
connection at 115200 Baud-rate.
NOTE
With the J15 connection for the system console system messages such as
connmanctl> [ 2406.800674] wlcore: ERROR SW watchdog interrupt received! starting
recovery.
…may occur. If they do, press Enter and beginning typing your command on a new line.
When JP1 is in place do not connect a USB cable to both the BeagleBone and J15 at the
WARNING
same time, or anomalous behavior may result.
1. Remove the USB cable from J15 and connect it instead to the BeagleBone CPU USB port to your PC. This
will also power up the U3810A. It may take up to one minute to complete the boot process.
Once the boot process is complete, you should see the BeagleBone Getting Started window or drive listed
in the directory shown in the next image
3. Select the driver for your OS from the Drivers folder and install the BONE_D64.exe file.
4. During the installation, Windows 10 users may see this message. Select the Install this driver software
anyway.
NOTE
You may need to run this step each time a different BeagleBone is connected to the PC.
5. Go to Network Settings, right-click Remote NDIS Compatible device, and select Properties.
6. Click <your Remote NDIS Adapter> and click Internet Protocol Version 4 (TCP/IPv4).
7. Click Properties.
8. Set up the general settings for the IP address as shown below.
6
8
Remote NDIS
Compatible Device
You may receive the following message if you have previously connected a BeagleBone or other device on this
address. Click Yes when the other device is not in use and click No when both devices are not present.
11. You will receive the following message if this is the first time your PC is connecting to the BeagleBone.
Click Yes.
12. Click Open to open the terminal window. Press Enter on your keyboard to check and verify connectivity.
Otherwise, refer to Getting Started Guide to upgrade the firmware.
NOTE
At the present time only .js and .php files run using the debugger mode.
1. Open a file in the editor and double-click the M1_L1_GyroscopeDisplay.c file in the File Navigator.
The Editor window should now show the file below. This is a very intuitive text editor that uses the conventional
Ctrl + C to copy and Ctrl + V to paste. Once the file has been modified, go to the console window to compile it.
2. Run the following command in the console window to change to the directory that you are working in.
cd ~/LabCode/M1-L1
3. Run the following command in the console window to compile the C code.
gcc M1_L1_GyroscopeDisplay.c -l mraa -o Gyro
The Cloud9 IDE is secured so that it can only be accessed via the RNDIS port on 192.168.7.2.
5. In order to enable another network access, it can be opened using the nginx server.blacklist.
This file is located at /etc/nginx/server.blacklist.
a. To add other networks, add the networks to the allow section. This file will need to be edited with
elevated permissions.
sudo nano /etc/nginx/server.blacklist
Once the file has been edited write it out and exit the editor.
b. To allow the new network access, the nginx service will need to be restarted. To do this, run the
command sudo service nginx restart. Access from other web browsers on the
specified network can be made as long as the BeagleBone is connected to that network. Web
browsers form different network locations will all see the same Cloud9 IDE. That is the information
entered and display is the same. This works well for collaboration on problems. An instructor can
open a browser window on a student IDE and help debug the problem.
WARNING20. It is strongly discouraged to enable all networks access to the Could9 IDE. It bypasses the
login credentials.
NOTE
After power or reset, the boot process may take some time to complete before the 192.168.7.2 port becomes
active.
Set Up WinSCP
1. For Windows users, download and install a copy of WinSCP from https://winscp.net/eng/download.php.
Upon successful installation, you should see the WinSCP icon on your desktop.
2. Launch WinSCP and click New Site. Select SCP protocol, enter 192.168.7.2 for Host Name, Port Number
22, debian as username, and temppwd as the password.
3. If this is the first time the computer is connecting WinSCP to the BeagleBone, click Yes to the prompt about
connecting to an unknown server.
PC BeagleBone
5. Drag the “test.txt” file across to copy it over to the BeagleBone using WinSCP.
NOTE
For Linux based systems, copy the file using scp M1-L1.zip debian@192.168.7.2 command.
NOTE
You may want to frequently save your changes as you edit the file due to the risk of losing your changes if there
are any disconnection between your PC and BeagleBone.
11. Click the button below and PuTTY will automatically log in to BeagleBone with the credentials used in
WinSCP.