IoT AI at the Edge, the Goal

Specifying an AI capable IoT Edge Device

Choices, Choices

Building an AI capable IoT Edge Device has been on my To-Do list of personal projects for a while. I’ve finally got round to getting a project up and running.

The IoT development space is awash with platforms, architectures and devices, even in the Arduino ecosystem the choice of MCU architectures has massively expanded beyond Atmel AVR over the last few years.

At the same time the world of wireless connectivity has also expanded beyond LTE, WiFi and BLE, with the maturing of LoRaWAN and SigFox and the emergence of 5G capable devices. However, as always in any system all these features have tradeoffs, the main one for me being availability and cost.

The Core Requirements

So what were my core requirements? Well the device has to:

  • Be fairly low cost (less than $100)
  • Have wireless and GPS connectivity
  • Be powerful enough CPU RAM and Flash to deploy machine learning algorithms
  • Have a reasonably well supported ecosystem (e.g. software libraries, tools and hardware)
  • Be battery powerable, low power consumption and support sleep and wake modes

I spent ages trawling over specifications and reviews. I was considering LoRaWAN or SigFox as the network, but was put off by their line of sight requirements.

For AI the obvious choice would be a board containing a SiPeed RISC-V and AI module. However, currently available boards have limited wireless capabilities and have a reputation with the community of being poorly supported from an add-on hardware and software ecosystem perspective. I also wanted the challenge to try and deploy an AI/ML algorithm to a standard MCU architecture.

Browsing the Web I came across the Wio LTE board from Seeed Studio and this seemed to fit the bill. Also, as Seeed have a new range of devices in their Wio line, the Wio LTE EU can be picked up for less than £100. It’s also got the advantage of having Grove connectors, allowing me to reuse hardware from previous projects and boards.

Show Me the Specs

  • Worldwide LTE and UMTS/HSPA+
  • Embedded power management unit (PMU) featuring ultra-low deep-sleep current consumption
  • GPS/BeiDou/GLONASS/Galileo and QZSS
  • 6 grove connectors
  • Nano SIM and TF card 2 in 1 socket
  • STM32F405RG, ARM 32-bit Cortex-M4, and 168MHZ processor, 1MB flash memory, 192+4KB SRAM, 3.3V operating voltage
  • LTE: AT command: 3GPP TS27.007 and enhanced AT commands LTE Cat.1 LTE-FDD (max) 10Mbps(DL) (max) 5Mbps (UL) data
  • GNSS: <2.5m CEP precision
  • 2x digital port, 2x analog port, 1x UART,1x I2C, 2x LTE antenna, 1x GPS antenna
  • 54.7mm x 48.2mm, 18g

So what’s the plan?

The goal is to build a flexible edge IoT device, battery powered with Cloud connectivity over LTE, capable of executing machine learning algorithms locally, leveraging the Grove system for sensors and connectivity and having over the air (OTA) reconfiguration capabilities. For example, I want to be able to update AI algorithms OTA and change the sensor suite.

Is it working yet?

So far I’ve got the board up and running with a hardware configuration you can see in picture at the top of the page. I’ve got both the GNSS and LTE working, a Temperature / Humidity sensor and a 0.96 OLED display hooked up on the I2C bus. I’m also looking to encase the system in an IP65 enclosure, probably bespoke 3D printed.

In terms of the Cloud end, I’m looking to develop a series of REST API services to take data from the device and provide analytics output for visualisation. The vast majority of code will be posted to my GitHub repository.

The first bit of code which others might find useful is a library to shim Atmel AVR Program Memory access for STM32 MCUs. This library is often a dependency in Arduino libaries, even though a lot of non AVR architectures do not use PGM. As described in the Github repository, this library has only been tested on the STM32405, however I believe it’s generic enough to work on other MCU architectures.

So, there you have it. The start of my AI at the Edge IoT Device development! I’ll look to post some further progress as soon as.