0
NYNA
All work
Featured project · Final-year dissertation

Sending data through light.

A low-cost, bidirectional fibre-optic link that carries digital data, and digital audio, between two ESP32 nodes over 1 m of TOSLINK plastic optical fibre, a 650 nm KY-008 laser into a BPW34 photodiode, recovered through a discrete analogue front end and the ESP32's hardware pulse counter. BEng Electronic Engineering, Royal Holloway, University of London. Supervisor: Dr Shyqyri Haxha.

Assembled NYNA optical wireless transceiver with dual touchscreens and speakers
The transceiverTwo ESP32 nodes · KY-008 laser TX / BPW34 RX · OPA356 TIA + TLV3501 comparator · 1 m TOSLINK fibre
650nmKY-008 laser diode transmitter
BPW34Vishay PIN photodiode receiver
OPA356200 MHz TIA · Rf 22 kΩ
TLV35014.5 ns rail-to-rail comparator
128kbpsSustained · 640 kbps peak
1mTOSLINK plastic optical fibre

How it works

Each byte is framed (0x7E start · length · payload · XOR checksum) and sent as on-off keying: the ESP32 switches a 650 nm KY-008 laser through a 2N2222A driver, coupled into 1 m of TOSLINK fibre. At the far end a reverse-biased BPW34 photodiode feeds an OPA356 transimpedance amplifier (Rf 22 kΩ, Cf 2.2 pF) and a TLV3501 comparator with 100 kΩ Schmitt-trigger hysteresis. The recovered edges are counted by the ESP32's PCNT hardware pulse-counter over 100 ms windows (1 µs glitch filter) on GPIO34. A separate Bluetooth A2DP path streams audio through a MAX98357A I²S amplifier.

What I built

  • A custom two-layer PCB carrying both transceiver nodes, designed in EasyEDA and fabricated by JLCPCB
  • Transmitter & receiver firmware in C++ (Arduino / ESP32) with a framed, XOR-checked protocol
  • CAD-modelled, 3D-printed PLA optics for the laser, BPW34 photodiode & TOSLINK ferrule (roughly six iterations)
  • A 2.8" ILI9341 touchscreen UI (XPT2046 touch) showing live telemetry & recovered text
  • End-to-end characterisation: DC levels, comparator swing & a PCNT data-rate sweep (8 to 640 kbps)
Where it started · Breadboard prototype

The initial transceiver circuit.

Before any boards were fabricated, the whole optical link began on breadboards, an ESP32 driving the 650 nm laser on one side; a BPW34 photodiode feeding the OPA356 transimpedance amplifier and TLV3501 comparator on the other, with live telemetry and Bluetooth pairing surfaced on an ILI9341 touchscreen. This is the prototype I characterised, DC levels, timing and the data-rate sweep, before committing the design to a fabricated PCB.

Custom optics · 3D-printed

Adapters I designed & printed.

Drag to rotate
Loading model
3D-printed optical adapter

CAD-modelled and 3D-printed in PLA across roughly six iterations, coupling the KY-008 laser, BPW34 photodiode and TOSLINK ferrule and holding them in precise alignment. Mechanical alignment of this free-space coupling, plus shielding the photodiode from ambient light, proved to be the dominant factor in link stability.

Final assembled optical adapter render BPW34 photodiode mount render BPW34 TOSLINK coupling render 650 nm laser coupler render KY-008 laser module render
Results · Measured

What the link actually does.

Demonstrated

Bidirectional binary text was sent end-to-end across the 1 m TOSLINK link and shown live on the receiver's touchscreen and the host serial monitor, with 1,000-packet integrity tests passing at 8, 64 and 128 kbps. The PCNT sweep held a stable 128 kbps under hand-held alignment and briefly peaked at 640 kbps in a dark room. On the populated PCB the comparator swung a clean 3.3 V / 0.05 V, fast enough to read with digitalRead().

Honest limits

Those rates reflect hand-held fibre alignment rather than the 7.2 MHz closed-loop bandwidth the front end can support. A Bluetooth A2DP path (MAX98357A I²S amp) reproduces tones and voice-band audio over the link; wide-band music stays partial, limited by the 8 kHz firmware sample rate. Residual comparator spikes traced to SOIC solder joints and ambient-light pickup at the BPW34 are the next revision's targets.

Gallery

Build, boards & results.

Get in touch

Let's build something that performs.

Ready when you are.

A brand-new website, a network rebuild, a custom board or a tricky hardware fault, drop us a line and we'll respond within one working day. Quotes are free.

info@nyna.co.uk
Email
info@nyna.co.uk
Phone
020 8087 4237
Office
Office 1.42, Building 2, Croxley Business Park, WD18 8YA