🧠 Mr. Brain — a Laser Optical Perceptron Neuron
A real perceptron built from light: two colored lasers as inputs, photoresistors as weights, a prism to route by color, a comparator to fire. Uses the parts you have (green 532 nm + violet 405 nm lasers, prisms, LDRs, photodiodes, diodes). For ALMAWARE / Eran neuromorphic R&D. Built for Iddo, 2026-06-24.
⚠️ LASER SAFETY — read first, this is the load-bearing part.
- Never look into a beam or a specular reflection. Prisms, LDR glass, photodiode cans, and bare table tops all throw mirror reflections — treat every shiny surface as a second beam.
- Violet 405 nm is the sneaky one: your eye under-rates its brightness, so the blink reflex barely fires — it can damage your retina before you react. It's also near-UV. Respect it more than the green.
- Work at table height with the beam horizontal, never at eye level. Put a matte beam dump (black card / metal) at the end of every path. Remove watches/rings (reflections).
- Use the lowest power that works, ideally laser goggles rated for 400–410 nm AND 530–540 nm. Keep pets/kids out. Never aim at windows, people, or the sky.
1 · The idea
A perceptron computes y = f( Σ wᵢ·xᵢ ). We build it in light:
- Inputs xᵢ = your two lasers. Green (532 nm) = input 1, Violet (405 nm) = input 2. On/off (binary) or dimmed (analog) = the input value. Two colors = two chromatic channels.
- Weights wᵢ = photoresistors (LDRs). Each beam lands on an LDR; how much light reaches it sets the LDR's conductance = the weight. Tune a weight by beam intensity, an ND/polarizer filter, distance, or a series pot.
- Σ (sum) = the LDR/photodiode currents add at one node (an op-amp summing input).
- f (fire) = a comparator + threshold → an LED lights when the sum crosses the line. That's the neuron firing.
- Prism = the chromatic router: violet bends more than green, so one combined beam fans into two spots — each color auto-lands on its own weight.
GREEN 532 ─▶[LDR_g = w_g]─┐
├─▶ Σ (op-amp summing) ─▶ [comparator @ threshold θ] ─▶ LED (FIRE / no-fire)
VIOLET 405 ─▶[LDR_v = w_v]┘
▲ each laser's brightness/filter = that input's weight contribution
(Tier 2: ONE combined beam ─▶ [PRISM] ─▶ green & violet diverge ─▶ land on LDR_g and LDR_v)
2 · Parts (you said you have these)
| Part | Role |
| Green laser (532 nm) + Violet laser (405 nm) | the two inputs / chromatic channels |
| Photoresistors (LDRs, e.g. GL5528) | the weights (light → conductance) |
| Photodiodes / diodes | faster linear light sensors (Tier 3) + output LED + rectification |
| Prism(s) | chromatic routing — split a combined beam into green/violet by refraction |
| Op-amp (LM358) + comparator (LM393) + 10k trimpot | summation (Σ) + threshold (fire) |
| Breadboard, resistors (1k–100k), 5 V supply, output LED, black card | glue + beam dump |
| ND filters / polarizers / tape (optional) | set weights by dimming a beam |
3 · Build — honest tier ladder
TIER 0 One synapse + fire (prove the principle, ~20 min)
- Aim the green laser at one LDR (through a diffuser/tape so it's not a hot spot — and so the LDR sees a controllable level).
- LDR + a fixed resistor = a divider; feed that into the LM393 comparator; set the threshold trimpot.
- Block/unblock the beam → the output LED toggles. Dim the beam (tape/ND) until it sits right at threshold. You've built a weighted light-detector that fires. ✅
TIER 1 The 2-input chromatic perceptron — and TRAIN it
- Green → LDR_g, Violet → LDR_v (separate short matte tubes so colors don't cross-talk — optical isolation is what makes or breaks it).
- Tie both LDR outputs into the LM358 summing input (virtual-ground summer, feedback R_f) → output ≈
−R_f·(x_g·w_g + x_v·w_v).
- Comparator + threshold θ on the sum → LED fires when
x_g·w_g + x_v·w_v ≥ θ.
- Train it by hand (adjust each beam's intensity = its weight, and θ) to compute a logic gate optically:
- OR: fire if either color is on → big weights, low θ.
- AND: fire only if both on → weights ≈ θ/2 each, so one alone can't cross θ.
- "Green matters more": w_g ≫ w_v → it weighs green over violet. That's a trained perceptron.
TIER 2 Prism routing — chromatic addressing
- Combine both lasers onto one path (or overlap them) and send through the prism. Violet (405) refracts more than green (532), so they fan apart into two spots.
- Place LDR_g and LDR_v at the green and violet spots → one beam, two color-addressed weights, separated by physics. This is "chromatic weights / WDM synapse" made literal — the optics do the routing.
- Reverse it: a prism can also combine colors, or add a third (red) channel later.
TIER 3 Faster, analog, and learning
- Photodiodes instead of LDRs — far faster (µs vs LDR's ~ms) and linear → real analog inputs, not just on/off. Use them in photoconductive mode into a transimpedance amp.
- Perceptron learning rule: compare the output to the desired answer; nudge each weight (motorized ND filter, or a digital pot in series with each LDR) in the direction that reduces error → it learns AND/OR on its own.
- XOR needs two layers — one optical neuron can only do linearly-separable functions. Build 2 neurons + an output neuron for XOR.
- Integrate: swap the LDR weights for your copper-oxide or optical-chromatic memristor cells → light-set non-volatile weights; route many with the FPGA fabric.
4 · What to measure (the proofs)
- Linear sum: fix weights, dim one color up → the summed output rises linearly until θ = the neuron integrating.
- Chromatic selectivity: same total light, different color → different firing = it sees color, not just brightness.
- Truth table: toggle green/violet through all 4 input combos → confirm your trained AND/OR fires correctly.
- Prism dispersion: measure the green vs violet spot separation after the prism = your optical de-multiplexer.
5 · Honest verdict
- Tier 0–1 — guaranteed to work and genuinely a perceptron: laser inputs, LDR weights, analog sum, threshold fire, trainable to AND/OR. Beautiful, real, and you have every part.
- LDRs are slow (~ms) and a bit nonlinear → great for a demo, not for fast inference. Photodiodes (Tier 3) fix the speed.
- One neuron = linear only (AND/OR/weighted-vote). XOR and anything interesting needs layers. That's not a flaw — it's the actual lesson Minsky/Papert taught, in light on your bench.
- It's a teaching/demo instrument, not a compute chip — but it makes the math visible: you can literally see the weights as brightness and the firing as an LED.