Wire and debug a Raspberry Pi rig that records plant leaf voltage

Tomohiro Mori had Codex draw breadboard wiring, write the Pi's logging program and trace out-of-range readings to one missing jumper wire, then plot the first 15 minutes of a lettuce's voltage.

Done withCodex· Oct 20, 2026

What they did

Mori is running a home experiment to see whether a red leaf lettuce on the balcony gives off voltage signals that track its condition. Silver-wire electrodes sit on two leaves and feed a resistor circuit on a breadboard into a Waveshare high-precision AD HAT on a Raspberry Pi 5. Codex looked up the hardware and drew a diagram down to the breadboard hole for every resistor and wire. It also wrote the program on the Pi that samples and saves the readings. Codex runs on Mori's Windows laptop and connects to the Pi over the home Wi-Fi, so it can check the running logger, fetch the files and analyse them without Mori copying output by hand.

How it went

The first recording looked like it was running but was not usable. Codex found that the board talked fine but kept flagging inputs outside its allowed range, even at the lowest gain. It worked out that the high-value resistors were letting the electrode voltages drift from the reference and suggested tying one electrode straight to the reference. That was one extra jumper wire, and Codex redrew the diagram to show it. After the change there were no board warnings in the first five minutes or so, with no new parts bought. Codex then plotted roughly 15 minutes of data four ways. What the signal means is still open.

Worth knowing

Letting the Pi only record and keeping the agent on a laptop that reaches it over the network kept the small computer free for measurement. A differential reading between two electrodes also has to keep each electrode within the ADC's input range against ground, which is what the fix addressed. This is part 3 of a series; there is no finding about plants yet.

Try it

With Codex· 7 parts to fill in

I am building a sensor rig: [sensor or electrodes] into [ADC board] on [Raspberry Pi model], on a solderless breadboard. Look up the parts and draw a wiring diagram that names the exact breadboard hole for each component and wire. Then write a program on the Pi that samples the signal every [interval] and saves it to [folder]. Connect to the Pi from this machine over [SSH or the home network] to check it is running. If the readings look wrong, read the board's status flags and settings before guessing, and tell me any wiring change you want before I power anything back on. Stop after you have plotted the first [minutes] of valid data.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related