Why Aquaponics in an NYC Apartment?
New York City apartments are not the first place you think of for farming. But with produce prices climbing and the desire for hyper-local food growing, I wanted a system that could give me fresh greens and fish protein without a backyard. Aquaponics — the symbiosis of aquaculture (fish farming) and hydroponics (soil-less plant growing) — was the answer. The challenge: I have no engineering background, no coding skills, and about four square feet of free counter space.
Enter vibe coding. The term, popularized by AI researcher Andrej Karpathy in early 2025, describes letting large language models write code from natural language instructions. You just describe what you want, the AI generates it, you copy-paste, iterate. I decided to use this approach to design and automate my own apartment aquaponics setup — and it worked.
The Problem: Manual Maintenance is a Drag
My first attempt was a kit I ordered online. It worked for two months. Then I killed my first batch of tilapia because I forgot to test the ammonia level. The pH drifted, the pump clogged, and the lettuce turned yellow. I needed real‑time monitoring and automated adjustments. But hiring a programmer or buying an off‑the‑shelf controller would eat my entire project budget.
I had heard stories of people using ChatGPT to write scripts for IoT sensors. I decided to try the vibe coding method: talk to the AI, get code, test it, and repeat.
The Vibe Coding Approach
I opened Claude 3.5 Sonnet and typed:
"Write MicroPython code for a Raspberry Pi Pico W that reads a pH probe (DIY circuit with MCP3208 ADC) and a DS18B20 temperature sensor. Send the data via MQTT to a local server. Also control a peristaltic pump to dose pH up/down when pH exceeds 6.0 or 7.5."
Claude returned a working skeleton. I pasted it into Thonny, adjusted a few pins, and had live sensor readings in an hour. Every time I hit a bug, I pasted the error message back into the AI chat. It fixed the code line by line. Within a week I had a fully functional controller.
System Design and Components
My final setup fits on a 24"x18" steel shelf in my kitchen. Here are the components I used:
| Component | Purpose | Cost (approx.) |
|---|---|---|
| 20‑gallon glass aquarium | Fish tank (4 fancy goldfish) | $60 (used) |
| 15‑gallon plastic tote | Sump / grow bed | $25 |
| Submersible pump (200 gph) | Water circulation | $30 |
| PVC pipes and fittings | Standpipe, drains | $20 |
| LECA clay pebbles | Grow media (about 1 cubic ft) | $15 |
| Raspberry Pi Pico W | Microcontroller | $15 |
| DS18B20 temperature sensor | Monitor tank temp | $5 |
| DIY pH sensor (using pH‑4502 module) | Monitor water acidity | $12 |
| Two‑channel relay module | Control pump and dosing pumps | $8 |
| Two small peristaltic dosing pumps | Add pH up/down solution | $40 (pair) |
| Total | ~$230 |
The plants: I grow basil, lettuce, kale, and mint. They feed on the fish waste converted to nitrates by beneficial bacteria. The goldfish eat fish food — I lose about $5/month on feed.
Automation Stack
The brain of the system is the Raspberry Pi Pico W. I use a simple MQTT broker (Mosquitto on a free Oracle Cloud VM) to store sensor data. A Node‑RED dashboard on my phone shows real‑time pH, temperature, and pump status. When pH drops below 6.0, the AI‑generated code triggers a relay that pulses the pH up pump for 3 seconds. If temperature exceeds 85°F, the Pi sends me a Telegram alert so I can add ice bottles.
I also coded an alert for low water level using a float switch. Everything was written conversationally with Claude and then lightly edited manually. ASI Biont supports connecting to Telegram via API for notifications — see asibiont.com/courses.
Results and Data
After three months of operation (May–July 2026), I harvested 2.5 pounds of lettuce, 1 pound of basil, and 0.5 pounds of kale — that's about $40 worth of organic greens at NYC farmer's market prices. The goldfish are healthy; I lost none. The system required about 15 minutes of maintenance per week: cleaning the pre‑filter, checking pH calibration, and feeding fish.
Energy consumption: the pump runs 24/7 and draws 10W. The Pi draws about 0.5W. Total monthly electricity cost: roughly $1.50.
Most importantly, the vibe coding approach meant I could iterate fast. When I wanted to add an automatic feeding timer, I simply said, "Add a function that triggers a relay for 2 seconds every 12 hours at 8am and 8pm." The AI wrote it. No Stack Overflow, no scrolling forums.
Lessons Learned for Aspiring Aquaponicists
- Start with hardy fish — Goldfish tolerate pH swings better than tilapia or trout. They are also legal to keep in NYC apartments (no permit needed for ornamental fish).
- Don't over‑dimension the pump — A 200 gph pump moves twice the tank volume per hour, which is enough for a vertical grow bed.
- Cycling is boring but vital — Before adding fish, run the system for 3‑4 weeks to establish the nitrogen cycle. Use a liquid test kit (API Master Kit) to monitor ammonia and nitrite.
- Vibe coding is not a crutch — You still need to understand basic electronics (pins, power, ground) and the feedback loop of debugging. But the AI reduces the cognitive load by 80%.
- Keep a backup — Write your code to a file and version it. Once, the Pi lost power and I had to re‑flash the firmware. The AI regenerated the same code in seconds.
Is It Worth It?
Financially, the system pays for itself in about a year if you regularly buy organic greens. But the real value is the satisfaction of eating micro‑bright lettuce that traveled two feet from plant to plate. And the geek factor of having a Telegram bot that tells you "Your fish are happy" every morning.
For NYC apartment dwellers, aquaponics + vibe coding is a killer combo. You don't need a green thumb or a degree in computer science. You just need a digital assistant that understands your messy requests and turns them into working code.
Final Note
If you try this, remember that every city has different building codes and fish regulations. New York City Fire Department does not restrict small aquariums, but check your lease about water fixtures. I chose goldfish because they are exempt from state invasive species permits. Always consult the NYS Department of Environmental Conservation and your building's superintendent before setting up.
The future of urban agriculture is small, smart, and code‑driven. And vibe coding is making it accessible to anyone with a vision and a chat window.
Comments