Wiznet makers

teamprof

Published December 19, 2025 © GNU General Public License, version 3 or later (GPL3+)

2 UCC

0 VAR

5 Contests

0 Followers

0 Following

Original Link

Pi Pico Fire alarm sound detector running on W5100S Pico EVB

An audio ML platform built on the RP2040 MCU that detects fire alarm sounds and automatically sends alert messages via WhatsApp.

COMPONENTS Hardware components

WIZnet - W5100S-EVB-Pico

x 1

WIZnet W5100S-EVB-Pico

Software Apps and online services

Arduino - Arduino IDE

x 1

Arduino IDE


PROJECT DESCRIPTION

Pi Pico Fire alarm sound detector running on W5100S Pico EVB
Integrating audio machine learning on Arduino platforms running Pico Mbed OS presents significant challenges, primarily due to the reliance on external audio libraries such as CMSIS-DSP, and TensorFlow Lite for Microcontrollers (TFLM). These libraries, while powerful, introduce complexities in compatibility and resource management, as they are not natively aligned with Arduino’s lightweight abstraction layers or the constrained runtime environment of Mbed OS.
The integrated platform offers a powerful advantage by seamlessly connecting advanced audio and IoT capabilities with the vast ecosystem of the Arduino community, enabling developers to extend thousands of features with minimal effort.  

Main features:
- W5100S Pico EVB (RP2040) running with Arduino Pico Mbed OS
- Integrate TensorFlow Lite micro
- Integrate CMSIS-DSP + CMSIS_6 Core (note: existing Arduino_CMSIS-DSP does NOT support RP2040 CM0+ MCU)
- Integrate Kalman filter into ML post-processing
- Support I2S 24-bit microphone
- Support WIZnet W5100S Ethernet connectivity
- Detect Fire Alarm Sounds and Notify Users via WhatsApp

This project demonstrates how a WIZnet W5100S Pico EVB, paired with an INMP441 microphone, can detect fire alarm sounds and send alert messages to the user via WhatsApp using an Ethernet connection.
 

System diagram

Hardware

The following components are required for this project:
- ohw-pico-audio-kit PCB (available on PCBway)
- WIZnet W5100S Pico EVB
- TDK InvenSense INMP441
- PC with Arduino v2.3.6+ IDE and Arduino libraries installed (see Software setup section)
- a mobile device to receive WhatsApp message
- an audio device to generate fire alarm sound

Device Block Diagram

PCBA photo

Software setup

- Install Arduino IDE v2.3.6+ for Arduino
- Install ArduTFLite, by Spazio Chirale
- Install UrlEncode, by Masayuki Sugahara
- Install SimpleKalmanFilter, by Denys Sene
- Install ArduProf v2.2.2+, by teamprof
- Install arduino-eventethernet, by teamprof
- Install ArduCMSIS_DSP, by teamprof
- Clone this github code by

git clone https://github.com/teamprof/ohw-pico-w5100s-audio-aiot

Build firmware
- Follow the instruction on https://www.callmebot.com/blog/free-api-whatsapp-messages/ to get the APIKey
- Install Arduino IDE and libraries according to section "Software setup"
- Clone this github code by "git clone ohw-pico-w5100s-audio-aiot"
- Open the ohw-pico-w5100s-audio-aiot.ino in Arduino IDE
- Open the secret.h file and replace the placeholder values with your mobile number and the API key provided by CallMeBot

#define MOBILE_NUMBER "<MobileNumber>"
#define APIKEY "<ApiKey>"

- On Arduino IDE, click menu "Tools" -> "Board: Rasberry Pi Pico" -> "Arduino Mbed OS RP2040 boards" -> "Rasberry Pi Pico "
- On Arduino IDE, click menu "Sketch" -> "Verify/Compile"  
If everything goes smoothly, you should see the following screen.

- Connect W5100S Pico EVB to PC, upload firmware by clicking menu "Sketch" -> "Upload"  
If everything goes smoothly, you should see the following screen.

- Launch "Serial Monitor" on Arduino IDE, press "RESET" button on the board, you should see the following screen.

- Connect an Ethernet cable between the board and router, you should see the following screen.

- Generate an alarm sound with an audio output device, the on-board green LED should be turned on and you should see the following screen.

- You should receive a WhatsApp message on your mobile phone a few seconds later. See video demo for reference.

Software flow
When the device boots, it launches ThreadNet to initialize the WIZnet W5100S Ethernet controller. Once the Ethernet network is established, ThreadNet signals ThreadApp with an EthUp event. Upon receiving this event, ThreadApp blinks the on-board LED five times and then launches ThreadAudio.  
ThreadAudio initializes the INMP441 I²S microphone and starts the audio inference engine. The inference results are continuously sent from ThreadAudio to ThreadApp.  
ThreadApp evaluates these results, and if an alarm condition is detected, it instructs ThreadNet to send an alert message via WhatsApp.

Activity diagram

Video demo

Video demo is available on https://youtu.be/vGwigJaA-SI

- 00:01 power up device => red LED turns on
- 00:03 Ethernet network is up => green LED blinks 5 times
- 00:08 generate fire alarm sound 
- 00:09 device detects fire alarm sound => green LED turns on, send WhatsApp message "alarm sound detected"
- 00:17 mobile received WhatsApp message "alarm sound detected"
- 00:19 stop alarm sound 
- 00:22 device detects no alarm sound => green LED turns off, send WhatsApp message "no alarm"
- 00:25 mobile received WhatsApp message "no alarm"

- 00:27 generate fire alarm sound 
- 00:29 device detects fire alarm sound => green LED turns on, send WhatsApp message "alarm sound detected"
- 00:40 stop alarm sound 
- 00:42 mobile received WhatsApp message "alarm sound detected"
- 00:42 device detects no alarm sound => green LED turns off, send WhatsApp message "no alarm"
- 00:51 mobile received WhatsApp message "no alarm"

Debug message
At boot, the system checks for USB CDC availability within "INIT_DEBUG_PORT_TIMEOUT" milliseconds; if detected, all debug messages are routed through USB CDC. If USB CDC is not available within that period, the system automatically falls back to UART0 to ensure debug output remains accessible. Debug port initialization code is available in "initDebugPort()".

Developers can enable or disable logging by modifying the code in "initDebugPort()"  
Debug is disabled by calling "LOG_SET_LEVEL(DebugLogLevel::LVL_NONE)" in "initDebugPort()"  
Enable trace debug by calling "LOG_SET_LEVEL(DebugLogLevel::LVL_TRACE)" in "initDebugPort()"

Example of pico-w5100s-audio-aiot.ino

static void initDebugPort(void)
{
  ...

  LOG_SET_LEVEL(DebugLogLevel::LVL_TRACE);    // enable debug log
  // LOG_SET_LEVEL(DebugLogLevel::LVL_NONE);  // disable debug log

  ...
}

Schematic

 

License
- The project is licensed under GNU GENERAL PUBLIC LICENSE Version 3
 

Copyright
- Copyright 2025 teamprof.net@gmail.com. All rights reserved.

 

Documents
  • Team Prof

    Github repo ohw-pico-w5100s-audio-aiot

Comments Write