
LogicAnalyzer
gusmanb/logicanalyzer
24 channel, 100Msps logic analyzer hardware and software

This is the refactored code for the Hygienie sensor. Application Behavior: The Hygienie sensor operates in an ultra-low-power mode using ESP32 deep sleep.
Hygienie pcb is an open-source printed circuit board by Ward21Century, from the Ward21Century/Hygienie repository on GitHub. It is a 2-layer board of 43.1 × 63.5 mm with 10 parts on 23 nets, routed with 38 tracks and 1 via.
It is built around the DFR0478. Its parts include 2 resistors and 1 switch.
This is the refactored code for the Hygienie sensor. Application Behavior: The Hygienie sensor operates in an ultra-low-power mode using ESP32 deep sleep. On first boot, the system initializes all modules (WiFi, MQTT, NTP time sync, LCD graphics) and displays a startup animation. After initialization, the device enters deep sleep and wakes under two conditions:
Timer-based wake-up (ESP_SLEEP_WAKEUP_TIMER):
Wakes at user-configured intervals Displays LCD animation If offline readings are buffered, connects to WiFi, sends all accumulated data via MQTT, syncs time with NTP server, then disconnects Returns to deep sleep
External GPIO wake-up (ESP_SLEEP_WAKEUP_EXT0):
Triggered by reed switch on GPIO 27 (detects hygiene event like door opening or dispenser activation) Records timestamp of event using AppMqttAddTime() Displays LCD animation as visual feedback If buffer reaches MAX_OFFLINE_READINGS threshold, immediately connects to WiFi, uploads all data via MQTT, syncs time, then disconnects Returns to deep sleep
The device maintains event timestamps in RTC memory (survives deep sleep) and only activates WiFi/MQTT when needed, minimizing power consumption. All GPIOs are configured for low-power state before each sleep cycle. This architecture allows the sensor to run on battery power for extended periods while reliably capturing and transmitting hygiene compliance data.This means that source code has been refactored into modules, unit-tests have been written for each module and can be run on the esp32 itself for regression testing, and that project values such as wifi network, password, device id, and sleep duration can be entered in a terminal menu.
hygienie_project — Application project directory
- components — Components of the application project
+ appdata — Module that describes how the data is structured.
+ appgraphics — Module that uses graphics libary and displays animations
+ appmqtt — Module that encapsulates mqtt client
+ appsleep — Module that controls esp32 sleep mode
+ appwifi — Module that encapsulates wifi libraries
+ main - Main source files of the application project
- test — Test project directory
- main — test main directory for test runner
+ hygienie_unit_test.c — hygienie test runner.
Makefile / CMakeLists.txt - Makefiles of the application projectWhen the main application project is compiled, tests are not included. Test project includes the tests by setting TEST_COMPONENTS variable in the project makefile.
Please look at https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/ for installing esp-idf and https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html#get-started-linux-macos-first-steps for configuring and building project on command line.
It is recommended that you run:
. $HOME/esp/esp-idf/export.shin your terminal.
and create the alias:
alias get_idf='. $HOME/esp/esp-idf/export.sh'# Configure the projectFor the menu_config:
For the test project, you can open the project configuration menu (idf.py menuconfig) and explore a few options related to Unity under Component Config, Unity unit testing library.
As explained above, this example contains two projects: application project and test project.
* Run `idf.py -p PORT flash monitor` in the current directory (`unit_test`).
* Observe the output: a list of random numbers and their mean value.2. Test project is responsible for running the tests.
* Enter `test` directory (`unit_test/test`), and run `idf.py -p PORT flash monitor`.
* Observe the output: results of test case execution.See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
Inside the testable component, unit tests are added into test directory. test directory contains source files of the tests and the component makefile (component.mk / CMakeLists.txt).
unit_test
- components - Components of the application project
- testable
- include
- test - Test directory of the component
* component.mk / CMakeLists.txt - Component makefile of tests
* test_mean.c - Test source file
* component.mk / CMakeLists.txt - Component makefile
* mean.c - Component source fileWhen the main application project is compiled, tests are not included. Test project includes the tests by setting TEST_COMPONENTS variable in the project makefile.
In main application. Collecting 32 random numbers from 1 to 100:
5 66 86 98 62 66 40 42 7 62
33 77 40 54 8 75 39 82 73 4
22 5 72 78 53 1 6 48 23 1
84 55
Mean: 45#### Executing one test by its name #####
Running Mean of an empty array is zero...
/Users/ivan/e/esp-idf/examples/system/unit_test/components/testable/test/test_mean.c:16:Mean of an empty array is zero:PASS
-----------------------
1 Tests 0 Failures 0 Ignored
OK
Running Mean of an empty array is zero...
/home/user/esp/esp-idf/examples/system/unit_test/components/testable/test/test_mean.c:15:Mean of an empty array is zero:PASS
Test ran in 16ms
-----------------------
1 Tests 0 Failures 0 Ignored
OK
Enter next test, or 'enter' to see menu| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | MountingHole_Pad | MountingHole:MountingHole_2.5mm | H1, H2, H3, H4 |
| 2 | 1K | Resistor_SMD:R_0603_1608Metric | R1, R2 |
| 1 | Conn_01x02 | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | PWR1 |
| 1 | DFR0478 | KiCad:FIREBEETLE_ESP32_Hygienie_Mod | FireBeetle1 |
| 1 | SW_Reed | Resistor_THT:R_Axial_DIN0614_L14.3mm_D5.7mm_P15.24mm_Horizontal | SW1 |
| 1 | ~ | Connector_PinHeader_2.54mm:PinHeader_1x20_P2.54mm_Vertical | LCD1 |

gusmanb/logicanalyzer
24 channel, 100Msps logic analyzer hardware and software

byrantech/laptop
anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

joeycastillo/Sensor-Watch
A board replacement for the classic Casio F-91W wristwatch


OLIMEX/OLINUXINO
OLINUXINO is Open Source / Open Hardware, low cost from EUR 24 Linux Industrial grade Single Board Computer capable to operate -25+85C

rusefi/rusefi
rusefi - GPL internal combustion engine control unit

VoronDesign/Voron-Hardware
Cool Hardware designed by the Voron Design group

hoglet67/RGBtoHDMI
Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI
It measures 43.1 × 63.5 mm and has 2 copper layers, 1.6 mm thick.
10 parts, built around the DFR0478. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the Ward21Century/Hygienie repository on GitHub, at the commit this page was made from: the board is docs/PCB/KiCad Project Files/hygienie_pcb/hygienie_pcb.kicad_pcb and its schematic docs/PCB/KiCad Project Files/hygienie_pcb/hygienie_pcb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask Ward21Century before reusing the design.