Flies are a nuisance. They are known for their annoying habits that disrupt people's lives. They can be in the air, on our food, and even give us diseases. Fortunately there are measures and devices to catch flies or deter them from your house. Unfortunately some of these can annoy also their users by permanently emitting light, sound, odor etc.
Electric/electronic fly repellent devices or traps usually are active round the clock, 24/7, consuming power, emitting light, sound, odor etc. A smarter device would only get into action, when it detects the presence of flies nearby. (See "Smart Bee Camera Trap" for a similar project: A camera that is activated by the buzzing of bees).
The PSoC™ 6 62S2 Wi-Fi BT Pioneer Kit & IoT Sense Expansion Kit would be used as the 'intelligence' for single or a group of connected (via Wi-Fi or BLE) repellent devices by detecting the presence of flies nearby from their buzzing sounds and automatically activating the 'repellent process' (e.g. generation of ultrasonic noise, spraying repellent etc.)
SolutionThe PSoC™ 6 62S2 Wi-Fi BT Pioneer Kit & IoT Sense Expansion Kit (CY8CKIT-062S2-43012 + CY8CKIT-028-SENSE) would be used as the 'intelligence' for single or a group of connected (via Wi-Fi or BLE) repellent devices by detecting the presence of flies nearby from their buzzing sounds and automatically activating the 'repellent process' (e.g., generation of ultrasonic noise, spraying repellent etc.).
Communication between detection unit and repellent unit(s) can be done via MQTT, e.g., via a MQTT broker integrated in a smart home solution.
See https://www.hackster.io/infineon/products/psoc-62s2-wi-fi-bt-pioneer-kit/specs and https://www.infineon.com/cms/en/product/evaluation-boards/cy8ckit-062s2-43012/ for details.
The PSoC™ 62S2 Wi-Fi BT Pioneer Kit (CY8CKIT-062S2-43012) is a low-cost hardware platform that enables design and debug of the PSoC™ 62 MCU and the Murata 1LV Module (CYW43012 Wi-Fi + Bluetooth Combo Chip).
The PSoC™ 62S2 Pioneer Kit features the PSoC™ 62 MCU (CY8C624ABZI-S2D44): 150-MHz Arm Cortex-M4 and 100-MHz Arm Cortex-M0+ cores, 2MB of Flash, 1MB of SRAM, Secure Digital Host Controller (SDHC) supporting SD/SDIO/eMMC interfaces, programmable analog blocks, programmable digital blocks, Full-Speed USB, a serial memory interface, a PDM-PCM digital microphone interface, and industry-leading capacitive-sensing with CAPSENSE™.
WiFi-BT:Infineon Excelon Ultra 4Mbit, 108-MHz (limited to 80-MHz on this kit) Quad SPI nonvolatile F-RAM in an 8-pin SOIC package, that facilitates instant, local and energy-efficient data-logging at write speeds that are as fast as parallel battery-backed solutions and provides virtually unlimited read/write cycle endurance.
Capacitive sensing interfaces including 2 buttons and a 5-segment slider. Using the 4th generation CAPSENSE™ provided in the PSoC™ 62 Line, self- and mutual-capacitive-sensing systems can be evaluated with this kit.
IoT Sense Expansion KitSee https://www.hackster.io/infineon/products/psoc-62s2-wi-fi-bt-pioneer-kit/specs and https://www.infineon.com/cms/en/product/evaluation-boards/cy8ckit-028-sense/ for details.
The IoT Sense Expansion Kit is a low-cost Arduino™ UNO compatible shield board that can be used to easily interface a variety of sensors with the PSoC™ 6 MCU platform, specifically targeted for audio and machine learning applications.
- · Digital XENSIV™ MEMS Microphone(s)
- · Digital XENSIV™ Barometric Air Pressure Sensor
- · Bosch 9-axis Absolute Orientation Sensor
- · Piezo MEMS Analog Microphone
- · Audio Codec and headset jack
- · OLED Display Module
Infineon XENSIV™ MEMS microphones introduce a new performance class for MEMS microphones that overcomes existing audio chain limitations. IM69D130 is designed for applications where low self-noise (high SNR), wide dynamic range, low distortions and a high acoustic overload point are required.
The SoftwareModusToolbox™ SoftwareModusToolbox™ is a collection of easy-to-use software and tools enabling rapid development of Infineon MCUs, covering applications from embedded sense and control to wireless and cloud-connected systems using AIROC™ Wi-Fi, AIROC™ Bluetooth® and AIROC™ Wi-Fi and Combo devices.
See the ModusToolbox™ Landing Page + Downloadhere.
SensiML Analytics ToolkitSensiML Analytics Toolkit is an IoT AI toolkit software designed for ultra-low power embedded devices. SensiML Analytics Toolkit facilitates AI for a broad array of resource-constrained time-series sensor endpoint applications, including a wide range of consumer and industrial sensing applications. The SensiML Analytics Toolkit provides endpoint intelligence benefits, whether sourced from accelerometers, load cells, strain gauges, microphones, gyroscopes, passive IR, body electrodes, voltage, or current measurement.
The Analytics Toolkit offers power efficiency on multiple levels, extensibility, and flexibility in a proven solution.
See https://sensiml.com for details
ImplementationCapturing And Preparing Training DataSensiML supports the Infineon PSoC 62S2 Wi-Fi BT Pioneer Kit with the IoT sense expansion kit.
Follow the instructions for the Infineon PSoC™ 6 in the SensiML Toolkit documentation at https://sensiml.com/documentation/firmware/infineon-psoc6/infineon-psoc6-cy8ckit-062s2-43012.html and https://sensiml.com/documentation/guides/getting-started/capturing-sensor-data.html :
Connect the IoT sense expansion kit (CY8CKIT-028-SENSE) to the PSoC 62S2 Wi-Fi BT Pioneer Kit (CY8CKIT-062S2-43012) in order to use the IMU and Microphone sensors.
In order to build firmware for the Infineon PSoC 62S2 Wi-Fi BT Pioneer Kit, download and install the ModusToolbox from Infineon, available here.
Create a new application with the SensiML Template in the Eclipse for ModusToolbox window for the CY8CKIT-062S2-43012 board support package. For data collection, set the #define APPLICATION_RUNNING_MODE in app_config.h to
#define APPLICATION_RUNNING_MODE DATA_CAPTURE_RUNNING_MODE
and #define SENSOR_SELECT_MODE to
#define SENSOR_SELECT_MODE SENSOR_AUDIO
then run the command
make program TARGET=CY8CKIT-062S2-43012 TOOLCHAIN=GCC\_ARM
in the terminal to build and flash the application:
After the board has been flashed with the data collection firmware it can be used in the Data Capture Lab:
Follow the instructions in the SensiML “Getting Started” guide in section “Capturing Sensor Data” (https://sensiml.com/documentation/guides/getting-started/capturing-sensor-data.html) to record sound samples with the device.
For this project two labels
- Background Noise
- Insect Sound
and a metadata attribute Class for distinguishing training and test data have been created:
After recording the collected data has to prepared i.e., segmented and labeled (see https://sensiml.com/documentation/guides/getting-started/labeling-your-data.htmlfor instructions). For this project the recorded audio has been segmented by using an automatic segmentation algorithm (“Max Min Threshold Segmentation”):
Go to https://app.sensiml.cloud/, sign in to your account and select the regarded project with the collected and labeled data:
To train a model, you first need to select the data to be used by creating the appropriate query in the Prepare Data
section. After choosing a name and selecting session, label, relevant metadata, and the sensor(s)the query can be saved. Label and segment length distribution can be reviewed afterwards.
In the Build Model
section, a pipeline can be created by entering a name and choosing the query. You can leave it to SensiML AutoML to find an appropriate machine learning algorithm or choose the algorithm and the parameters manually. Clicking Optimize
will build the model, which can be tested with the collected test data afterwards.
Finally, the generated model can be downloaded as Knowledge Pack Library and deployed into the application for testing.
Follow the instructions for the Infineon PSoC™ 6 in the SensiML Toolkit documentation at https://sensiml.com/documentation/firmware/infineon-psoc6/infineon-psoc6-cy8ckit-062s2-43012.html#download-flash-model-firmware to integrate the downloaded package into an application:
After integration of the knowledge pack into the original SensiML Template application, building the project and flashing the firmware to the device, the model can be tested and verified on the device itself using a terminal application:
For this project two example applications have been adapted / merged, to implement the sensing device:
- The MQTT client (https://github.com/Infineon/mtb-example-anycloud-mqtt-client) example
- and the SensiML PSoC 6 Template Firmware (https://github.com/sensiml/psoc6-template-fw).
Some code can be found in the associated git repository .
to be continued ...
- · PSoC™ 6 MCU Landing Page (code examples, documentation, technical reference manual, etc)
- · PSoC 6 Developer Documentation
- · XENSIV™ Sensor(s)
- · PSoC™ 6 62S2 Wi-Fi BT Pioneer Kit Landing Page
- · IoT Sense Expansion Kit Landing Page
- · PSoC 62S2 Wi-Fi BT Pioneer Kit Quick Start Guide (CY8CKIT-062S2-43012)
- · IoT Sense Expansion Kit Quick Start Guide (CY8CKIT-028-SENSE)
- · Getting Started with PSoC 6 MCU (AN228571)
- · PSoC 6 MCU Low-Power modes and Power reduction techniques (AN219528)
- · Low-power system design with AIROC™ CYW43012 Wi-Fi & Bluetooth® combo chip and PSoC™ 6 MCU
- · ModusToolbox™ Landing Page + Downloadhere
- · SensiML Analytics Toolkit + a free trial account with SensiML is available here
- · SensiML - Getting Started Building Edge AI for the PSoC™ 6
Comments