Mission
Build this
Build a privacy-preserving sound-level creature that samples amplitude, publishes only a relative percentage, and reacts to sustained changes rather than single spikes.
Borrowed parts are labelled below and have a fallback. The registered device ID is fixed; sensing and behaviour decisions remain yours.
Bill of materials
Parts
| Source | Part | Fallback |
|---|---|---|
| ○ fablab | Analog microphone module | Use the kit sound sensor after verifying its analog output |
| ● kit | OLED | — |
| ● kit | SG90 servo | — |
Disconnect USB before rewiring. Motors, the relay, and the servo need appropriate power and a shared ground. Never drive an actuator from the ESP32 3V3 pin.
Backup assignment · your invitation
Listen to a room without listening to its words
A room has a sound weather of its own. It settles, swells, and surprises. The Loud Bug notices those broad changes, but it never records audio and never tries to understand speech.
Your job is to turn thousands of fast microphone samples into one slow, relative description: how energetic was the recent sound compared with this device’s own quiet and loud reference scenes? The wings then give that changing atmosphere a body.
No recordings. No speech recognition. No raw audio leaves the device. The garden receives only one summary percentage.
Meet the idea
A microphone gives you a wobble, not a loudness number
The module produces a voltage that moves above and below a resting centre as air pressure changes. One analogRead catches only one point on that rapid wobble. It might land near the centre even during a loud sound.
Instead, take many samples during a short window. Find how far they spread, then reduce that window to one amplitude measure. A quiet window has a narrow spread. A noisy window usually has a wider one.
Sample window
A short listening interval containing many raw readings. Raw samples stay inside the device.
Amplitude
The size of the electrical wobble during that window, not the words or pitch in the sound.
Relative percent
A position between your documented quiet and loud references. It is not a calibrated decibel value.
- in the worldChanging room soundAir pressure trembles around the microphone.
- the partMicrophone moduleSound becomes a quickly changing voltage.
- electricalWindow spreadCode finds the peak-to-peak or another documented amplitude.
- in the codeSmoothed relative levelSeveral windows become a stable 0–100% estimate.
- on the spinenoiseOnly the summary percentage is published.
Privacy improves when the reduction happens immediately: many fleeting samples enter, one slow summary leaves.
The lovely trick
One clap should not make a noisy minute
A brief spike and a sustained busy room can reach the same peak. They should not necessarily produce the same behaviour. Memory lets the creature distinguish a momentary surprise from a lasting change.
Smoothing is a trade: more memory makes the wings calm, but it also makes them late. Choose a rule, then measure that delay instead of hiding it.
- 01Quiet baselineWings rest; recent windows stay near the lower reference.then, higher for long enough,
- 02Candidate riseSeveral windows are higher, but the bug waits for evidence.then, evidence persists,
- 03Sustained activityWings rise and the summary follows the smoothed level.then, quiet windows return,
- 04Slow settlementThe level falls through a separate recovery rule.
Back to the start: Return to the quiet pose only after the recovery evidence is complete.
The exact boundaries and waiting times are yours. Separate rise and fall rules prevent nervous wing flicker.
A value of 60% describes where this device sits between its own chosen references. Another module, gain knob, enclosure, or position may produce a different 60% in the same room. Keep the setup fixed and document it.
Wiring
Prove the quiet signal before adding moving wings
Watch raw analog samples in the Serial Monitor first. Then print one window amplitude. Add conversion, screen, and servo only after repeatable scenes produce visibly different summaries.
The power rule: Use the verified microphone module at 3V3 so its analog output remains safe for the ESP32. The OLED also uses 3V3. Power the servo from a separate 5 V source and join all grounds.
Bench referenceOpen the exact wiring map
| ESP32 pin | Part | Part marking | Carries |
|---|---|---|---|
3V3 | Analog microphone module | VCC | 3V3 power — use the verified analog-output module supplied by the lab |
GND | Analog microphone module | GND | Ground |
GPIO 34 | Analog microphone module | AO / OUT | Analog voltage — sample the changing voltage; do not use the threshold-only digital output |
3V3 | OLED (SSD1306) | VCC | 3V3 power |
GND | OLED (SSD1306) | GND | Ground |
GPIO 21 | OLED (SSD1306) | SDA | I²C bus |
GPIO 22 | OLED (SSD1306) | SCL | I²C bus |
GPIO 18 | SG90 servo | signal (orange) | PWM to actuator — wing position |
external 5 V | SG90 servo | power (red) | 5V power — separate supply |
GND | SG90 servo | ground (brown) | Ground — join servo and ESP32 grounds |
An ESP32 input must never receive more than 3.3 V. Verify the module and pin labels with lab staff. Do not add an SD card, stream samples, or store raw audio.
- 3V3 power
- Ground
- Analog voltage
- I²C bus
- PWM to actuator
- 5V power
Use the analog AO or OUT pin. A module’s DO pin answers only whether an adjustable threshold was crossed and cannot provide the relative scale this investigation needs.
Give it character
What kind of listener should the creature become?
The bug might breathe slowly with the room, wake only for sustained bustle, or show recent sound as a few deliberate poses. The gesture should reveal the summary without reenacting every spike.
Your team decides:
- How long is one sample window, and how many windows contribute to the smoothed value?
- Which repeatable scenes define 0% and 100%, and what happens beyond them?
- Should the wings move continuously or use a few readable states?
- How slowly should the bug settle after a loud moment?
Write these decisions in plain language before turning them into code. A clear rule is easier to test, explain, and change.
Your field adventure
Can one honest scale recognise repeatable room scenes?
You are testing a measurement method, not rating people. Keep the device position and gain fixed. Use staged, consented proxy sounds rather than capturing ordinary conversations.
- Teach the endpoints.
Record many windows in a documented quiet scene and a repeatable loud reference such as a clap made at a marked distance.
- Freeze the conversion.
Choose how amplitude maps to 0–100%. Do not move the module gain knob after this point.
- Challenge it with the middle.
Stage gentle taps, conversation-like non-speech sound, and short claps at two measured distances.
- Measure memory.
Record the time required to rise and settle, plus overlap, false changes, and saturation.
| Scene | Distance | Window amplitude | Relative level | Rise / settle time | What limits the claim? |
|---|---|---|---|---|---|
| quiet room | fixed | ___ | ___ % | ___ s | ___ |
| repeatable middle scene | ___ m | ___ | ___ % | ___ s | ___ |
| brief clap proxy | ___ m | ___ | ___ % | ___ s | ___ |
When it gets dramatic
A strange reading is usually telling you about the setup
The raw value barely changes
You may be reading the digital threshold pin, using too few samples, or viewing only the voltage centre. Inspect many analog samples and calculate their spread.
Everything becomes 100%
The loud reference is too quiet, the gain is too high, or the signal is clipping. Freeze placement, lower approved gain, and teach the endpoints again.
The wings react to their own movement
The servo makes sound and vibration near the microphone. Separate them physically or ignore only the known gesture interval and document that blind spot.
The number changes when USB power changes
Analog readings depend on clean power and grounding. Keep the final supply and wiring fixed during calibration and trials.
The percentage looks like decibels
Rename labels and explanations. This instrument has no acoustic calibration, so publish percent and state exactly what the references were.
Choose your direction
What kind of sound investigator will you become?
The window makers
Compare short and long sample windows and show what each catches or misses.
The memory designers
Make rise, fall, and gesture delay the main experiment. Find calm behaviour that still feels responsive.
The privacy engineers
Audit every stored variable and message, then explain how the design makes speech reconstruction impractical.
Each direction is real engineering. Pick the question that keeps your team curious.
A calm way through the build
Collect four small wins
- lb-01 says hello.
Join the garden before connecting the microphone.
- Three staged scenes make three different amplitude clouds.
Stay in Serial Monitor; do not publish raw samples.
- One relative summary reaches the garden every ten seconds.
Confirm the percent unit and a clear reject feed.
- The wings respond to sustained change.
Add smoothing, then measure rather than guess the delay.
When a new step fails, return to the last small win. The fault is now somewhere in the few wires or lines you just added.
The garden handshake
Share what you found
These names are the rigid part of the project. They let another team find your work without knowing what you called the variables in your code.
Relative sound level
garden/visitor-centre/sound-node/lb-01/noiseUnit: percent
Listen beyond your own device.
garden/entrance/counter/gk-01/countEntrance count offers aggregate context. Compare broad time windows only. A relationship between activity and sound does not identify a visitor, explain a sound, or reveal speech.
Finish line
Ready to introduce to the garden
lb-01 stays online and publishes only the relative noise summary.
The reject feed stays clear after the final code starts.
The device reads the aggregate Gate Keeper count.
No raw samples, recordings, or speech-derived features are stored or transmitted.
The wings use sustained evidence without interrupting new garden messages.
The build log documents references, fixed placement and gain, staged scenes, overlap, saturation, response delay, and privacy limits.
The Loud Bug succeeds when it notices the room’s weather while remaining completely uninterested in anyone’s words.