
Your phone’s flashlight can send a message. Within just ‘5 hours’, you can build this ‘medium’ complexity project for under ₹400, using a photodiode, a comparator chip, and a Python decoder to turn Morse-code light blinks into on-screen text—all without a microcontroller.
Ever wanted to transmit data using nothing but pure light? Li-Fi (Light Fidelity) carries data using light instead of radio waves, and this project is a small, practical form of it: a smartphone flashlight is the transmitter, a BPW34 photodiode is the receiver, and the data is plain text sent across free space. It is a low-cost, hands-on introduction to the physics of Li-Fi.
A mobile app converts letters and numbers into Morse code and ‘blinks’ the flashlight accordingly. Light is switched on for a defined time to represent a ‘dot’ or a ‘dash’, a scheme called on-off keying (OOK). The base interval (one dot) is about 30ms, a dash lasts three times as long, and the gaps between symbols, letters, and words are also timed, so no separate communication protocol or framing bits are needed.
At the receiver, the BPW34 turns light intensity into an electrical signal, and an LM393 comparator with an adjustable threshold converts it into clean digital pulses, even under ambient lighting. The comparator output goes to the CTS pin of a USB-to-TTL adapter, so a Python program on the computer can read the pulses directly, with no microcontroller. The program measures pulse widths and gaps, rebuilds the Morse symbols, and prints the characters on the terminal in real time.

Why so slow? Transmission is reliable only at about 30ms per interval or slower, roughly 30-40 bps. The limit is the phone itself: the yellow phosphor layer that turns a white LED’s blue light into white responds slowly, and operating-system latency adds more delay.
Fig. 1 shows the author’s breadboard prototype, while Fig. 2 presents the project’s block diagram.

What will you learn?
- How information can be sent wirelessly as visible light from a smartphone flashlight and received with a photodiode, using Morse code and OOK.
- How comparators and threshold-based signal conditioning turn an optical signal into clean digital pulses.
- Why timing analysis, pulse-width detection, and gap measurement matter when decoding real-world signals.
- How to connect hardware to Python through a USB-to-TTL converter and its serial control lines.
- How a discrete circuit and a software algorithm combine into a complete proof-of-concept optical link.
How it works





