In this demo, we delve into IoT pattern detection and activation using complex event processing at the edge. To get started, we set up a simple scenario using two Arduino boards, an edge gateway, and the Striim platform to spot sensor patterns and trigger actuators.
On the first board, we have two actuators: a multicolor LED and a buzzer that can generate sounds. On the second board, we have four sensors: a button, a shock sensor, a light level sensor, and a temperature monitor.
We will look for an IoT pattern or sequence of events. First, the button is pressed, then a shock is detected, the light level reduces, the temperature increases, then the button is pressed again. At the beginning the LED is red, the button turns it yellow, shock makes it orange, light turns it green, temperature makes it blue, and finally it plays a tune on the final button press. The back-end processing is done using a Striim data flow at the edge with monitoring of all the sensor values and commands displayed on the dashboard.
On the first board we have a button, a shock sensor, a light level detector, and a temperature sensor. Our actuators are a multicolored LED ranging from red to violet and a sound generator. The Striim server is still performing analysis, calculating stats for sensor values, and storing these for display. The dashboard displays a sensor data in real-time as well as commands sent to the actuators based on CEP processing.
Sources at the edge collect data from five MQTT topics: one for each sensor and one for command-center actuators. We use pattern matching to look for our specific sequence of events across the sensors with time limits for each step. We also have queries for each step of the pattern to indicate process using the LED. Each match sends a particular color to the LED over MQTT, and if we match all steps, a message is sent to play a tune.
Finally, you have the raw sensor values for the button, shock, light, and temperature sensors as individual messages along with the corresponding CEP output used to trigger the LED and play a tune.
Check out the video to see the IoT pattern detection and activation in action!
To learn more about the Striim platform and its capabilities in IoT pattern detection, please visit our Detecting Patterns & Anomalies page, as well as our Internet of Things page. Questions? Feel free to schedule a demo with a Striim expert or download the platform and try it out!