Mission
Build this
Build a small perch whose tilt or infrared clue records contact events, with an antenna that shows how active the recent interval has been.
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 |
|---|---|---|
| ● kit | Tilt switch | — |
| ● kit | IR emitter, receiver, 220 Ω and 10 kΩ resistors | — |
| ● 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.
Your invitation
Begin with a claim small enough to test
A flower can be visited by a bee, brushed by a leaf, shaken by a closing door, or inspected by a curious student. Your sensor does not know which story occurred. It knows only that a perch tilted or an infrared reflection changed.
That is not a disappointing beginning. It is an honest one. First build a reliable detector of small contact events. Then take it into the greenhouse and ask which of those events might be consistent with visits, without quietly promoting every twitch into a pollinator.
Write “event” until a human observation gives you evidence for a more specific word.
The central idea
One count can hide two different claims
The sensor changed
A tilt edge or infrared change crossed your chosen rule. The electronics support this claim.
A contact event occurred
Your controlled trials show that the rule usually responds to a known touch.
A pollinator visited
This needs observation or stronger evidence. The sensor alone cannot identify the visitor.
Your published count represents accepted contact events. In the garden log, you may compare those events with watched visits, but keep the two columns separate. A disagreement is useful information about the detector.
Choose what the perch can notice
Let mechanics or light become your witness
The tilting perch
A flexible landing strip moves a switch when loaded. Geometry decides how much force is enough.
Watch for:Wind, vibration, switch chatter, and a perch too stiff for gentle contact.
The infrared lookout
A nearby object changes a reflected signal or interrupts a short protected beam.
Watch for:Sunlight, shiny surfaces, alignment, leaves, and changing background reflections.
You may use one witness well, compare the witnesses, or require both. If you combine them, explain what each combination means and how close together the clues must arrive.
Wiring
Keep the expressive movement away from the evidence
Bench-test the tilt switch and infrared pair separately. Mount the servo antenna on the body, not on the measured perch; otherwise the creature may count its own performance.
The power rule: The infrared receiver pull-up uses 3V3 and the emitter needs its 220 Ω resistor. The tilt input uses the ESP32 pull-up. The servo uses a separate 5 V supply. Join all grounds.
Bench referenceOpen the exact wiring map
| ESP32 pin | Part | Part marking | Carries |
|---|---|---|---|
GPIO 32 | Tilt switch | one leg | Digital in/out — configure INPUT_PULLUP |
GND | Tilt switch | other leg | Ground |
GPIO 25 | IR emitter | anode via 220 Ω | Digital in/out — reflective or interrupted-beam route |
GND | IR emitter | cathode | Ground |
GPIO 34 | IR receiver | collector + 10 kΩ pull-up | Analog voltage — pull up to 3V3 |
GND | IR receiver | emitter | Ground |
GPIO 18 | SG90 servo | signal (orange) | PWM to actuator — moves the antenna, not the perch |
external 5 V | SG90 servo | power (red) | 5V power — separate supply |
GND | SG90 servo | ground (brown) | Ground — join servo and ESP32 grounds |
Disconnect USB before rewiring. Confirm the infrared receiver pin order from its datasheet or kit marking. Keep the emitter current-limited and never power the servo from ESP32 3V3.
- Digital in/out
- Ground
- Analog voltage
- PWM to actuator
- 5V power
This map assumes a bare infrared LED and phototransistor. If your kit uses a three-pin sensor module, follow its VCC, GND, and OUT labels and verify that OUT is safe for 3.3 V logic.
Teach a twitch to become one event
The perch needs a memory longer than the bounce
The signal sits inside its measured quiet range.
A change begins. Wait briefly to reject electrical chatter.
Count once and begin a short hold-off period.
The signal has returned to rest long enough for another event.
Your team decides:
- How far must the signal move beyond ordinary resting noise?
- How long must a change persist before it counts?
- When do several bounces belong to one contact?
- How many recent events make the antenna sweep slowly, quickly, or not at all?
Your proxy experiment
Give the detector known truths before giving it mysteries
- Invent a repeatable touch.
Use a marked dowel, bead, or small known weight. Keep the contact position and motion consistent.
- Stage at least thirty true events.
Record how many your fixed rule accepts and how many it misses.
- Stage at least thirty disturbances.
Try wind from a fan, table taps, nearby footsteps, moving leaves, bright light, and the servo gesture.
- Tune once, then freeze.
Repeat both sets without changing the rule. This untouched round is the result you report.
How often the detector notices your proxy event.
How often an impostor becomes a false event.
How often one touch becomes two or more events.
| Trial | Known truth | Tilt clue | IR clue | Accepted? | Why? |
|---|---|---|---|---|---|
| marked touch | event | ___ | ___ | ___ | ___ |
| fan only | disturbance | ___ | ___ | ___ | ___ |
| servo sweep | disturbance | ___ | ___ | ___ | ___ |
When the flower tells tall stories
Every false event has a physical cause worth finding
One touch becomes a burst of counts
The switch chatters or the perch oscillates. Require a stable return before rearming, and adjust the mechanics rather than hiding every bounce in code.
Bright sunlight moves the infrared signal
The receiver is seeing the environment as well as the emitter. Add a short dark tube, reduce the sensing distance, or make tilt the main witness.
The servo creates a visit
Its motion shakes the perch or changes the reflection. Separate the structures and test with the antenna active.
A gentle touch is invisible
The perch may be too stiff, the switch may be badly placed, or the optical geometry may miss the contact region. Change one physical feature and repeat the same trials.
The garden count rises with no watched visitor
Do not erase the event. Record wind, leaves, shadows, and unobserved intervals. The label remains “contact event,” not “bee.”
Choose your honest ambition
What kind of perch team will you become?
The tiny-force engineers
Make perch geometry the experiment. Compare stiffness, landing position, and the smallest repeatable proxy touch.
The witness comparers
Test tilt, infrared, AND, and OR rules on the same trials. Show what each gains and mistakes.
The careful field naturalists
Pair sensor events with timed human observations and preserve an “unknown” category when the view is incomplete.
A calm way through the build
Collect four small wins
pp-01says hello.Join the garden before counting anything.
- One witness shows a stable resting signal.
Build the mechanics and raw display before the event rule.
- One known touch becomes one event.
Add confirmation, rearming, and an event counter.
- The antenna reflects recent rate without creating events.
Power and mount the servo separately, then rerun the disturbances.
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.
Accepted contact events
garden/greenhouse-2/pollinator-node/pp-01/countUnit: events
Perch tilt state
garden/greenhouse-2/pollinator-node/pp-01/tiltUnit: enum
Listen beyond your own device.
garden/greenhouse-1/light-node/sc-01/light-levelCompare event rate with shared light conditions over the same time windows. A relationship may suggest when events occur; it does not identify what caused them.
Finish line
Ready to introduce to the garden
pp-01 stays online and publishes accepted event count and tilt state.
The reject feed stays clear after the final code starts.
The device reads Sun Chaser light level without treating correlation as identification.
The antenna reflects recent event frequency without shaking or optically disturbing the detector.
The build log contains repeatable proxy touches, disturbances, an untouched test, missed-event rate, false-event rate, double counts, and classification limits.
The moving and sensing structures are separated, the servo is safely powered, greenhouse electronics are protected, and the device label can be scanned.
A strong Pollinator Perch does not impress by calling every twitch a bee. It earns trust by detecting a small event well and drawing a bright line around what remains unknown.