1. Introduction
Some novelty lamps and secret-knock door locks both rely on exactly this kind of detection, sensing a deliberate knock or tap and responding to it, in this case by toggling an LED on and off with each detected knock. This experiment reuses the same vibration sensor module, wired to the STM32F070RB, but this time toggles an LED's state with each detected tap rather than simply counting events.
2. Scope
This experiment covers detecting individual trigger pulses from a vibration sensor and using each detected pulse to toggle an LED's state, alternating it on and off with each successive knock. This demonstrates using a momentary sensor event to drive a persistent, alternating output state, a useful and common pattern for toggle-style controls.
3. Prerequisite
3.1 Hardware
-
STM32 Nucleo-F070RB development board
-
Vibration sensor module, spring-based switch type, digital output
-
LED and a 220 ohm resistor
-
Breadboard and jumper wires
-
Micro-USB cable
3.2 Software
-
STM32CubeMX (standalone)
-
STM32CubeIDE
-
ST-LINK USB driver
Community Q&A
0 questionsAsk questions and get answers from our community and staff moderators.
No questions yet — be the first to start the conversation!
Ask a Question
Please log in to ask a question or post a reply.
Login to Participate