This is a measurement project for my low power sensor
I want to have the ability to measure power cycle for my nRF24l01 node , BLE node or CC3200 node, so that I can estimate the power draw and calculate lifetime or design energy harvest.
So for the first version, I go for an Arduino leonardo base design,
and currently measurement speed reached about 10khz.
to improve this, first of all is to speed up ADC clock, by changing the devider to 16, I have 1Mhz for ADC, thus 77khz of sample rate.(13 clock per sample)
but now it gives about 500us per sample, so not only the ADC speed is important, there must be something slow down the code.
and later, I found that the performance neck is converting from float to char.
also note that in Arduino leonardo the USB endpoint of USB CDC is 64byte, so I send 12 samples in one buffer to maximize the usage.
and I decide to leave the conversion to my computer, and modified my code to
After Arduino 1.6.7, Arduino LLC adds a new feature that can automatically plot the data from Serial using CSV format, so after finishing the hardware, the first test is using Serial plotter to check the data, and the first thing to test is my brand new Raspberry Pi 3, I'm quite curious about the wifi power peak looks like.
and this is the result
as you can see, the peak is about 400mA,but because of the limit of Serial plotter, I can't measure how long it takes to transmit wifi signal.
I've also tested current under CPU stress test, using sysbench.