← Back to the portfolio

The plus

Before the apps, I made the thing that sends the data

This is the half of the trajectory that came first, and the source of everything the other page moves around. I started a level down — firmware, boards, machined parts, and a soil probe designed, routed, machined and buried for two years — and the Apple Developer Academy is where it turned: the same engineering, moved up the stack. These four chapters are still here because knowing what a reading costs before it reaches your app changes how you build the app, and because the two hundred and forty thousand rows in the database chapter came out of a thing like this one.

01 · SILICON AGROM.IO · 2016 – 2019

It starts with a single pin

Long before there is an app, there is a microcontroller deciding — millions of times per second — whether one wire is high or low. Fourteen firmwares taught me that everything above depends on getting this right.

pwm_playground.c

GPIO 2

Perceived brightness 50%
Vavg 1.65 V
analogWrite() 128

What you just learned → You just dimmed an LED without ever changing its voltage. That is PWM: the pin is only ever fully on or fully off — it simply switches faster than your eye can follow.

C/C++ESP32PIC18F4550ATmegaTimers & PWM

02 · COPPER AGROM.IO · 2016 – 2019

Then it needs a board

A schematic is a promise. The PCB is where you keep it. Every board I have fabricated started as this exact puzzle: get every signal where it belongs, on a surface where nothing may cross.

router.pcb

This is not an illustration. It is AGROM.brd, the board I laid out in 2017 for the soil probe — 70 mm across, two copper layers, 54 components — read straight out of the EAGLE file and drawn here. Pick a net and follow it.

View
Layers
Nets
AGROM.IOTX RX GND

top copper bottom copper via AGROM.brd · EAGLE 7.6 · 2017

Segments 754
Layer changes 34
Copper length 1321 mm

Red runs on the top face, blue on the bottom. Every yellow ring is a via: a plated hole where a track drops through to the other side.

What you just learned → Two traces cannot cross on the same layer. That single constraint is the reason real boards have 2, 4, sometimes 12 layers stacked on top of each other.

AltiumEAGLESMD & THTGerberDesign for manufacturing

03 · STEEL AGROM.IO · 2016 – 2019

And a body to survive the field

A sensor buried in wet soil for two years does not care how elegant your firmware is. It cares about the enclosure. So I model it myself — every part, every tolerance, every seal.

soil_probe.sldasm

The assemblies the mechanical project is organised into, one folder each, rebuilt from the drawings they were machined to. Pick one, pull it apart, and read what it is made of.

Product

loading the printed parts…

↔ drag to turn

Pieces
Largest dimension

Turned and cut parts are built from their dimensioned drawings. Printed parts are their real STLs. The arrangement is matched to the 2017 renders, because the SolidWorks assemblies cannot be read.

The giveaway is the folder structure

The mechanical project is not filed by part. It is filed by how each part gets made — which is the difference between modelling something and specifying it.

  • 11 Turning & machining each with a dimensioned drawing
  • 5 Laser cutting flat acrylic, drawn and toleranced
  • 7 3D printing the parts loaded here as STLs
  • 14 Bought in sensors, cells, connectors
  • 1 Cable assembly a four-way loom

16 dimensioned drawings · 82 line items across 7 bills of material

What you just learned → Hardware is the one layer you cannot patch remotely. That is why the mechanical design happens before the first line of firmware, not after.

SolidWorks3D modellingTolerancingIP sealing3D printing

04 · SIGNAL AGROM.IO · 2016 – 2019

Now make a thousand of them talk

One device is a project. A thousand devices is an architecture. MQTT is how they speak without ever knowing one another — and topic wildcards are the whole trick.

broker · mqtt://meneghel.me:8883

A topic is a path. Every device on this farm publishes to one built from the same four levels — so a subscription is really a question about which levels you care about.

1 · site

  • farm
  • home

2 · area

  • greenhouse
  • field
  • office

3 · device

  • soil-1
  • soil-2
  • soil-3
  • pump-1
  • thermostat

4 · reading

  • temp
  • moisture
  • status
  • + matches exactly one level, whatever is in it
  • # matches everything below it, and has to be the last level
SUB

Broker — everything being published

    Your inbox — what reached you

    • nothing matched yet
    delivered 0
    not delivered 0
    topics 0 / 8

    Three subscriptions to get right

    Any filter that selects exactly the right topics counts. There is more than one correct answer to each.

    • Everything the greenhouse publishes — and nothing else. solved
    • Every temperature reading, wherever it comes from. solved
    • Every moisture reading on the farm, but not the one at home. solved

    What you just learned → + matches exactly one level. # matches everything below it. That one rule is how a single broker fans out to thousands of devices without any of them holding a list of the others.

    MQTTMosquittoAWS IoT CoreQoS 0/1/2Pub/Sub

    That is where it started. The work it turned into is on the other page.

    See what I build now →