Clark Farming CompanyField hardware teardown

Hardware teardown

The original Gemini box, wiring decoded

A complete reverse-engineering of a salvaged Gemini Shale tank-volume appliance — every board, every rail, and what each wire actually does.

Platform · Raspberry Pi 3B+ Sensing · ADS1115 ADC Power · 3× CUI DC-DC Display · 800×480 HDMI

What this box is

Before it became a candidate for a Clark Farming Company field station, this enclosure spent its life as a Gemini Shale tank-volume / truck-load meter. Inside is a Raspberry Pi 3B+ that read two analog instruments through an ADS1115 analog-to-digital converter, computed the liquid volume of a tank from its geometry, showed the answer in gallons and barrels on a small kiosk screen, and broadcast the figure over Bluetooth to a phone app. A power tree of three isolated DC-DC converters let the whole thing run from a single, dirty field DC supply, and a Juice4Halt module gave it a clean shutdown when that supply dropped.

Everything below was reconstructed from 13 internal photographs of the open box, cross-checked against the device's own firmware recovered from its SD card. Where the photo and the code agree, confidence is high; where only the code knows (because the field sensors were not attached on the bench), that is called out explicitly.

Compute

Raspberry Pi 3B+ with a stacked ADS1115 ADC HAT, reading analog instruments over I²C.

Power

One 9–36 V feed → fuse → barrier bus → three CUI converters making 5 V and 24 V.

Sensing

An inclinometer (tilt) and a guided-wave radar (level) — the inputs to the volume math.

Interface

An 800×480 HDMI kiosk display, a safe-shutdown button, and Bluetooth to a phone.

Sheet 1 — power distribution

How one rough field supply becomes three clean, isolated rails.

Sheet 1 · Power

Gemini box power distribution A 9 to 36 volt DC field feed passes through an inline fuse to the TS1 and TS2 barrier bus, which feeds three CUI converters in parallel: PS5V at 5 volts to the Raspberry Pi, and PS24V-A and PS24V-B at 24 volts to field-sensor loops that are not wired in the photos. +V (red) return / 0 V (black) Field DC input 9–36 VDC Inline fuse overcurrent Power bus TS1 (+) · TS2 (−) common 9–36 V bus PS5V — 5 V / 4 A CUI PYB20-Q24-S5 PS24V-A — 24 V CUI PDQE6W-Q24-S24 PS24V-B — 24 V CUI PDQE6W-Q24-S24 +5 V +24 V +24 V Raspberry Pi 3B+ + ADC HAT & LCD 24 V field loop A loop-powered sensor 24 V field loop B (field harness) Dashed = not wired in these photos (field sensors / harness absent).

One feed in; three isolated rails out. All three converters share the same raw bus.

The chain, step by step

Field power arrives through a cable gland as a single pair — red positive, black return — at somewhere between 9 and 36 volts DC, the wide range that lets the same box run from a 12 V battery, a 24 V industrial supply, or a solar/battery bank without rewiring. The positive leg passes first through an inline blade-fuse holder, the single point of overcurrent protection for everything downstream.

From the fuse, power lands on a pair of barrier terminal strips, TS1 and TS2, jumpered into two continuous rails: TS1 is the positive bus, TS2 is the return. This bus is simply a distribution manifold — every converter taps the same raw voltage from it in parallel. There is no regulation here; the converters do that individually.

Three CUI Inc. DC-DC converters hang off the bus, each isolated and each making its own clean output:

One important honesty note, visible in every photo: the 24 V outputs land on bare green terminals. On the bench, with no tank, no radar and no inclinometer attached, those rails go nowhere — which is exactly what you would expect for a box pulled from storage. The diagram draws those loads dashed for that reason.

Power wiring — every conductor
WireFrom → toCarriesColour
Feed +Gland → fuse → TS1 busUnregulated +9–36 VDCred
Feed −Gland → TS2 busSupply return / 0 Vblack
Bus → PS5VTS1/TS2 → PS5V Vin/GNDRaw +9–36 V inred / black
Bus → PS24V-ATS1/TS2 → PS24V-A Vin/GNDRaw +9–36 V inred / black
Bus → PS24V-BTS1/TS2 → PS24V-B Vin/GNDRaw +9–36 V inred / black
PS5V outPS5V +Vo/0V → Pi 5 V / GNDRegulated +5 V (Pi + HAT + LCD)red / black
PS24V-A outPS24V-A +Vo/−Vo → green terminal+24 V loop supply A — bare on benchred / black
PS24V-B outPS24V-B +Vo/−Vo → green terminal+24 V loop supply B — bare on benchred / black

Sheet 2 — signal, control & I/O

What the Pi reads, how it shuts down safely, and how it talks to the world.

Sheet 2 · Signal & I/O

Gemini box signal, control and I/O The Raspberry Pi reads the ADS1115 ADC over I2C. The ADC's analog inputs P0 and P1 come from the inclinometer and P2/P3 differential from the guided-wave radar across a 5 ohm shunt, both absent in the photos. The Juice4Halt UPS and a shutdown button use GPIO lines; the Pi drives an HDMI LCD and reaches the world by Ethernet and onboard Bluetooth. digital (I²C / HDMI) +5 V network / RF analog signal — sensor absent in photos GPIO control GWR level 4–20 mA Tilt DAS-10A X / Y Juice4Halt UPS safe shutdown Shutdown button hold 3 s Raspberry Pi 3B+ system controller ADS1115 ADC HAT 4-ch 16-bit · I²C I²C P2/P3·5Ω P0/P1 GPIO22/25 GPIO26 HDMI 5 V BLE Ethernet (RJ45) LAN · DHCP 800×480 HDMI LCD non-touch kiosk Bluetooth onboard → phone app Dashed teal = firmware-intended analog wiring; the inclinometer and radar are not present in these photos.

The Pi at the centre: analog in from the right, control on the left, display and connectivity below.

The analog signal path

The Pi has no analog inputs of its own, so it reads the instruments through a stacked ADS1115 — a 4-channel, 16-bit analog-to-digital converter, sold here as a red HAT silk-screened "4 CH 16bit ADC with PGA for RPi". It connects to the Pi over the I²C bus (two data lines, SDA and SCL, plus power and ground) through the 40-pin header. The green screw terminals visible on the red board are not the Pi connection — they are where the field signals land.

The firmware tells us exactly how the channels are mapped:

With tank geometry entered once (diameter, length, end-cap shape, sensor positions), the Pi turns "how tilted is the tank" plus "how high is the liquid" into a precise gallon and barrel figure. Because the sensors were not connected on the bench, these three rows are the intended wiring proven by the code, not something visible in the photos.

Safe shutdown — the part that matters off-grid

A Raspberry Pi hates losing power mid-write; do it enough times in the field and the SD card corrupts. The Juice4Halt module solves this. It sits on the GPIO header and uses two lines:

Separately, a panel-mounted momentary button on GPIO26 lets a person request a clean shutdown by holding it for three seconds — no SSH, no screen needed.

Display and connectivity

The Pi drives an 800×480 HDMI LCD over a standard HDMI cable for video, with a separate 5 V lead for the panel's own power; it is a non-touch kiosk display. For data off the box, the original Gemini design leaned on onboard Bluetooth, advertising the current truck/tank volume to a phone app; an Ethernet (RJ45) port was available on the LAN as well. Notably, no industrial protocol — no Modbus, no WirelessHART — appears anywhere in the original firmware; that is a Clark Farming Company addition in the box's second life.

Signal, control & connectivity wiring
LinkFrom → toCarriesBasis
I²CPi GPIO2/3 → ADS1115Digitised sensor readingsseen
HAT powerPi 3V3/5V/GND → ADS1115Logic power + referenceseen
Analog P0Inclinometer pitch → ADC P0Tilt voltage (2.5 V = level)code
Analog P1Inclinometer roll → ADC P1Tilt voltagecode
Analog P2/P3Radar → ADC P2/P3 across 5 Ω4–20 mA → 20–100 mV levelcode
HDMIPi HDMI → LCD800×480 videoseen
GPIO25Pi ↔ Juice4HaltBoot / shutdown handshakecode
GPIO22Pi ↔ Juice4HaltInput-power-fail detectcode
GPIO26Button → Pi (other side GND)Hold 3 s → power offseen
EthernetPi RJ45 → LANNetwork (DHCP)seen
BluetoothPi radio → phone appVolume readout (original egress)code

Bill of materials

Every part, with the marking actually read off it where legible.

RefComponentPart / markingJobBasis
PiRaspberry Pi 3B+Controller, Bluetooth, kioskseen
ADCADS1115 ADC HAT4 CH 16bit ADC with PGA for RPiAnalog → I²Cseen
PS5VCUI DC-DC converterPYB20-Q24-S5 · 9–36 V → 5 V/4 APi 5 V railseen
PS24V-ACUI DC-DC converterPDQE6W-Q24-S24-T · 9–36 V → 24 V/250 mAField loop supply Aseen
PS24V-BCUI DC-DC converterPDQE6W-Q24-S24-T · 9–36 V → 24 V/250 mAField loop supply Bseen
TS1 / TS2Barrier terminal stripsjumpered + / − railsRaw-DC distribution busseen
FUSEInline blade-fuse holderrating not legibleInput overcurrent protectionseen
LCD800×480 HDMI displaynon-touchOn-box readoutseen
J4HJuice4Halt UPSSafe shutdown (GPIO22/25)inferred
BTNMomentary push-buttonpanel-mountManual shutdown (GPIO26)seen
INCLDAS-10A inclinometernot in photosPitch / roll tiltcode
GWRGuided-wave radar (4–20 mA)not in photosLiquid levelcode

A note on the GPIO stack

The Pi's 40-pin header carries more than one board. The red ADS1115 HAT sits at the top, and underneath it — in several of the photos — there is a second green board with a distinctive circular silk-screen pattern. The most likely identity is the Juice4Halt module itself: that circular footprint is consistent with its hold-up supercapacitor, and it would explain why no separate Juice4Halt board appears anywhere else, and why the GPIO22/25 shutdown lines have somewhere to land. The silk-screen text was not legible in any frame, so this is the one structural detail held at "inferred" rather than confirmed — popping the stack and reading the label would settle it.

How we know — and what we don't

Each claim above is tagged by its evidence: seen means it is legible or visible in the photographs; code means it is proven by the device's own firmware (the intended wiring, even where the part was not on the bench); inferred means it is the best reading but not conclusive. The component identifications were cross-checked by independent review passes over the photographs before being committed here.

Open questions worth a second look

  1. The green board in the GPIO stack is probably the Juice4Halt, but its label is unreadable — confirm by inspection.
  2. The inline fuse rating is not legible; read it off the holder before reusing the box.
  3. PS24V-A and PS24V-B are identical 24 V rails — whether they are redundant or feed two separate loops can't be told from the hardware alone.
  4. The inclinometer, the radar, the 5 Ω shunt and the 24 V loop landings are not present in these photos, so those parts of the diagram reflect the firmware's intent, not a photographed harness.
  5. A loose green USB board and a USB cable appear in one frame; their function (hub, serial adapter, or sensor interface) is unidentified and outside the core signal path.