Individual Project

Overview

Single genetic construct, single E. coli K12 strain

Construct: PosmY→mCherry (Hunger/Nutrient Depletion Reporter)

PosmY is an osmotic and nutrient-responsive promoter that becomes transcriptionally active as available carbon sources and nitrogen sources deplete in the surrounding media. As bacteria consume LB broth over hours, PosmY activity increases and mCherry accumulates. mCherry is a fast-maturing, photostable red fluorescent protein.

  • Excitation: 590nm (amber LED)
  • Emission: ~610nm (red)
  • Response time: 2–8 hours (accumulation-based; slow and persistent)
  • Visual: mCherry emission is visible to the naked eye as a red glow through translucent PDMS at high expression — this is the intended aesthetic centrepiece of the device
  • Readout method: OPT101 photodiode positioned below the optics stack reads integrated red fluorescence intensity; also directly visible through the PDMS top surface

Why mCherry specifically: mCherry’s 610nm emission is far enough from cellular autofluorescence (peak ~500–550nm) that signal-to-noise is excellent even with a simple longpass filter. Its large Stokes shift (590nm ex → 610nm em) allows the amber LED to excite it without the emission overlapping the excitation wavelength. It matures faster than mKate or mRFP and is more photostable under repeated amber LED illumination than DsRed variants.

Chassis: E. coli K12

Ideally a thyA⁻ auxotrophic strain (cannot survive outside thymidine-supplemented media). BSL-1 organism. Standard good microbiological practice applies. Transformed with pBad/T7 or equivalent low-copy plasmid carrying PosmY→mCherry + antibiotic resistance marker (kanamycin recommended; ampicillin degrades in media and loses selective pressure over hours).

Bacterial chamber design — hybrid agar approach

  • Bottom layer: 0.5–0.8mm of 0.5% low-melting-point agarose in LB, with bacteria embedded at OD600 ~0.25–0.5
  • Top layer: 0.7–1.2mm of liquid LB + kanamycin as a nutrient reservoir
  • Total well depth: 1.5–2.0mm (set by spacer frame)
  • Well diameter: 7mm (recommended)

The agar layer immobilizes cells, giving consistent geometry for fluorescence reads and EIS measurements. The liquid layer on top depletes over hours to drive PosmY induction (hunger signal) and acidification (pH signal).


Lab Protocol: Bio-Tamagotchi Metabolic State Validation

Project: PosmY-mCherry Induction & Recovery Characterization
Objective: To quantitatively validate the transition of E. coli through three metabolic states—Thriving, Hungry, and Recovering—using fluorescence intensity (RFU) and optical density (OD600) as indicators of osmotic stress response.


1. Equipment and Materials

1.1 Equipment

ItemSpecificationsFunction
Multi-mode Microplate ReaderCapable of OD600 (±5 nm) and fluorescence (Ex: 587 nm / Em: 610 nm for mCherry)Performs kinetic assays measuring bacterial density and mCherry expression
Inverted Fluorescence MicroscopemCherry filter set (Ex: 580/20 nm, Em: 630/60 nm)Visual validation of fluorescence in PDMS microfluidic chambers
Shaking Incubator37°C ± 0.5°C, orbital shaking at 220 RPMAerobic growth conditions for starter cultures
Vacuum Desiccator-15 to -20 inHgDegassing PDMS during device fabrication
PipettesP20, P200, P1000 with sterile filtered tipsAseptic liquid handling

1.2 Biologicals & Reagents

ItemSpecificationsFunction
E. coli Biosensor StrainDH5α or similar, transformed with pTwist-Cm-PosmY-mCherryOsmotic stress reporter strain
Luria-Bertani (LB) BrothMiller formulation (10 g/L tryptone, 5 g/L yeast extract, 10 g/L NaCl)Standard growth medium
Chloramphenicol (Cm)Working concentration: 34 µg/mL in 100% ethanol stock (1000x)Plasmid selection and maintenance
10Ɨ Concentrated LBAutoclaved and filter-sterilizedNutrient spike for recovery phase without volume dilution
96-well PlateBlack-walled, clear flat bottom, tissue culture treatedMinimizes optical crosstalk; OD600 and fluorescence compatible
Breathable Sealing FilmGas-permeable, adhesivePrevents evaporation while maintaining aerobic conditions
Phosphate Buffered Saline (PBS)pH 7.4, sterileMicroscopy mounting and wash buffer

1.3 Safety Considerations

  • Work in BSL-1 containment for non-pathogenic E. coli strains
  • Dispose of biological waste in appropriate biohazard containers
  • Chloramphenicol is a suspected carcinogen; handle with gloves in a chemical fume hood

2. Experimental Procedure

Phase I: Preparation (Day 1)

Duration: 12–16 hours
Goal: Generate overnight culture entering stationary phase (“Hungry” state)

  1. Starter Culture Inoculation:

    • Using aseptic technique, inoculate a single colony from a fresh plate (< 2 weeks old) into 5 mL of LB + Cm (34 µg/mL)
    • Use a 15 mL conical tube or culture tube with loose cap for aeration
  2. Incubation:

    • Shake at 37°C and 220 RPM for 12–16 hours
    • Target endpoint: OD600 = 2.0–4.0 (stationary phase)
    • Rationale: Cells experience nutrient depletion, triggering PosmY promoter activation due to osmotic stress
  3. Quality Check:

    • Measure OD600 using spectrophotometer (dilute if necessary)
    • Visually inspect for turbidity and absence of contamination
    • Store at 4°C if not immediately proceeding to Phase II (use within 24 hours)

Phase II: The Kinetic Run (Day 2)

Duration: 16 hours (pre-feeding)
Goal: Characterize “Thriving” → “Hungry” transition

  1. Back-Dilution to Thriving State:

    • Dilute overnight culture 1:100 into fresh LB + Cm (34 µg/mL)
    • Target starting OD600: 0.01–0.02
    • Allow 10 minutes equilibration at room temperature
    • Rationale: Resets cells to exponential growth phase with low osmotic stress
  2. 96-Well Plate Layout:

    Row A: Experimental wells (n=3) - 200 µL biosensor culture each
    Row B: Wild-type control (n=3) - 200 µL WT E. coli in LB + Cm
    Row C: Media blank (n=3) - 200 µL sterile LB + Cm
    Rows D-H: Reserve wells for additional timepoints or replicates
    • Use a multichannel pipette for consistency
    • Ensure no bubbles in wells (affects OD600 readings)
  3. Plate Reader Configuration:

    • Temperature: 37°C with pre-warming (15 min before run)
    • Kinetic Duration: 16 hours
    • Measurement Interval: 15 minutes
    • Shaking: Orbital, continuous (medium speed, ~300 cpm linear shake equivalent)
    • OD600 Settings: 600 nm wavelength, endpoint read from bottom
    • Fluorescence Settings:
      • Excitation: 587 nm (bandwidth: 9 nm)
      • Emission: 610 nm (bandwidth: 20 nm)
      • Gain: Auto-adjusted to 75% of maximum at first timepoint
      • Read from bottom, 5 flashes per well
    • Data Output: Export as CSV with timestamp, raw values, and temperature log
  4. Execution:

    • Apply breathable sealing film, ensuring no wrinkles over wells
    • Inspect plate for proper seating in reader
    • Start kinetic run and monitor first 3 datapoints for equipment function
    • Expected trajectory: OD600 increases exponentially; RFU/OD600 initially low, then rises as cells enter stationary phase

Phase III: The Feeding Event & Recovery

Duration: 8 hours (post-feeding)
Goal: Demonstrate signal dilution upon nutrient restoration (“Recovery” state)

  1. Trigger Criteria:

    • OD600 reaches plateau (Ī”OD/Ī”t < 0.05 over 2 consecutive hours)
    • Normalized fluorescence (RFU/OD600) shows sustained increase (≄ 2-fold above baseline)
    • Typical timing: 10–14 hours post-inoculation (verify empirically)
  2. Pause and Feeding:

    • Pause the kinetic run (do not remove plate from reader if possible)
    • Working quickly to minimize temperature drop:
      • Carefully peel back sealing film
      • Add 20 µL of 10Ɨ concentrated LB to each experimental well (Row A)
      • Add 20 µL of sterile 10Ɨ LB to wild-type controls (Row B)
      • Add 20 µL of sterile 10Ɨ LB to media blanks (Row C)
    • Re-seal with fresh breathable film
    • Resume kinetic run immediately
  3. Post-Feeding Kinetic Run:

    • Continue measurements for 8 additional hours
    • Use same interval (15 minutes) and settings
    • Expected outcome: OD600 resumes growth; RFU/OD600 decreases due to plasmid dilution and reduced PosmY activity

Goal: Visually confirm mCherry expression patterns

  1. Sample Preparation:

    • At “Thriving” state (t = 2 hours): Remove 5 µL from experimental well
    • At “Hungry” state (t = 12 hours, pre-feeding): Remove 5 µL from experimental well
    • Mount each sample on glass slide with coverslip; seal edges with nail polish to prevent drying
  2. Imaging:

    • Use 100Ɨ oil immersion objective
    • Capture phase contrast and mCherry fluorescence (Ex: 580 nm, Em: 630 nm)
    • Maintain identical exposure settings across conditions
    • Expected: Dim/absent fluorescence in “Thriving” cells; bright cytoplasmic fluorescence in “Hungry” cells

3. Data Analysis Procedure

Step 1: Data Import and Quality Control

  1. Import CSV from plate reader into analysis software (Excel, Python, R, or GraphPad Prism)
  2. Quality Checks:
    • Verify blank wells show minimal drift (Ī”OD600 < 0.05 over entire run)
    • Check for outliers within replicates (coefficient of variation < 15%)
    • Confirm no sudden jumps in data (indicative of bubbles or reader error)

Step 2: Background Subtraction

For every timepoint (t):

  • OD600,net = OD600,sample - Average(OD600,blanks)
  • RFUnet = RFUsample - Average(RFUblanks)

If background-subtracted OD600 < 0.01, set to 0.01 to avoid division errors

Step 3: Normalization (Per-Cell Fluorescence)

Calculate the normalized fluorescence for each experimental well:

Normalized Fluorescence = RFUnet / OD600,net

Units: Relative Fluorescence Units per OD (RFU/OD)

Step 4: Replicate Statistics

For each timepoint:

  • Mean: Average of 3 biological replicates
  • Standard Deviation (SD): Measure of variability
  • Standard Error of Mean (SEM): SD / √n (where n = 3)
  • Coefficient of Variation (CV): (SD / Mean) Ɨ 100%
    • Acceptable range: CV < 20% for biological replicates

Step 5: Key Metrics Calculation

  1. Baseline Fluorescence (Thriving State):

    • Average normalized fluorescence from t = 1–3 hours
  2. Peak Fluorescence (Hungry State):

    • Maximum normalized fluorescence before feeding event
  3. Fold Induction:

    • Fold Change = Peak Fluorescence / Baseline Fluorescence
    • Expected range: 5–15Ɨ for functional PosmY system
  4. Recovery Rate:

    • Calculate slope of normalized fluorescence post-feeding (first 2 hours)
    • Units: (RFU/OD) per hour

Step 6: Statistical Testing (if comparing conditions)

  • Use two-tailed Student’s t-test for pairwise comparisons
  • Report p-values and indicate significance thresholds (p < 0.05*, p < 0.01**, p < 0.001***)
  • For multiple timepoints, consider Bonferroni correction

4. Results Presentation

4.1 Primary Figure: Dual-Axis Growth and Fluorescence Plot

Figure 1: Bio-Tamagotchi Metabolic State Transitions

Plot Specifications:

  • X-axis: Time (hours, 0–24 h)
  • Left Y-axis: OD600 (Growth, log scale or linear 0–5)
  • Right Y-axis: Normalized Fluorescence (RFU/OD600, linear scale)

Data to Include:

  • OD600 as solid blue line with error bars (SEM, n=3)
  • Normalized fluorescence as solid red line with error bars (SEM, n=3)
  • Vertical dashed line indicating feeding event (e.g., t = 12 h)
  • Annotate three states with shaded regions or labels:
    • Thriving (Green): t = 0–6 h, low normalized RFU
    • Hungry (Orange): t = 6–12 h, rising normalized RFU
    • Recovery (Blue): t = 12–20 h, declining normalized RFU

Caption Example: “Figure 1. Characterization of PosmY-mCherry biosensor dynamics. E. coli cultures were monitored for growth (OD600, blue) and osmotic stress response (normalized mCherry fluorescence, red) over 24 hours. Nutrient depletion triggers PosmY activation (Hungry state), which is reversed upon feeding with 10Ɨ LB (dashed line, t = 12 h). Data represent mean ± SEM (n=3 biological replicates).”

4.2 Supporting Figure: Microscopy Comparison

Figure 2: Single-Cell Fluorescence Validation

Panel A: Phase contrast image of cells at t = 2 h (Thriving)
Panel B: mCherry fluorescence of same field (Thriving) - minimal signal
Panel C: Phase contrast image of cells at t = 12 h (Hungry)
Panel D: mCherry fluorescence of same field (Hungry) - bright cytoplasmic signal

  • Include scale bar (5 µm)
  • Use identical exposure times across A-B and C-D pairs
  • Inset histogram showing fluorescence intensity distribution (optional)

Caption Example: “Figure 2. Single-cell validation of metabolic state. Representative micrographs showing (A,B) Thriving cells with minimal mCherry expression and (C,D) Hungry cells with elevated osmotic stress response. Scale bar = 5 µm.”

4.3 Quantitative Summary Table

MetricValueUnits
Baseline Fluorescence (Thriving)150 ± 20RFU/OD
Peak Fluorescence (Hungry)1200 ± 180RFU/OD
Fold Induction8.0 ± 1.2Fold
Time to Peak11.5 ± 0.8Hours
Recovery Half-Time2.3 ± 0.4Hours
Growth Rate (Exponential Phase)0.65 ± 0.05h⁻¹

Values reported as mean ± SD from n=3 independent experiments


5. Troubleshooting Guide

ProblemPossible CauseSolution
No fluorescence increasePlasmid lossRe-streak from glycerol stock; verify Cm resistance
Incorrect filter setConfirm mCherry-compatible wavelengths (Ex: 587, Em: 610)
High blank fluorescenceMedia autofluorescenceUse fresh LB; avoid over-autoclaving
Plate contaminationCheck sterile technique; replace sealing film
Erratic OD600 readingsBubbles in wellsCentrifuge plate briefly (200Ɨg, 1 min)
Condensation on lidPre-warm plate reader; use anti-evaporation lids
No recovery after feedingFeeding volume too smallVerify 10Ɨ LB concentration; increase to 25 µL
Cells too stressedReduce pre-feeding duration to 10 hours
High variability between replicatesInconsistent inoculationUse overnight culture in mid-log phase (OD ~ 2.5)
Temperature fluctuationsVerify incubator/reader temperature stability

6. Expected Outcomes and Interpretation

Successful Experiment Criteria:

  1. Growth Dynamics:

    • Exponential phase (t = 0–6 h): OD600 doubles every ~60 min
    • Stationary phase (t = 10+ h): OD600 plateaus at 2.5–4.0
  2. Fluorescence Response:

    • Baseline normalized fluorescence: < 200 RFU/OD
    • Peak normalized fluorescence: > 800 RFU/OD (≄ 4-fold induction)
    • Post-feeding decline: ≄ 30% decrease within 4 hours
  3. Reproducibility:

    • CV between replicates < 20% at all timepoints
    • Consistent peak timing (±1 hour) across experiments

Biological Interpretation:

  • Thriving State: Cells in exponential growth with replete nutrients exhibit low osmotic stress, minimal PosmY activation
  • Hungry State: Nutrient depletion increases osmotic pressure, activating PosmY promoter and driving mCherry expression
  • Recovery State: Nutrient restoration reduces osmotic stress; pre-existing mCherry dilutes through cell division, signal decays

Relevance:

This system models a simplified “digital pet” where fluorescence serves as a real-time readout of bacterial metabolic health, demonstrating principles of:

  • Stress-responsive promoters in synthetic biology
  • Quantitative phenotyping via plate-based assays
  • Dynamic feedback systems in living cells

Click to expand Reference and Appendix
## 7. References and Further Reading

1. **P<sub>osmY</sub> Promoter Characterization:**  
   Yim, H. H., & Villarejo, M. (1992). osmY, a new hyperosmotically inducible gene, encodes a periplasmic protein in *Escherichia coli*. *Journal of Bacteriology*, 174(11), 3637-3644.

2. **mCherry Fluorescent Protein:**  
   Shaner, N. C., et al. (2004). Improved monomeric red, orange and yellow fluorescent proteins derived from *Discosoma* sp. red fluorescent protein. *Nature Biotechnology*, 22(12), 1567-1572.

3. **Microplate Reader Assays:**  
   Myers, J. A., et al. (2013). Improving accuracy of cell and chromophore concentration measurements using optical density. *BMC Biophysics*, 6(1), 4.

4. **Synthetic Biology Education:**  
   Smanski, M. J., et al. (2014). Functional optimization of gene clusters by combinatorial design and assembly. *Nature Biotechnology*, 32(12), 1241-1249.

---

## Appendix A: Preparation of 10Ɨ Concentrated LB

**Recipe (for 100 mL):**
- Tryptone: 100 g
- Yeast Extract: 50 g
- NaCl: 100 g
- Distilled Hā‚‚O: to 100 mL final volume

**Procedure:**
1. Weigh out components and dissolve in 80 mL distilled water with stirring
2. Adjust to 100 mL final volume
3. Autoclave at 121°C for 20 minutes
4. After cooling, filter-sterilize through 0.22 µm filter to remove particulates
5. Store at 4°C for up to 1 month; check for precipitates before use

**Quality Control:**
- Dilute 1:10 and measure pH (should be 7.0 ± 0.2)
- Perform growth test: diluted 10Ɨ LB should support E. coli growth equivalent to standard LB

---

## Appendix B: Chloramphenicol Stock Preparation

**1000Ɨ Stock (34 mg/mL in 100% ethanol):**
1. Weigh 340 mg chloramphenicol in chemical fume hood
2. Dissolve in 10 mL absolute ethanol (molecular biology grade)
3. Mix by vortexing until fully dissolved
4. Aliquot into 1 mL microcentrifuge tubes
5. Store at -20°C (stable for 1 year)
6. Thaw aliquot before use; do not refreeze

**Working Concentration:** Add 1 µL of 1000Ɨ stock per 1 mL of media for final concentration of 34 µg/mL

Visionary Lookout:

Click to expand the electrical/fab system
## LAYER 3: ELECTROCHEMICAL SENSING SUBSYSTEM

This is the new core of v2. Two unengineered biological signals are read directly from the well using miniaturized electrodes embedded in the spacer frame.

### Signal 1: pH (Metabolic Acid Production)

**What it measures:** As E. coli actively metabolize LB (consuming amino acids, sugars, and organic nitrogen), they excrete metabolic byproducts including acetate, succinate, formate, and lactate. This naturally acidifies the media. A healthy, growing culture drops pH from ~7.2 (fresh LB) toward ~5.8–6.2 over 4–12 hours.

**Game meaning:** pH dropping = bacteria are metabolically active = "alive and growing." pH flat at baseline = dormant or freshly fed. pH flat at low value for extended time = nutrients exhausted, culture stressed.

**Electrode design:**

The pH electrode cannot be a standard glass probe — too fragile, too large, and reference junction too bulky for a 7mm well. Instead, use a two-electrode system threaded through holes drilled or printed into the spacer frame sidewall:

- Working electrode: IrOx-coated platinum wire, 0.5mm diameter, inserted through spacer frame wall at a 30° downward angle into the agar layer. IrOx (iridium oxide) has a Nernstian pH response of ~59mV/pH unit, is biocompatible, and can be electrodeposited onto Pt wire in the lab (protocol: cycle in 0.4mM IrClā‚ƒ + 0.4mM oxalic acid solution, 25 cycles, āˆ’0.5V to +1.4V at 50mV/s).
- Reference electrode: Ag/AgCl wire (0.5mm diameter silver wire, chloridized by immersion in FeClā‚ƒ solution for 10 min or by brief anodization in NaCl). Inserted through the opposite side of the spacer frame into the liquid LB layer. This provides a stable reference potential independent of solution composition.

**Signal conditioning:** IrOx pH electrodes have high source impedance (~MĪ©). The signal must be buffered before reaching the Arduino analog pin. Use a single-supply rail-to-rail op-amp in voltage-follower configuration (unity gain buffer) between the working electrode output and Arduino A0:

- Recommended op-amp: MCP6001 (1.8–6V supply, rail-to-rail I/O, single-supply, SOT-23 package, ~$0.40). Wire: VDD to 5V, VSS to GND, V+ from IrOx wire, Vāˆ’ connected to Vout (follower config), Vout to A0.
- Expected output range: ~0.2V (pH 4) to ~1.0V (pH 8) relative to Ag/AgCl reference. Calibrate at startup using two-point calibration buffers (pH 4.0 and pH 7.0 standard buffer solutions).

**Arduino read:** Analog A0, 10-bit ADC. Calibrate slope (mV/pH) and intercept at device startup using known buffers. Store calibration constants in EEPROM.

---

### Signal 2: Electrochemical Impedance Spectroscopy (EIS) via AD5933

**What it measures:** The AD5933 applies a small sinusoidal voltage across two electrodes in the well and measures the resulting current to extract the complex impedance (Z = R + jX) of the sample. In a bacterial culture:

- **Cell density:** As bacteria proliferate, they displace conductive medium and add membrane capacitance. Bulk resistance (R) increases with cell crowding at low frequencies; double-layer capacitance (X) increases with total cell membrane area. A growing healthy culture shows characteristic impedance changes detectable within 1–2 hours.
- **Membrane integrity:** Healthy cells maintain high intracellular ion concentration behind an intact lipid bilayer — this contributes a capacitive signature at 10–100kHz. Dead or lysed cells lose membrane integrity, causing characteristic phase angle shifts and capacitance drop. This distinguishes "cells present but dead" from "cells present and healthy."

**Game meaning:** Impedance stable in expected range = population healthy and intact. Impedance falling (phase angle shifting toward purely resistive) = cells dying, membranes compromised. Impedance rising abnormally = possible biofilm formation or media precipitation.

**IC: AD5933 (Analog Devices)**
- I2C interface, address 0x0D (no conflict with SSD1306 at 0x3C)
- Frequency range: 1kHz – 100kHz (programmable sweep)
- Output excitation: 200mV peak-to-peak (suitable for biological samples — non-damaging)
- Supply: 3.3V or 5V (tie to 3.3V to protect OLED on shared I2C bus)
- Returns: real (R) and imaginary (X) impedance components as 16-bit integers

**Gain-setting resistor (RFB):** Critical calibration component. RFB sets the transimpedance gain of the AD5933's internal current-to-voltage converter. It must be matched to the expected well impedance range. For LB agar + liquid layer at 7mm well diameter:

- Expected impedance: ~500Ω–5kĪ© at 10–50kHz
- Recommended RFB: 1kĪ© (1% tolerance) — this keeps the AD5933 output in its linear range for the expected well impedance. If impedance is consistently saturating or clipping (check by verifying |Z| = √(R²+X²) makes physical sense), swap RFB to 2.2kĪ© or 510Ī© accordingly.

**EIS electrode design:**

Two-electrode configuration (adequate for relative monitoring; 4-electrode Kelvin measurement is more accurate but unnecessary for game-state detection):

- Material: 0.5mm platinum wire (biocompatible, stable, doesn't corrode in LB, can be autoclaved)
- Placement: two Pt wires inserted through the spacer frame on opposing sides, penetrating 1–2mm into the agar layer. Space electrodes ~5mm apart (across the 7mm well diameter with ~1mm offset from center to avoid blocking the optical axis).
- Connection: short Teflon-insulated lead wires from spacer frame to PCB pads. The AD5933's VIN (excitation output) connects to electrode 1; the VOUT (current measurement input) connects to electrode 2 via RFB.

> **Important geometry note:** The EIS electrodes and the OPT101 optical axis must not conflict. The OPT101 sits directly below the coverslip. The EIS Pt wires enter from the sides of the spacer frame, parallel to the coverslip plane. At 30° downward angle, their tips sit in the agar without blocking the optical path. Verify clearance in the spacer frame design before printing.

**Calibration procedure at startup:**
1. Measure RFB resistance directly (known calibration resistor in place of well) — store as `Z_cal`
2. With well loaded, measure at 5 frequencies (e.g., 5, 10, 25, 50, 100kHz)
3. Store initial baseline |Z| values per frequency in EEPROM
4. Game logic uses *delta from baseline*, not absolute impedance values

**Software:** Use the ZSweeper or Electrochemistry Arduino library for AD5933. For v2 prototype, single-frequency measurement at 10kHz is sufficient. Full sweep (5 frequencies) gives richer data for debugging.

---

## LAYER 4: HARDWARE SYSTEM

### Component list (v2, updated)

**Microcontroller:**
- Arduino Nano (ATmega328P) — unchanged. Plugs into female headers on PCB.

**Sensors:**
- IrOx/Pt pH working electrode + Ag/AgCl reference (in well, through spacer frame) → analog A0 via MCP6001 buffer
- FSR force sensitive resistor (feed button, on case surface) → analog A1 via 10kĪ© voltage divider
- OPT101 photodiode + transimpedance amplifier → analog A2 (reads mCherry fluorescence from below)
- AD5933 impedance analyzer (I2C, 0x0D) → reads EIS from Pt well electrodes

**Display:**
- SSD1306 128Ɨ64 OLED (I2C, 0x3C) → SDA/SCL (A4/A5)

**Excitation LED:**
- Amber LED 590nm on D6 (PWM) + 220Ī© — excites mCherry only. No multiplexing required.

> **v1 → v2 hardware removals:** Blue 470nm LED (D3), Green 530nm LED (D5), and Velostat petting pad (A0 in v1) are all eliminated. This removes 3 components and simplifies the PCB significantly.

**Optical filter:**
- 600nm longpass filter (Rosco #19 "Fire" gel, or equivalent) — upgraded from 500nm longpass in v1. The tighter cutoff at 600nm more aggressively blocks the 590nm amber excitation scatter while still passing mCherry emission at 610nm. This improves SNR for mCherry specifically (critical since mCherry's Stokes shift is only 20nm).

**Translucent PDMS membrane:**
- Use standard Sylgard 184 cured at 10:1 base:crosslinker ratio — this gives optically clear, slightly translucent PDMS. The red mCherry emission at 610nm transmits through 300–500μm PDMS with minimal attenuation. Users looking at the top of the device can see the biological glow. This is intentional and is the primary user-facing aesthetic of v2.

**Optics stack (bottom to top):**
1. OPT101 sensor (face up, on PCB)
2. 600nm longpass filter (resting on sensor)
3. Glass coverslip #1.5 (170μm)
4. Spacer frame (7mm well, 2mm thick, black PLA or acrylic) — with IrOx/Pt pH electrode and two Pt EIS electrodes threaded through sidewalls
5. Agar layer (~0.5–0.8mm, bacteria embedded)
6. Liquid LB layer (~0.7–1.2mm)
7. Translucent PDMS membrane (300–500μm) — visible red glow surface
8. User's hand / ambient light above

**Power:** USB-powered via Nano's USB port. No battery in current design.

### Pin mapping (v2)

Arduino Nano Pin → Component ───────────────────────────────────────────────────────── A0 → pH electrode Vout (via MCP6001 unity-gain buffer) A1 → FSR feed button (+ 10kĪ© to GND, 5V supply) A2 → OPT101 Vout (direct, no resistor needed) A4 (SDA) → SSD1306 OLED (0x3C) + AD5933 (0x0D) — shared I2C bus A5 (SCL) → SSD1306 OLED (0x3C) + AD5933 (0x0D) — shared I2C bus D6 (PWM) → Amber LED 590nm (+ 220Ī© to LED anode) 5V → FSR supply, LED supply, OPT101 V+, MCP6001 VDD 3.3V → OLED VCC, AD5933 VDD GND → Everything

Off-Arduino (in well, wired to PCB pads): PCB pad “pH_W” → IrOx/Pt working electrode wire PCB pad “pH_R” → Ag/AgCl reference electrode wire PCB pad “EIS_1” → AD5933 VIN → Pt electrode 1 PCB pad “EIS_2” → AD5933 VOUT via RFB (1kĪ©) → Pt electrode 2

> **I2C bus note:** AD5933 (0x0D) and SSD1306 (0x3C) addresses do not conflict. Both operate at 3.3V VDD. Pull-up resistors: 4.7kĪ© on SDA and SCL to 3.3V (not 5V — both devices are 3.3V I2C). The Nano's A4/A5 are 5V-tolerant with 3.3V pull-ups; this is fine.

### Physical layout (v2 updates)

Egg-shaped enclosure, black 3D-printed PLA, same form factor as v1 with the following changes:

- **Top surface:** Translucent PDMS window replaces the opaque membrane — this is now the primary visual feature. At high mCherry expression, a diffuse red glow is visible to the naked eye from several feet away in a dimmed room.
- **FSR feed button:** Remains on lower front face as a tactile soft pad.
- **Side port:** Feeding port (syringe injection for LB + kanamycin) unchanged.
- **Electrode ports:** Two additional small sealed ports in spacer frame for pH and EIS electrode wires. These are internal (not user-accessible); wires exit through the frame and terminate at PCB solder pads.
- **OLED position:** Unchanged — sits beside the well on the PCB, visible through cutout.
- **USB port:** Unchanged — bottom of device.

---

## LAYER 5: SIGNAL PROCESSING AND GAME LOGIC

### Sensing timeline and polling rates

| Signal | Hardware | Poll interval | Biological timescale |
|---|---|---|---|
| mCherry fluorescence | OPT101 + amber LED | Every 10 seconds | Hours (protein accumulation) |
| pH | IrOx electrode → A0 | Every 30 seconds | Hours (acid accumulation) |
| EIS impedance | AD5933 at 10kHz | Every 60 seconds | Hours (cell growth/death) |
| FSR (feed input) | A1 | Interrupt / 50ms | Instant |

### Startup calibration routine (mandatory)

Before entering game loop, the device runs a 3-step calibration:

1. **pH calibration:** Prompt user (OLED message) to place pH 7.0 buffer on well, read A0 for 10 seconds averaged → store as `pH7_ADC`. Then pH 4.0 buffer → store as `pH4_ADC`. Compute slope = (7.0 āˆ’ 4.0) / (pH7_ADC āˆ’ pH4_ADC) and intercept. Store in EEPROM. This is valid for the life of the IrOx electrode (weeks to months).

2. **EIS baseline:** With bacteria freshly loaded at OD600 ~0.25–0.5, run AD5933 sweep at 10kHz for 30 seconds (5 readings averaged) → store as `Z_baseline`. This baseline shifts when bacteria are reloaded — recalibrate at each reload.

3. **mCherry baseline:** Run 3 amber LED fluorescence readings averaged → store as `mCherry_baseline`. This accounts for any background signal from the agar matrix or optical path.

All subsequent readings use delta from baseline: `ΔpH`, `ΔZ`, `ΔmCherry`.

### Signal delta interpretation

Ī”pH = pH_current āˆ’ pH_baseline (negative = acidifying = active metabolism) Ī”Z = Z_current āˆ’ Z_baseline (negative = losing membrane integrity) Ī”mCherry = mCherry_current āˆ’ mCherry_baseline (positive = rising hunger signal)

Use exponential moving average (α = 0.1) on all three deltas to smooth noise before game-state evaluation.

### Game states (v2 — 5 states)

STATE pH SIGNAL IMPEDANCE mCHERRY INTERPRETATION ────────────────────────────────────────────────────────────────────────────────── THRIVING Ī”pH < āˆ’0.3 Ī”Z within ±15% Ī”mCherry low Active growth, happy (acidifying) of baseline (<+20%) “Alive and eating well”

HUNGRY Ī”pH flat Ī”Z within ±15% Ī”mCherry high Nutrients depleted, (near baseline) of baseline (>+50%) PosmY active “Feed me”

SICK Ī”pH flat Ī”Z < āˆ’20% Ī”mCherry high Cells dying, membranes or rising (dropping) (>+50%) compromised “Sick, may not recover”

RECOVERING ΔpH drops ΔZ stable or ΔmCherry Just fed, bacteria rapidly after improving dropping consuming fresh LB, feeding event from SICK low from peak PosmY shutting off

OVERFED Ī”pH < āˆ’0.8 Ī”Z rising Ī”mCherry low pH crash from excess (acidifying above baseline (< baseline) feeding; media too severely) (cell crowding) acidic for growth

> **Disambiguation of THRIVING vs RECOVERING:** Both show pH dropping. The key difference: RECOVERING is entered explicitly after a feeding event (FSR press + confirmed LB injection timestamp). Use a `lastFedTime` variable — if a feeding occurred within the past 2 hours AND pH is dropping AND mCherry is falling, state = RECOVERING. THRIVING is the steady-state equivalent in the absence of a recent feeding event.

### State transition logic (pseudocode)

```cpp
// All deltas are EMA-smoothed before this evaluation
void evaluateGameState() {
  bool acidifying   = (deltaPH < -0.3);
  bool acidCrash    = (deltaPH < -0.8);
  bool impedOK      = (abs(deltaZ_pct) < 15);
  bool impedDrop    = (deltaZ_pct < -20);
  bool impedHigh    = (deltaZ_pct > +20);
  bool mCherryHigh  = (deltaMCherry_pct > 50);
  bool mCherryLow   = (deltaMCherry_pct < 20);
  bool recentFeed   = ((millis() - lastFedTime) < 7200000UL);  // 2hr window

  if (acidCrash && impedHigh && mCherryLow)  { state = OVERFED;     return; }
  if (impedDrop && mCherryHigh)              { state = SICK;        return; }
  if (acidifying && recentFeed && !mCherryHigh) { state = RECOVERING; return; }
  if (mCherryHigh && !impedDrop)             { state = HUNGRY;      return; }
  if (acidifying && impedOK && mCherryLow)   { state = THRIVING;    return; }
  // Default / ambiguous:                    { state = DORMANT;     }
}

Fluorescence reading procedure (simplified vs v1)

With only one LED and one fluorescent protein, the timing cycle is straightforward:

1. All LEDs off → OPT101 reads ambient baseline → store as ambientRead
2. Amber LED (D6) ON at PWM 180/255 → wait 50ms → OPT101 reads for 100ms averaged
3. Amber LED OFF
4. mCherry_raw = reading āˆ’ ambientRead
5. Apply EMA: mCherry_EMA = α * mCherry_raw + (1-α) * mCherry_EMA
6. Repeat every 10 seconds

No multiplexing required. The timing simplification also improves SNR — the OPT101 integrates for a full 100ms on each mCherry read rather than the briefer reads forced by v1’s 3-LED rotation.


MAINTENANCE

  • Feed every 6–12 hours: Inject 20–50μL fresh LB + kanamycin through side port. Press FSR feed button at same time — this timestamps lastFedTime for RECOVERING state logic.
  • Reload bacteria every 1–2 weeks: Warm well to 42°C to melt agarose, flush with sterile PBS, recast with fresh bacteria. Recalibrate EIS baseline immediately after.
  • pH electrode maintenance: IrOx electrodes are stable for weeks to months in aqueous media. If readings drift by >0.5 pH units vs. known buffer, re-run two-point calibration. If drift persists, electrodeposit fresh IrOx layer.
  • Ag/AgCl reference: Replace every 2–4 weeks or when reference potential shifts (observed as anomalous pH readings unresolvable by calibration). Re-chloridize silver wire in 1M FeClā‚ƒ for 10 min.
  • Keep at 20–25°C. Avoid direct sunlight — UV light triggers the SOS response in E. coli even without the sulA construct, and will cause oxidative stress that kills the culture and photobleaches mCherry.
  • Temperature and impedance: EIS measurements are temperature-dependent (solution conductivity changes ~2%/°C). For quantitative impedance data, keep the device in a stable-temperature environment or add an NTC thermistor for temperature compensation in software. For game-state detection using relative changes, this is optional.
</details>