Skip to content

Week 14 Interface and Application Programming

Group assignment:

Compare as many tool options as possible.

Document your work on the group work page and reflect on your individual page what you learned.

Individual assignment

Write an application for the embedded board that you made. that interfaces a user with an input and/or output device(s)

Packages

We took a look at a number of tools to interface with our board over a variety of communication protocols. Since both of us are interested in communicating with our boards wirelessly, we especially focussed on those options.

BLE

MIT App Inventor

App Inventor is an open source app creation tool that works across platforms. It also has plugins to run BLE and there are YouTube tutorials like this one from the “Science Fun” channel that describe how to do it easily.

MIT App Inventor interface.
Pros:
Block coding so do not have to learn a bespoke language
Built in plug in for BLE
Free and open source
Sample code available
Cons:
Push notifications are not supported
Limited customization
Block coding interface may prove frustrating

Adafruit Bluefruit Connect

Bluefruit Connect is an app for Android and iOS that allows you to communicate with devices over BLE and UART.

Bluefruit app.
Pros:
Easy to use interface
Built in buttons and color picker
Sample code available
Jeremy tested it during his week 10 exploration and proved that it worked
Cons:
Not customizable
Jeremy has had issues with data transmission from the color picker

Java Script

JS is a popular coding language that is used to interface with websites. It can also be to control BLE devices localy through the web Bluetooth API. While researching this option we found some good tutorials about how to do this. In particular, the one from Confidence Okoghenun was quite useful where he creates a BLE heart monitor that pushes its data to a website via BLE.

Pros:
Sample code available
Allows a different method
Can use on smartphone via emulation on the Nordic nRF Connect App
Customizable
Cons:
Bigger lift than the other options for BLE
Emulation does not work on iOS

WiFi - Arduino

For WiFi enabled microcontroller boards using the Arduino IDE, foundational libraries can be used to connect to WiFi networks and communicate using common protocols. Early versions of the Arduino WiFi library relied on the (retired) Arduino WiFi Shield. More recent boards, particularly ESP32, employ a similar WiFi.h library specifically designed for the board (e.g., ESP32). For example:

The WiFi library can be used in conjunction web protocol libraries in order to run web servers and web services on the microcontroller board.

Web Server

A basic web server can be set up using the Arduino WiFi Network, WiFiServer and WiFiClient functionality. This allows client interaction with the microcontroller board using web protocols. For example:

Pros:
Direct web service connection to microcontroller board
Sample code available
Cons:
Limited onboard memory for web assets

Web Socket Server

Standard web communication involves a basic request / response model. In addition to the standard web server interaction, web socket protocols can be used for two-way web communication. For example:

Pros:
Direct web services connection to microcontroller board
Two-way communication with microcontroller as server
Sample code available
Cons:
Greater complexity for communication design
Limited onboard memory for web assets

WiFi - IoT Platforms

Adafruit IO

Adafruit IO is a web service platform built for IoT applications. It has data feeds that can be setup to injest and send data to WiFi or other connected devices. Feeds can send data via the API or MQTT and there is sample code to help set this up.

Sample dashboard done in Adafruit IO transmitting data from a Particle Argon WiFi device in Jeremy's Office
Pros:
Easy to use and setup
Jeremy has used a number of times in past projects
Web app works really well for a app-like experience
Cons:
Rate limited
Limited to 10 data streams in the free tier.

Blynk

Blynk is a low code IoT platform that allows users to build custom apps and communicate with connected devices easily. The Blynk interface can be accessed from a web browser or the app. Devices can be setup easily and dev boards like the XIAO can be setup to talk to the Blynk service via their Arduino IDE library.

Jeremy used this service in Week 4 to validate Wokwi simulation.

Pros:
Free tier for makers
Easy to connect devices
Proven to work with XIAO boards
Jeremy has used a number of times in past projects
Gives full app experience
Easy to modify the app without code
Cons:
No BLE support
Further customization requires subscription

Losant

Losant is an enterprise IoT platform. It is a fully functional backend and dashboard solution that can push and pull data from devices for monitoring, control, and automation. It can be used to control connected devices with simple Arduino code.

Jeremy uses Losant in concert with a Particle Boron Cellular device to monitor his greenhouse.

Losant dashboard that Jeremy built to monitor his greenhouse.
Pros:
Good amount of data allocation for prototype uses
Can injest data from Particle, MQTT, or webhook
Fully customizable dashboards that play well on mobile as webapp
Cons:
10 device limit in free tier
Incredibly expensive to deploy broadly
Best suited for industrial IoT application for high margin monitoring work.