TLDR: We built an IoT demo that logs data to AWS. See live data here.
Our office dashboard showing current conditions
At DEB Associates we combine hardware and software expertise. To showcase our abilities in a new way, we are designing and building an environmental sensor for the office that highlights a number of technologies. The first revision of this project is a prototype using development boards from ST. The next revision will include custom hardware and Power over Ethernet.
High level data flow:
Technology Highlights:
This demo was put together using development kits from ST. I used the NUCLEO-F401RE base board with the X-NUCLEO-IDW04A1 wifi expansion board and X-NUCLEO-IKS01A2 sensor expansion board.
The device connects to the network via wifi and sends data to the secure AWS MQTT endpoint. The data is logged to DynamoDB and queried using a Lambda function.
Security is important in the emerging world of IoT. There have already been a number of major exploits from compromised IoT devices. This past year a casino's network was breached through sensors in a fish tank.
Two big parts of securing IoT devices is making sure data sent/received is encrypted and that user applications have the correct level of access to device resources. Mbed has answers for both of these issues. Check out their resources on security,
In this design we used Mbed OS and Mbed TLS to encrypt data sent to AWS IoT core.
Mbed provides a rich environment for development of connected embedded devices. It provides a number of abstractions that fit together and can be mixed and matched as needed with minor development overhead:
Including Bluetooth, Wifi, Ethernet, Thread, NFC, 6LoWPAN Sub-GHz Mesh, LoRa LPWAN, RFID, Cellular
Mbed OS includes an RTOS and additional drivers and support libraries from chip manufacturers and the community.
Mbed TLS and uVisor (soon to be replaced by the Secure Partition Manager in Mbed OS 5.10) provide security primitives for IoT projects.
Mbed OS also includes support for many ARM devices. It ships with a hardware abstraction layer - allowing easier portability between devices.
One of my favorite features of Mbed is that it comes with a command line interface and a package management solution and workflow. Having a background in web application development, I've enjoyed the proper package management solutions of Elixir (hex), NodeJS (npm) and Rust (cargo).
When writing embedded code, I miss those toolchains. While Mbed package management leaves some things to be desired, it is much better than nothing at all!
I used a number of Mbed libraries in this project including:
The final build will swap the Wifi interface for Ethernet and include support for additional sensors.
AWS has solutions for the major needs of an IoT project including:
In this project the device is connecting securely to an IoT core endpoint and publishing messages with sensor data periodically.
There is a rule set up to pipe messages received to a DynamoDB table. DynamoDB is a managed NoSQL database that provides consistent performance at any scale.
Finally, to display the data, I have a Lambda function (written in NodeJS) that queries the DynamoDB table and returns a JSON payload. The lambda function is managed and deployed using Apex.
Apex is a library for deploying serverless functions. It abstracts some of the routine involved in setting up functions and makes it easier to manage them over their lifetime. Apex also supports integration with Terraform for infrastructure management. Over all, Apex (and the sister project Apex Up) provide a really nice developer experience and interface to AWS.
We have an office dashboard that displays metrics and a nice background (of rotating images). I added charts showing the recent office conditions.
I also added the charts to our public site. Check them out here.
Dan is an engineer with a background in software development. He graduated from GVSU with BSEE in 2011 and has been building ever since. His tools of choice are C, JavaScript, Elixir and everything that AWS offers.
DEB Associates helps companies through the entire electronics design process. Our team is smart, reliable, and deeply knowledgeable about the intricacies of circuit design, PCB layout, and EMC.