An ex-coworker came by this afternoon for a quick chat. He had applied to Psikick, interviewed with them, and things looked promising, but today they came back with “the CEO has instigated a hiring freeze” which of course probably means they found someone else. But after hearing him describe the company it sounded interesting. I’m pretty sure we must have seen their booth at CES (it makes we wonder if we are approaching CES correctly since we missed what they are about – or may CES isn’t generally a very effective event because there is too much there to take in). They are making self-powered IoT devices to run entirely from harvested energy. Going to the web site reveals little information, but an Internet search turned up the attached presentation. They have a 500nW wakeup radio – or at least want to have one and are thinking about it. Some pages pasted here.

“3-7 meter wireless range” is a problem but if it’s an honest 20 feet maybe we could live with it. There is reference to “University prototype” (University of Michigan again) so I don’t think there’s an off-the-shelf product that can be purchased now.

Anyway – looks interesting.

Attachments area

Preview attachment HC27.24.130-Batteryless-IoT-Calhoun-PsiKick.pdf



HC27.24.130-Batteryless-IoT-Calhoun-PsiKick.pdf

http://eecs.umich.edu/eecs/about/articles/2016/googling-the-physical-world.html

————————
Yes, that really is interesting.  The problem with CES is that I just can’t focus that hard for that long.  I guess we need to do more (some?) homework before we go?
It looks very promising.  I guess it will get built into a bunch of WiFi and BLE chips as standard so it isn’t necessary for everyone to rewrite software.
This is a company that could hit it big.
Random musing… The main wearable challenge remains harvesting enough power to run some sensors, and occasionally doing some ranging.  A WUP radio could reduce our radio budget substantially except for ranging, and that’s always going to be a problem I don’t know how to solve yet.  On the other hand if you can place these WUP radios in every ceiling tile and they can scavenge enough energy then maybe it’s possible to just kill the localization problem with a 100 radios.  But I can’t see Joe Public installing thousands, or even tens of these buggers.
So to my mind the challenge is still coming up with an insightful software architecture, and power model.  Figuring out an architecture that minimizes the expensive operations in favor of a greater number of inexpensive operations is key – but to understand the trade-offs you have to have an architecture that allows you to make those trade-offs as technology improves.

Put another way,  it seems more important to have the right approximate kinds of component, that allow exploration towards the right design, rather than necessarily the very best component.

[ Spreadsheets @ https://drive.google.com/open?id=0B1iBvkbdWzq0RUtNcGsyanFBVjg ]

I was getting very confused by the apparently weird behavior of the BLE discovery mechanism. There are three basic parameters that govern how much power gets used, and how how long, on average, it takes for one peer to discover another.  Explanations on the web are confusing, and always seem to omit some vital piece of information.  I got so confused, that I decided to make a simulator to try and figure it out.  It’s subtle.

Here is a chart showing the advertising cycle.  Milliseconds are on the x-axis. In this example the radio is advertising 5% of the time. Each 3-transmission operation takes less than 1ms.  The chart title starts with 4 numbers in parentheses.  These represent, in order, the scan window, the scan interval, the advertising period, and the advertising interval.  More about scanning in a moment.

So I can begin to compare different strategies I have defined a measurement I call a “power unit”.  It assumes that transmitting and receiving are equally expensive (which is approximately true).

Advertising for 1ms every ~20ms

Notice that the advertising events are not quite evenly distributed.  If two peers transmit at exactly the same time, their packets will “collide” and receivers will get corrupted data.  So advertising packets are transmitted at an interval that includes a random delay (in the range 0-10ms), so if multiple advertisers start advertising at the same moment, they will eventually  drift out of synch. with each other. Advertising packets are short, and are transmitted on three different frequencies.

The radio does scan and advertise at the same time.  If it did it would just hear it’s own transmissions anyway.  When simultaneously scanning, and advertising, I discovered that scanning events take precedence, and the relatively shorter advertising events are rescheduled for a random time after the scanning operation completes.  So activity looks like this:

Scanning for 12ms every 36ms, and advertising for 1ms every ~20ms
Notice there is a big gap between the first two advertising events.  This happened because the second advertising event was scheduled for 46ms which fell inside the second scan event, so it was delayed by a fixed+random amount.  The rescheduled advertising event then landed at 74ms, which was inside the 3rd scan event, and so it was delayed for a second time, finally appearing at 99ms.
Now it’s quite possible for an advertising event to continue being blocked over many scanning events. Here is a pathological case where the advertiser is blocked for about 300ms.  
Scanning and advertising at the same specified interval

Under some circumstance this could go on for even longer, and the advertiser would never be discovered!
It turns out that this is solved by only only allowing a maximum of ten advertising packets to be blocked before the scanner is told to miss a turn.  I was unable to provoke this behavior so I wonder how often it really occurs.

Discovery

So the big question, of course, is how do these parameters impact the time it takes to discover a peer device, and thus in turn, what the impact on the power budget is.
Here are two peers who are both advertising and scanning on the “pathological” schedule.
Max latency 357ms, and 129 power-units
The advertisements that are “discovered” are tagged with a ‘*’ on the top axis.  
What this illustrates is the time it takes for a scanner to hear the peer’s advertisement. I call this the latency.  The average latency can be quite small, but what matters from a “reliability” standpoint is the maximum latency.   This determines how long a peer had to both advertise and scan to be heard.  I should stress that is not a theoretical result (my math isn’t good enough).  It is a result gained by simulating the system for many cycles.
Let’s go with my assumption that transmitting and receiving cost about the same amount of power per unit of time.  In the first two-peer example the radio is on for 36% of a possible maximum 212ms.  I’ll call that a maximum of 212*0.36 = 77 units of power to guarantee discovery.
What if we advertised more often?

Colliding packets are marked with ‘X’
In the latest example, another snag crops up.  Packets are being transmitted so often that they start to collide.  But in spite of this the maximum latency drops and the power required goes down dramatically to 32 because the latency is much lower.

As a reality check would advertising 8x less frequently use less power because there are fewer transmissions, or more power because the latency goes up.

Less, or more power if we advertise less often?
Advertising is fast (1ms), but now there are fewer chances for the scanner to hear the advertisement, so the maximum latency goes up dramatically to 260 ms. and it costs  90 units.
So how about scanning more often to make it more likely that the scanner hears the advertiser?  
Now the advertiser finds it hard to sneak an advertisement into the scanning schedule.  So few advertising packets make it out, and the latency goes through the roof.  

So where is the sweet spot?, where both latency and power is low. Here it says,

“For non-connectable beacons, the (advertising) interval cannot be smaller than 100 ms. For connectable beacons, it cannot be smaller than 20 ms.”

Our beacons will be connectable, so let’s start with 20ms.

Lengthening the advertisement interval to required minimum of 20ms

So this is certainly not better, and may be worse.  So obviously I have to crank down the amount of time spent scanning.  But where is the sweet spot?
Repeating the simulation while holding the scan interval constant at 60ms, varying the Scan Window, and running over long sample periods I ended up with the following graph.  It has a very obvious, and mysterious sweet-spot at 32ms.   I’m not feeling very confident about this plot.
An obvious scan-window sweet spot at 32ms

Even more advertisements

To get a fix in 3D it is neccessary to range with four other units.  So there are five peers in play in this example.   I have kept the scanning and advertising parameters the same, but simply increased the number of peers.
A few packets collide now, which pushes up the max latency, and power quite a bit.   It’s important to remember that this example is somewhat bogus because in this case we don’t actually consider which peer discovers the advertiser.  In practice, of course, an advertiser will want to get discovered by each peer in turn, and then range them to get a fix.  Anyway, in spite of their being 5 peers now, the maximum latency is 129ms, but the radios are only on for 58% of the time so the cost is 75 units.

Directed discovery

So let’s return to the simple 2-peer example, with our evolved parameters.

Both peers are advertising, and discovering each other

Notice that both peers are advertising, and discovering each other.   

Now let’s assume that  the top peer in the diagram is interested in discovering the bottom peer, but not vice-versa.   I call that “Directed scanning” or “Dir-Scan” in the diagram title.  Another way of putting this is that the bottom-peer wants to be discovered by the top peer.  Notice that the ‘*’ markers are only above the upper-peer’s scans.  The difference in the statistics is down to insufficient sampling.
Now let’s bump the number of peers up to 5 again, keeping the same parameters, and having each peer scan for any other peer, and see what it looks like.


Now let’s repeat this in Dir-Scan mode.  In this case each peer is only interested in advertisments from the peer below – except for the bottom peer which tracks the top peer.
The maximum latency, and Power have gone up a lot.  We would expect the average latency to go up by about a factor of 2.  Because a scanner will hear the desired advertiser within one cycle, 25% of the time; within 2-cycles 25% of the time… and within 4 cycles the rest of the time.  So on average it will take (1+2+3+4)/4 cycles = 2.5 times longer.  Our experimental data produces 5?  Maybe insufficient samples, or  is my thinking faulty?  The maximum latency goes up by 60%, and the power by a similar amount.  

In fact it isn’t this bad because on the first scan any peer is acceptable.  On the second scan 3 of the 4 are acceptable, then 2/4, then 1/4.  So the max latency on the first will be 189ms, and the last max latency will be 297ms,   A wet finger estimate says 1.2 seconds worst case, and best case around 50-60ms.

Repeating the Dir-Scan simulation while holding the scan interval constant at 60ms, varying the Scan Window and running over long sample periods I ended up with the following graph.  
Maybe it would be a bit smoother if I calculated over a greater number of samples?   Anyway, minimum energy seems to be somewhere around 27ms.

The pattern looks like this.

Unfortunately

The parameters that seem to work out well above, are not acceptable to the BLE API.  Why this is makes no sense, but suggests my simulator is broken in some fundamental way!

Here are parameters that are acceptable, and work.
Notice that the scan parameters are now 4ms every 80ms.   The extra line in the title will make more sense when I demonstrate the latest upgrade.  Notice too, that there are a quite a lot of collisions when the simulation runs for a while.  That statistic is a bit misleading because it measures the total number of collisions seen by all the peers.  Obviously each peer only sees a collision in which it is involved, so in this case the total % should be divided by 2.  

I wanted to know how long it would take for one peer to discover all of the other peers.  The simulator ignores repeated discoveries until all of the peers have been discovered.  In the above example the statistics on the second line of the title are for discovering all of the other peers, where n=1, so it is the same as the simple discovery.

For 3 peers the collision count is about the same.  Each peer will on average see half that, but there is a remote chance that all three peers will collide of course.

So as we might expect, the time to discover any other peer goes down, because there are twice as many possibilities.  We might expect the time to discover both peers would be twice as long, but it’s ought to be a little less than that because initially we don’t care which peer we hear from first.

Here is an example with 3,4 and 5 peers. 
With 4 peers the time to find any other peer goes down again, and the time to find all of the others goes up.  The collision rate is about the same.
With 5 peers the worst-case time to discover them all gets up above 11 seconds.   The % of collisions is slightly higher as we might expect.  Reductio ad absurdum says that if there are an infinite number of transmitters, then no peer will ever get a word in.


These instructions assume nothing is plugged in or running, so we are both on the same page.
Perf board TS06.2:
  1. Connect: Power, UART and Jlink. 
  2. Prepare Putty.
  3. Setup jflash-lite: Device is nRF51822_xxAA
  4. Erase mem. 
  5. Don’t load any soft-machine
  6. Flash with “Reflector-1w_(6b)_UART_TS06_2.hex”
  7. Power-cycle.
  8. No LEDs flash, after startup sequence
  9. You should see this:

TS06.3

  1. Connect: USB and Jlink.  Prepare Putty
  2. NB! This device is nRF51822_xxAC
  3. Erase mem
  4. Load soft-machine “s130_nrf51_1.0.0_softdevice.hex”
  5. Load my software “Initator_1w_UART_TS06_3.hex”
  6. Push the reset button – nearest the uSD card
  7. Should see exactly this sequence: see this video

MCP

  1. Plug in the little BLE dongle.  Note the serial# on the chip!
  2. Connect MCP to the dongle.  Make sure you specify the correct serial# or you may connect to the JLink instead, and since it may ask to reflash the dongle, this could be bad.  If it does ask to feflash dongle select the “slow” option.
  3. Start discovery.  This can take several attempts at 5 seconds each.

  4. Notice above, that a foreign BLE device (0x68644B269739… my neighbor’s) has been discovered!
  5. Select “ts” from the list, and click “Select Device”.  Wait up to 5 seconds… If it connects you should see this LED pattern:

    Weasle words: BLE is a bit unpredictable at this point. It should connect, and you should see a list of characteristics.
    If not press “Connect”, or start over.
    If no services characteristics are printed then press “Discover services”

  6. Click “Enable Services”

Running a range operation

  1. Click last item in list, type in 2-digit hex#, and press “Write”.

  2. If it works you should see something like this on the putty channel, and the MCP characteristic above the one you typed in will show the range in hex-centimeters with the bytes reverse.  Great huh  EF-FF => FFEF => -17cm
    ?
    .
N.B. I have bum antenna delays set up on mine, so the ranges are whacky.

I made an automatic antenna delay calibration program.  It hill-climbs to find the antenna delay that produces the result that is closest to the truth.

Each time it changes the antenna delay it transmits the new value to the peer, which sets up it’s own antenna delay to match.

It produced an odd result.  The vertical axis is antenna delay, and the horizontal is meters.  I was trying to home in on 1.67 meters.   There seem to be two sweet areas.   Why is this?

I think I see a serious problem with low-power operations.  The crystal used by the DW module takes quite a long time to warm up, and settle down.  Below are two diagrams.  Labelled “Figure 2” on the left is DW’s version.  On  the right is a diagram copied from a comprehensive discussions of crystals from HP,

Notice that DW’s version has been edited to remove the important units.
HP’s caption:
Figure 25. A is a RTXO warm up curve. B, C and D are typical TCXO warm up characteristics. The long time (3 hours) is due to changes in temperature inside the instrument. E and F are oven oscillators. Stability is achieved in ≈20 minutes.
That might be a problem as far as instant startup is concerned unless we keep the DW crystal running.

David writes…

Microsemi has a new radio, Zl70550, that’s clearly better than the one we were looking at. the receive current is a little higher but the sensitivity is much better. The sleep current is only 10 nA vs 500nA. The maximum transmit output power is higher at lower power consumed (more efficient) only 5.3mA at 0 dBm. Compare with the nRF51822 that consumes 10.5 mA @ 0dBm. It has 40 dBm of RSSI range with 2dB of RSSI resolution.

With a typical current consumption below 2.75 mA in transmit (–10 dBm) and below 2.4 mA in receive (–95 dBm sensitivity), and a data rate of 200 kbit/s, the ZL70550 device enables bidirectional RF links over a distance of more than 100 meters (based on antenna gain and operating environment). A sensitivity of –106 dBm can be achieved by optionally increasing the receiver current consumption (to approximately 3.2 mA), enabling FEC, and using the lowest data rate.

Inline image 1
Looks interesting:

The device includes the Z-Star protocol, which is a powerful and highly optimized MAC that performs complete packet transmissions with acknowledgments and automatic retransmissions on failed receptions. This built-in protocol eliminates the need for processor intervention in packet processing, allowing the processor to go to a power-save state or to perform other critical application processing. Additionally, the MAC supports other user modes of operation with selectable options like CRC, FEC, and auto length.

CSP package available that’s just 2mm x 3mm. QFN package available 5mm x 5mm.
I tried calling Microsemi sales but just got VM.
Carmen Isham

Features

  • Ultralow current of 2.4 mA in receive and 2.75 mA in transmit
  • Ultralow sleep current of 10 nA
  • Maximum TX output power of 0 dBm
  • Maximum RX sensitivity of −106 dBm
  • Wide supply range of 1.71 V to 3.6 V
  • Operates between 779 MHz and 965 MHz (915-MHz ISM band in North America; 868-MHz SRD band in Europe; 779-MHz to 787-MHz band in China; 916-MHz to 930-MHz and 950-MHz to 956-MHz bands in Japan)
  • Raw data rates of 200 kbit/s, 100 kbit/s, or 50 kbit/s
  • Very small footprint
    • Few external components (crystal, resistor, and two decoupling capacitors)ZL70550 QFN photo magnified
    • Available in 29-pin CSP package (2 mm by 3 mm) or in 32-pin QFN package (5 mm by 5 mm)
  • SPI bus slave for packet data and register access
  • Built-in MAC
    • Support for Microsemi Z-Star or user protocols
    • Transmit and receive buffer
    • Optional automatic CSMA packet transfers
    • Efficient header optimized for small or large payloads
    • Optional preamble, frame sync, length, FEC, and CRC
  • Industrial temperature range (−40°C to 85°C)
Notice the “No charging required”. 1.5 year estimated battery life.

http://www.timex.com/watches/metropolitan-tw2p81700

Track Your Active Life.
This stylish activity tracker blends the functionality of an activity tracking band with the look and feel of a traditional analog watch. The unique fourth hand tracks daily steps, distance and percent to goal right on the dial. The Metropolitan+ uses Bluetooth technology to connect to the Timex App on your phone that tracks daily activity, including steps, distance and calories burned. The phone app stores your data so you can access and analyze it at any time. This watch also features quick release straps so you can easily change your look in seconds.
  • Track steps, distance and calories burned
  • Sleep Metrics (coming Spring, 2016)
  • Sync with your phone
  • No charging required
  • Water resistant
  • Indiglo® Night-Light

– See more at: http://www.timex.com/watches/metropolitan-tw2p81700#sthash.5VQuJhsl.dpuf

Inline image 1
Inline image 2
From instruction sheet: 
FEATURES
• Classic Analog design
• BLE connection with Smartphone application (iOS and Android formats)
• Activity tracking displayed on watch dial in both steps and distance.
• Percent of goal achievement displays on the watch dial in both steps and
distance
• Smartphone application displays actual count and percent of set goal
achieved for Steps, Distance and Calories
• Smartphone application retains activity data and displays activity by day,
week, month or year.
• INDIGLO® night-light
• Estimated battery life of 1.5 years

————————–
Ah, it is just a mechanical UI display for the app on your phone.  I bet you have to turn the BLE on/off manually.

A momentus day!   It’s actually 2.2 meters on the tape measure.
The first time it actually worked… and then it died.
There are two BLE peers.  We are looking at the advertising side of the transaction.  The advertiser offers a ranging service.  

Protocol

  1. The client-side notices the advertisement and connects to the advertiser.  
  2. If the connection succeeds, the client fires up its DW in listening mode,
  3. Then it uses BLE to ask the ranging service to range it.
  4. The advertiser fires up it’s own DW and performs a ranging cycle.
  5. It then shuts down it’s ranger.
  6. Then it updates the “range” property of the connection, which notifies the client
  7. The client now has the range

Attempt #2

After some cleaning up, and further work, it started to work.   This is only doing single-sided ranging, i.e. 1 round trip.
In the following example:
  • White   is main controller thread activity (the app)
  • Cyan is BLE activity
  • Green   is DW activity

I wondered if we had a hardware issue, or a software issue, or both.
I just tried to copy your measurement process with the Nordic eval board.  Here’s what I did, and I’m not sure of my workings, so check me out.
Notice the last note.  Maybe that’s significant for us?
  • I looked through hundreds of loose resistors and found one that claims to be 10 ohms.
  • Then I kind kludged it across the current measurement pins of the PCA10001, using my meter probes, like this.
  • Then I ran my software and put the Nordic to sleep (allegedly)
  • My meter looks like this
  • Then I found an ohms-law calculator and plugged in some values.
Well doh!  1.2mA

I have to measure the voltage which is…. 

2.367Volts
Watts = Volts * Amps, so the answer is 2.367 * 0.0012 = 0.0028404  or 3mW.  This is a lot more than the µW I was hoping to see.   So it looks like there’s a lot of stuff still switched on.

Learned something significant

I read up some more on power saving.  Having the debugger running has a huge effect.  Here is my experiment that proves the point.
I made a simple program that:
  1. turns on a LED
  2. waits for a button press
  3. shuts down.

When running in debug mode the voltage measured across the bridge is 12mV

If I disconnect the debugger, the shutdown voltage is 0.1mV = 0.0001V.  So the current is 0.00001A.
So the wattage is

2.367 * 0.00001 = 0.00002367 W = 24µW.   


That’s a lot better, but it’s still 30x what I should be seeing.





Ahhh!   And then it struck me.  The meter has pooped out.  What I need to do is use a bigger resistor in the bridge.  I wonder what that will do?
The voltage now seems to be down to 2.426V, and the sleep current now measures 0.2mV across a 100Ω bridge, so the current is 0.002mA = 2µA ??

So the math is now 2.426V * 0.000002A = 0.000004852W 5µW.

David: For sale by Google:

https://store.google.com/product/huawei_watch

 







———–
It’s nice looking, and has a circular display.  1.5 day battery life!

Comments:

Button fell off after 3 months of very light use, company says no repairs can be done and warranty is voided since the button fell off WTF  (Trump Tech)

​Looks like they have problems making a small vibe too.​ 

Very excited for sound for my Huawei watch. The vibrations are really weak so I miss a lot of notifications (I know, sort of defeats the purpose of a ‘smart’ watch) so a sound backup would be great. Now if they can only improve the notification vibration intensity!

​   ​
​Jeez the world is rushing ahead isn’t it.​