Retailers have been struck hard by the COVID-19 pandemic. Stores had to take safety measures that they did not expect. The government requirements were usually temporary and needed extra resources for the already struggling businesses. The problem I am solving helps retailers use their existing infrastructure to meet up-to-date government regulations with minimal investment by using cloud technologies.Hardware requirements
I have built a cloud-based solution that uses the existing hardware that can be found at stores (like surveillance cameras, air quality, and humidity sensors) to follow government regulations. Because of using cloud technologies, these systems can easily adapt to new regulations. Eg. occupancy limits based on the store's square meter area.
In this project, I have selected hardware that are very common between hacksters, like the DHT11 sensor and the Raspberry Pi but the project can be fitted to "any" hardware.
The application on the M5Stack Core2 for AWS runs using the FreeRTOS kernel—a real-time operating system (RTOS).M5Stack Core2 for AWS IoT EduKit
The M5Stack Core2 for AWS is the reference hardware kit for use with AWS IoT EduKit. It is equipped with an Espressif ESP32-D0WDQ6-V3 and Microchip ATECC608A Secure Element. The stackable, modular design supports 2.4 GHz WiFi, Bluetooth 4.2, and Bluetooth LE connectivity with the option to enable additional communication protocols using separate modules.
The M5Stack Core2 for AWS provides 16 MB flash and 8 MB PSRAM, a speaker with I2S amplifier, PDM microphone, 10 programmable LEDs, vibration motor, RTC, capacitive touch screen, microSD card slot (16 GB maximum), lithium battery, 6-axis IMU, M-Bus Socket, and Grove connector expansion.
The M5Stack Core2 for AWS will be the central display unit for store managers/owners to monitor the health of their stores. Since it has a built-in battery and WiFi, managers can carry it with them or attach it to a visible place with its built-in magnets.User interface
The UI is designed to be simple and intuitive to use without needing extra education. It displays only the relevant information needed. When there is a problem detected in the store the M5Stack Core2 for AWS displays the error in real-time.
The current date and time are displayed in the top bar. The time is synced with AWS.
The status icons show if the device is connected to AWS IoT Core, the WiFi connection status, and battery percentage.
The bottom scrollable text box is used to display logs and debug information.
The M5Stack Core2 for AWS lower buttons are used to adjust the brightness of the display.Connecting to AWS IoT Core
Setting up the development environment is well documented in the AWS IoT EduKit Cloud Connected Blinky workshop.
Follow these bullet points to connect to AWS IoT core:
- Log into your AWS account or register one account
- Create an AWS user for the project and write down your Access Key ID and secret
- Install the AWS CLI and connect with your newly created user
- Set up your PlatformIO environment
- Download the code and upload it to the M5Stack Core2 for AWS
The attached code connects to AWS IoT Core and subscribes to the MQTT topic.Connecting external sensors
The M5Stack Core2 for AWS has multiple connections and while it is certainly possible to connect external sensors to the device I have chosen a different approach. Leveraging the power of AWS and making the device compact and mobile that can be easily carried the device only displays information. External sensor data are all coming through AWS IoT Core.
Using this approach multiple types of sensors can be attached to the solution. For example purposes, I used Hariharnath Paduchuru's DHT11 code.
With the power of AWS we can use complex AI/ML to monitor our store's health.
I have used Angela Wang & Tanner McRae's tutorial on training the Amazon SageMaker object detection model and running it on AWS IoT Greengrass. The 3 part guide can be found here: Part 1, Part 2, Part 3
The system together with the M5Stack Core2 for AWS IoT EduKit uses surveillance cameras, air quality and humidity sensors, and AWS technologies to track face-covering requirements, occupancy limits based on the store's square meter area (by counting the number of persons inside the store), following physical distancing guidelines (eg. opening a new cashier desk when there are too many people waiting in line or too many people have been waiting at the entrance) checking air quality and humidity readings. In case of a problem, the system alerts the store manager by Amazon Simple Notification Service to take action. The M5Stack Core2 for AWS IoT EduKit acts as a central device for this solution, displaying store health information.