MYCSS

Показ дописів із міткою SQLite. Показати всі дописи
Показ дописів із міткою SQLite. Показати всі дописи

2026-10-04

Project Sound Monitor for detect target operational states

Sound Monitor is an IoT sound and acoustic pattern monitoring tool designed to capture live audio, analyze spectral characteristics (PSD / Power), detect target operational states (e.g., compressor/device ON/OFF), and record state transitions to a SQLite database. 

STFT spectrogram of a compressor sound recorded in advance using a smartphone’s digital microphone.
PSD Welch 60-1000Hz

2026-10-03

Project Seven Segment Monitor - visually monitoring the refrigerator’s power consumption

🛎️ A hobby involving collecting provisions includes monitoring passive Bluetooth temperature, analyzing sound with PSD and FFT tools, and now adding visual monitoring through a webcam focused on seven-segment indicators.

Why 

The previous project for detecting the on/off state of the kitchen refrigerator by sound analyses has been stopped. The built-in microphone’s sound quality was so poor and noisy that I decided to abandon it and switch to a more reliable method: visually monitoring the refrigerator’s power consumption by reading the amperage, with 00.0A indicating OFF and 00.7A or 00.8A indicating ON.

How

📼 Seven Segment Monitor is a computer vision and IoT tool that continuously captures images from a USB or V4L2 camera, or static frames, of seven-segment displays. It uses OpenCV to extract and recognize numeric readouts, then stores the parsed readings in an SQLite database with automated retention and cleanup.
Example of a development result
A development laptop with sunglasses used as a pre-filter for the webcam to reduce lighting from seven-segment LED indicators on a surge voltage device.

Features

  • Multi-threaded Architecture:
    • Camera Producer: Captures frames asynchronously from a V4L2/USB camera or loads them from disk for testing or simulation.
    • Vision Worker: Handles automatic rotation correction, color and brightness filtering, shear de-skewing, digit box slicing, and segment state recognition.
    • Database Writer Worker: Batches writes and saves timestamped readings and alert/state statuses to SQLite.
    • Database Cleanup Worker: Purges records older than a configurable retention period automatically.
  • Multiple Color & Mask Extraction Algorithms:
    • WITHOUT_GREEN: Difference-based channel masking for red LED displays.
    • RED: Dual-band HSV color masking.
    • RED_ADAPTIVE: Adaptive thresholding based on the green-to-red pixel ratio.
  • Display Layout Customization:
    • Configurable rows and digits per row (NUM_DIGITS_ROWS, NUM_DIGITS_PER_ROW).
    • Shear angle compensation for slanted italicized digits (DIGIT_SHEAR_ANGLE).
    • Digit density and segment activation threshold tuning.
  • Deployment Ready:
    • Run directly via Python CLI (sevensegmentmonitor).
    • Run containerized via headless Docker Compose with optional Grafana integration.

Repositories: 

2026-09-13

Project Thermometer Monitor - Bluetooth Low Energy Passive Monitoring

Thermometer Monitor is a Python-based asynchronous Bluetooth Low Energy (BLE) environmental monitoring app and telemetry logger. It continuously listens for BLE advertising packets from smart thermometers, filters out duplicate readings, and saves the data to a local SQLite database.

Thermostat of refrigerator 

Why 

This series of projects (Thermometer Monitor, Sound Monitor, Seven Segments Monitor) originated from the stated problem of restoring the working condition of a kitchen refrigerator. Need to understand how mechanical tuning of the thermostat range in a refrigerator relates to temperature and the corresponding on and off cycle times of the compressor.

How

It constantly listens for BLE advertising packets in passive mode from smart thermometers and hygrometers (like the Xiaomi Mijia / LYWSD03MMC running custom ATC or PVVX firmware), decodes the sensor data, removes duplicate readings, and saves everything to a local SQLite database.

It supports cross-platform operation (Linux, macOS, Windows) out of the box via Bleak, with an automatic Linux raw HCI socket fallback for passive mode in legacy adapters or specialized container setups. If passive mode isn’t available, like on macOS, it switches to active listening mode. In active mode, the listener device requests extra responses from the target device’s advertising packets, such as details like the device name. These additional responses drain the BLE device’s battery more, so it’s best to use passive scanning whenever possible.

It comes with ready-to-use Docker Compose setups and a Grafana dashboard integration for real-time visualization.

This project is a continuation of other projects focused on monitoring BLE devices:
- Моніторинг температури та сповіщення про критичні значення.
- Скрипт для показу значень температури та вологості Bluetooth BLE термометра Xiaomi

Grafana Example View:


Коли забув ти рідну мову, біднієш духом ти щодня...
When you forgot your native language you would become a poor at spirit every day ...

Д.Білоус / D.Bilous
Рабів до раю не пускають. Будь вільним!

ipv6 ready

Популярні публікації