AltSql Instant demo How to run it

AltSql Instant · Live demo

A sensor with no battery

A small solar cell charges a capacitor. When it is full, the sensor wakes, opens its store and saves readings, one after another, until the capacitor is empty and the power goes, wherever the sensor is at that moment: between readings, or in the middle of a write. Then it charges again, and wakes again, many times a minute. Two sensors, the same light, the same capacitor: one keeps its readings with AltSql Instant on MRAM, the other with AltSql Core on NOR flash.

Simulated power and chips, real engines. Both engines run in this page, compiled to WebAssembly, each on its own chip. The chips are emulated in memory, and every read, write and erase costs the energy and time its datasheet gives it.

Try this

Loading the engines

Each sensor's capacitor, the last minute

20:00

The capacitor charges to 3.6 V, and the sensor wakes and works until it is down to 3.0 V. Each dot is a wake ending: where the sensor was when the power went.

AltSql Instant on MRAM updates each record in its place: no log, no erase

 

AltSql Core on NOR flash a log, and a sector erased when it needs the room

 
The power went between writes The power went in a write The power went in an erase The power went while opening the store

What each sensor kept

Since the page started. Each reading is a row, its time, a temperature and a humidity, and then its time under the key "last". After every wake each store is opened and checked: the newest 600 readings acknowledged, more than a wake saves, and the newest time must be there, whole, and the write in flight when the power went whole or absent.

Where each charge went

All the energy each sensor has had since the page started, by what it was spent on.

AltSql Instant on MRAM

 

AltSql Core on NOR flash

 

Starting up Opening the store The sensor's own work Writing Erasing Lost when the power went

The bytes of a write cut short

AltSql Instant writes a reading's row in a slot of the ring: 30 bytes, a header with a CRC-32 and then the row. Pick after how many bytes the power goes. The sensor wakes, starts the reading's write, and loses its power there; it wakes again, and its store is opened and checked.

What is real here

Real

  • AltSql Instant and AltSql Core: the prototypes' own code, each on its own emulated chip with a store of 64 KiB.
  • Every read, write and erase they ask for, counted as they ask for it, and the power going in the middle of one: a write stops after the bytes the energy covered, the byte being written left with any value on the MRAM and part programmed on the flash; an erase stops part done.
  • The checks after every wake: the stores opened again, and the newest 600 readings and the newest time each sensor acknowledged read back.

Simulated

  • The energy of the chips' work, from their datasheets, typical figures at 3.3 V: the Everspin MR25H40 MRAM (SPI at 40 MHz, 12 mA reading and 28 mA writing, no write delay) and the Winbond W25Q32FV NOR flash (programs of 30 µs plus 2.5 µs a byte at 20 mA, a sector erase 45 ms at 20 mA, reads at 50 MHz and 15 mA).
  • The microcontroller: assumed, the same for both sensors, 5 ms to start and 3 ms for each reading, at 2 mA. The light and the capacitor, between 3.6 V and 3.0 V. The energy harvested while the sensor is awake, up to about 0.6 s a wake in good light, is left out.
  • Both sensors had run for twenty minutes before the page started, so their stores are full and rolling over.