I'm working with wireless sensor network lead to evaluate its performance in my work. I want to measure the latency and total energy consumption to find the remaining energy in each node. So my problem is that I have some values of tx rx cpu cpu_idle
and I don't how to use them to calculate what I need. I found some rules that take the calculation but i don't understand exactly how to apply it in my case.
Energy consumed in communication:
Energy consumed by CPU:
What is the meaning of 32768, and why do we use this number? Is it a standard value?
The powertrace output is printed in timer ticks.
tx
- the number of ticks the radio has been in transmit mode (ENERGEST_TYPE_TRANSMIT
)rx
- the number of ticks the radio has been in receive mode (ENERGEST_TYPE_LISTEN
)cpu
- the number of ticks the CPU has been in active mode (ENERGEST_TYPE_CPU
)cpu_idle
- the number of ticks the CPU has been in idle mode (ENERGEST_TYPE_LPM
)The elements of the pair
tx
andrx
are exclusive, as arecpu
andidle
- the system can never be in both modes at the same time. However, other combinations are possible: it can be incpu
and intx
at the same time, for example. The sum ofcpu
andidle
is the total uptime of the system.The duration of timer a tick is platform-dependent and defined as the
RTIMER_ARCH_SECOND
constant. 32768 ticks per second is a typical value of this constant - that's where the number in your equation comes from. For example:To compute the average current consumption (in milliamperes, mA), multiply each of
tx
,rx
,cpu
,cpu_idle
with the respective current consumption in that mode in mA (obtain the values from the datasheet of the node), sum them up, and divide byRTIMER_ARCH_SECOND
:To compute the charge (in millicoulumbs, mC), multiply the average current consumption with the duration of the measurement (node's uptime) in seconds:
To compute the power (in milliwats, mW) multiply the average current consumption with the voltage of the system, for exampe, 3 volts if powered from a pair of AA batteries:
Finally, to compute the energy consumption (in millijoules, mJ), multiply the power with the duration in seconds or multiply the charge with the voltage of the system:
The first formula above computes the energy consumption for communications; the second one: for computation.
This site might be helpful to break down the numbers.
32768 Hz or 32, 768 kHz this is of MSP430F247 Microcontroller frequency, for specifics are Active mode: 32iuA @ 3 v / 1 MHz or 1x10 6 Hz and Low Power mode = 1 uA @ 3V /32768 Hz