Advertisements are everywhere, including our phones, billboards, printed material, and on the sides of vehicles. However, in the case of flyers or other media that is meant to inform others of upcoming events, they can be an important tool for outreach. This micro advertising platform is meant to fulfill the role unobtrusively by having the capability of remote content updates while also remaining somewhat out of sight for those who are not interested - think a booth at a craft fair or a school bulletin board.
Released in September 2023, Asset Over-the-Air (OTA) from Particle is a robust content-delivery system which works alongside their existing OTA application flashing features. Instead of having to flash an application, hope it didn't brick the device, and then send extra files to a separate webserver, Asset OTA simplifies the process by combining the application flashing and file delivery steps together in a seamless fashion. This approach lets the Particle board program a co-processor with new firmware, store image/sound data in internal flash, and even deliver updates over BLE/LoRa to another device.
The core of this project is a Particle Photon 2, owing to its Arm Cortex-M33 CPU clocked at 200MHz, 2 MB of application storage, an additional 2MB of flash file storage, 3MB of RAM, and onboard WiFi + BLE. Because most users will want to view ads in color, I opted for a 128 x 128 pixel SSD1351 OLED screen. To take advantage of a connected ad delivery platform, gathering view and interaction metrics would be a vital aspect. An illuminated button at the front lets users press it to view more information, while a VL53L1X lidar module quietly tracks how many people walk past or stop in front of the display.
When using Asset OTA, it is important to note that the feature exists to bring files to the device while everything else that happens with the files later is up to the application. In this case, there is a function called handleAssets
that accepts a vector
of ApplicationAsset
s within setup
that iterates through each available asset and writes it to a file. One really nice feature of Asset OTA is that the asset bundle is created automatically by simply creating a folder within the project directory, setting the project.properties file to point to the directory, and then placing the desired files in it.
When it's time to display a bitmap on the OLED screen, the program starts by opening a file descriptor to the stored file and then performs a few checks to ensure the image is of the correct size, bit-depth, and compression. From here, each row is read into a buffer and then pixels are drawn per-column onto the screen.
As mentioned above, there are two metrics that are tracked: ad impressions (how many people walk past) and button presses. For the latter, pressing the central button will initially publish an AD_BUTTON_PRESS
event to the Particle Cloud before drawing the "qrcode.bmp" image, thus allowing users to view more information and even visit a store page. In the former's case, ad impression events are triggered by getting close enough to the lidar sensor. By combining these two metrics, one can get much better insights into how a typically static ad is performing without the typical intrusiveness.
The enclosure for the micro ad display was designed in Fusion 360 and made to be easily 3D printed, and due to the simple nature of the components, can be easily adapted to fit a wide variety of environments.
Asset OTA is an easy way to quickly and securely deliver new files to your Particle devices, and it's not limited to images either, as a Photon 2 could be connected to a co-processor over UART in order to flash new firmware, for example. If you want to get started with Asset OTA, you can visit its documentation page here on Particle's API reference site. All of the code used for this project can be found in this GitHub repository.
Comments