 So we'll go to hand zone number 5. So this is a quite interesting one because it's the measuring of the consumption of the WB while in connection or advertising state. So the goal here is to upload again over the air another example. This time it's a heart rate sensor. And this one has been optimized for low power consumption meaning there is no UART locks, there is no LCD displays and it's using stop to mode when there is no code to be executed. So stop to is actually the deepest low power mode which can be used while in connection or advertising state. So to do this measurement we're going to use the power shields which is this board. It's actually a voltage supply which measures the current. So we'll supply the nuclear from the power shield and the power shield communicates with this PC application, cube monitor power through the virtual comport. So just quickly some of the parameters. The tool measures with a very big dynamic range from 100 nmA to 50 mA at a frequency of 100 kHz. So it's a quite nice tool especially for this price. So what we need to do is to supply the nuclear from the power shield. So to do this we just connect the ground and connect the VDD to the jumper above. So this one needs to be removed and we put a jumper wire instead. We also need to disconnect all these jumpers here because they are connected to the ST link and they are increasing the consumption. We want to isolate the target from everything else on the board. So disconnect all the jumpers at the bottom here. And once you've done all this you can connect the USB cable 2 to the power shield. So the tool can actually work stand alone. If you press the user button on the power shield the nuclear will be powered. So because you have there the OTA or point to point server you will see it advertising. But what's more important or more interesting maybe is the dynamic measurement. So for this we're going to use cube monitor power. So what you can do now is open the cube monitor power. Again find the correct virtual comport. So the power shield enumerates as a comport. And you can press take control. And once this is done we can configure several parameters of the measurement. So put the sampling frequency as high as possible at 100 kHz. And put the acquisition time to infinity so that we see everything that is going on. And remember the WB is running either point to point server or the OTA. So these are not optimized for current consumption. So you will see at least a few milliamps. So the next step is to upload the heart rate example. So we have not shown the upload through the cube monitor RF and the dongle. So it's better to use your mobile phone again. So do not follow this part. Locate the heart rate example and save it in your phone and download it into the nucleo. So the heart rate is a very simple bluetooth application. It's sending the heartbeat every second to the phone. So now let's have a look at what we should see when we measure. So the device at the beginning it starts advertising with one millisecond interval. So we should see peaks every 100 milliseconds and this is the M0 plus the radio. In between the microcontroller is in stop zero and the consumption is very low. It's about three microamps whereas when the radio is active it's at least a few milliamps. After one minute the advertising is put into slower mode and it will advertise just once per second. But it's still able to connect to other devices. The scanning might take longer though. So this is actually a zoom of this peak. So this is the zoom of the radio activity. So the advertising packet is transmitted on three different frequency channels. So we always see a transmit. We are transmitting the advertising data and then the radio is receiving because it's waiting for the connect response. And this happens three times on three different frequency channels on the advertising channels. So what you can do is to measure the average consumption over a period of let's say 10 seconds. And if you click show report you see the frame at the bottom which shows about 255 microamps. And this is true for these conditions. So advertising interval about 100 milliseconds. Zero dBM transmission power and the advertising packet of about 14 bytes of useful payload. You can play with that a little more. If you press the switch three this will toggle the internal SMPS. So there's an internal SMPS that can be used to supply the radio and the digital domain. And this greatly increases the efficiency of the microcontroller. So you should see from 9 to up to 50 depends on the voltages on the exact output voltage of the SMPS. You will see a 20% or 30% improvement on the consumption. The SMPS can be only turned on in the active mode. So it doesn't help in stop modes or standby. So here are the figures for where the SMPS is on and when it is off. So this was advertising and now let's have a look at connection. So the connection parameters are imposed by the phone so the phone decides what will be the connection interval. And most of the phones will select interval about 50 milliseconds which is quite high for this type of application. So if we send the heart rate value once per second then it's useful to have this connection interval in between where most of it is just zero length packets just to keep the connection alive. So what you can do is press switch number two which will negotiate a different connection parameter one second each one second. So now in the consumption you can see two types of events. So first of all the M0 and radio every second and you will see the M4 again waking up every second to pretend to measure the heartbeat. So you'll see two types of peaks with the frequency of one second. So this again is a zoom to the radio one. Now it's swapped so when in connection the microcontroller first receives for the Bluetooth master which is the phone. And then it transmits either a zero length packet or something valuable. So if we were to measure the power consumption so this is a very simple application. M0 plus and radio waking every second, M4 waking every second and doing something. And with the SMPS on you can get to the consumption of about 18 microamps.