Mission
Build this
Build an independent temperature-and-humidity node for greenhouse 2 and compare it with Juliet without forcing either series to depend on the other.
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 | DHT11 | — |
| ● 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
Give Juliet a distant witness, not a mechanical twin
Two greenhouses can stand a short walk apart and still collect different weather. Romeo will live in greenhouse 2, feel its own air, and compare notes with Juliet without borrowing her answer.
The project begins with both devices side by side. That temporary meeting reveals how much two inexpensive sensors disagree before the rooms themselves are allowed to differ. Romeo then moves to a marked position and asks when a greenhouse difference is larger than ordinary instrument disagreement.
Romeo always publishes its own local temperature and humidity. Juliet adds comparison context; her silence must never erase Romeo’s measurement.
Meet the idea
Two measurements can disagree for three different reasons
The places may truly differ. The sensors may have different offsets. Or the readings may describe different moments because one message arrived later. A fair comparison must consider all three.
Co-location gives the instruments the same place for a while. Their remaining difference estimates offset and short-term wander. It does not make either sensor perfectly correct, but it removes an easy alibi before deployment.
After Romeo moves, align readings from a shared time window. Report missing or stale data explicitly rather than comparing a fresh Romeo value with an old Juliet value.
Offset
A repeatable difference between the two sensors when they share the same place and time.
Wander
The smaller changing disagreement that remains around the usual offset.
Aligned interval
A comparison window in which both devices contributed fresh enough readings.
- in the worldGreenhouse 2 airLocal temperature and moisture conditions reach Romeo.
- the partRomeo’s DHT11The local sensor produces independent temperature and humidity.
- electricalJuliet message arrivesA separate timestamped temperature offers context.
- in the codeCorrected aligned differenceCode considers offset, age, and uncertainty.
- on the spineRomeo temperature + humidityThe garden always receives the local witness.
Only Romeo’s local measurements are published as its primary evidence. The comparison is behaviour and analysis built from two streams.
The lovely trick
Agreement is a band, not one exact match
If co-located sensors usually differ by 0.8 °C and wander another 0.4 °C, a deployed difference of 0.2 °C cannot support a dramatic greenhouse story. Your uncertainty band defines a quiet region where agreement is good enough.
Use a wider, persistent boundary before turning the servo away. The gesture should respond only when the corrected difference exceeds ordinary disagreement for long enough. A separate return boundary prevents constant indecision near the edge.
- 01Measure locallyRomeo records its own temperature and humidity.then, local reading valid,
- 02Check Juliet ageUse only a temperature recent enough for the chosen window.then, shared value fresh,
- 03Correct and compareApply the documented offset and uncertainty band.then, difference persists,
- 04Gesture honestlyTurn toward, away, or into an unmistakable unknown pose.
Back to the start: Re-evaluate after each new local or shared reading; never reuse stale agreement.
Freshness is checked before difference. Missing Juliet data leads to an unknown gesture, not false agreement.
If both DHT11s are wrong in the same direction, their agreement will not reveal it. Your result supports statements about their relative difference under documented placement—not laboratory-grade air temperature.
Wiring
Build Romeo as a complete local witness before introducing Juliet
First read believable temperature and humidity in Serial Monitor. Add the display, then publish both local topics. Subscribe to Juliet only after Romeo remains useful when that subscription is absent.
The power rule: The DHT11 and OLED use 3V3. A bare DHT11 needs a 10 kΩ DATA pull-up. Power the servo from a separate 5 V supply and join grounds.
Bench referenceOpen the exact wiring map
| ESP32 pin | Part | Part marking | Carries |
|---|---|---|---|
3V3 | DHT11 | VCC / + | 3V3 power |
GPIO 4 | DHT11 | DATA / OUT | Digital in/out — a bare four-pin sensor also needs a 10 kΩ pull-up from DATA to 3V3 |
GND | DHT11 | GND / − | Ground |
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 — comparison gesture |
external 5 V | SG90 servo | power (red) | 5V power — separate supply |
GND | SG90 servo | ground (brown) | Ground — join servo and ESP32 grounds |
Unplug USB while rewiring. Never power the servo from ESP32 3V3. Keep the DHT11 away from the warm board, regulator, direct sun, wet leaves, and servo airflow.
- 3V3 power
- Digital in/out
- Ground
- I²C bus
- PWM to actuator
- 5V power
Match the final enclosure and sensor lead arrangement during co-location. Moving only the sensor relative to its own warm electronics would change the instrument as well as the greenhouse.
Give it character
What should two greenhouses agreeing look like?
Romeo might face Juliet across a printed map, turn away as disagreement grows, or use three poses for cooler, similar, and warmer. The unknown pose must remain different from every real comparison.
Your team decides:
- How long and where will the two devices be co-located?
- How will offset, wander, and message age define the agreement band?
- Does the gesture show direction, size, confidence, or a small combination?
- What remains on screen when Juliet is stale or missing?
Write these decisions in plain language before turning them into code. A clear rule is easier to test, explain, and change.
Your field adventure
When do two greenhouses truly disagree?
Begin with the sensors sharing a small, shaded, still-air space. Move Romeo only after the pair’s ordinary disagreement has been measured.
- Meet before the journey.
Co-locate Romeo and Juliet long enough to collect many paired readings in the final enclosures.
- Describe instrument disagreement.
Calculate the usual offset, range of corrected differences, missing readings, and timing mismatch.
- Move one witness.
Place Romeo at one documented greenhouse-2 location without changing its case, lead length, or orientation.
- Compare aligned intervals.
Report corrected greenhouse difference only when both series are fresh, plus one placement or sensor limit.
| Phase / time | Romeo °C | Juliet °C | Raw difference | Corrected difference | Age / placement note |
|---|---|---|---|---|---|
| co-located | ___ | ___ | ___ °C | ___ °C | ___ |
| greenhouse 2 | ___ | ___ | ___ °C | ___ °C | ___ |
| Juliet stale | ___ | last: ___ | not compared | unknown | ___ min old |
When it gets dramatic
A disagreement is the beginning of the question
Romeo is always warmer during co-location
The offset may come from sensor variation or self-heating. Move both sensor heads equally away from their boards, keep the arrangement fixed, and measure again.
The gesture changes when no new Juliet value arrives
Your comparison loop is treating an old message as fresh. Store its arrival time and enter the unknown state after the written limit.
Humidity differs greatly while temperature agrees
DHT11 humidity can vary, respond slowly, and depend on local leaf or soil moisture. Do not copy the temperature offset onto humidity.
Pairs look noisy despite one-minute publishing
Messages are not simultaneous. Match readings within a documented time window or aggregate short intervals before comparing.
Moving Romeo changes its own baseline
Sun, mounting surface, enclosure ventilation, and ESP32 heat are now part of the new placement. Record them instead of calling every change a greenhouse effect.
Choose your direction
What kind of climate-comparison team will you become?
The instrument diplomats
Make co-location, offset, wander, and relative calibration the most careful part of the work.
The time aligners
Explore freshness windows and show how conclusions change when messages are paired loosely or strictly.
The greenhouse storytellers
Choose contrasting fixed placements and explain one persistent difference through the geometry of each house.
Each direction is real engineering. Pick the question that keeps your team curious.
A calm way through the build
Collect four small wins
- ro-01 says hello independently.
Do not subscribe to Juliet yet.
- Romeo publishes believable local temperature and humidity.
Keep the DHT11 away from its warm board.
- Co-located pairs reveal an offset and wander band.
Collect evidence before choosing gesture thresholds.
- The moved device compares only fresh aligned data.
Add unknown handling, servo poses, and the greenhouse investigation.
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.
Greenhouse 2 temperature
garden/greenhouse-2/climate-node/ro-01/temperatureUnit: celsius
Greenhouse 2 humidity
garden/greenhouse-2/climate-node/ro-01/humidityUnit: percent-rh
Listen beyond your own device.
garden/greenhouse-1/climate-node/gm-01/temperatureJuliet is a comparison witness, not Romeo’s sensor. Store the newest value and arrival time, compare only aligned fresh intervals, and give stale or missing data an honest unknown state.
Finish line
Ready to introduce to the garden
ro-01 stays online and publishes its own temperature and humidity once a minute.
The reject feed stays clear after the final code starts.
The device reads Juliet temperature and checks freshness before comparison.
The gesture distinguishes agreement, persistent directional difference, and unknown without blocking messages.
The build log contains co-location, offset, wander, aligned deployed intervals, missing data, corrected difference, and placement limits.
The sensor is separated from self-heating, the servo is safely powered, the enclosure is protected, and the label can be scanned.
Romeo does not prove which greenhouse is better. It gives two places a fair introduction and lets their differences emerge without blaming the instruments too soon.