Automated Text Transmission via Visible-Light Morse Pulses Using an Android Flashlight Transmitter and Arduino-LDR Receiver

2023

This paper presents an automated text-transmission prototype that uses Morse-code timing over visible light. A custom Android application accepts a user-entered message, converts its characters into Morse-style pulse patterns, and broadcasts those patterns through the phone flashlight. At the receiving end, an Arduino-based circuit with a light dependent resistor (LDR) detects the light pulses, measures their durations, reconstructs the corresponding Morse symbols, maps them back into characters, and displays the recovered message on an LCD screen. The system is designed as a low-cost, end-to-end demonstration of optical text communication rather than as a high-throughput communication standard. The manuscript reports successful transmission and reconstruction of tested words, phrases, and full sentences, including whitespace handling, while also varying the timing parameters used by the transmitter and receiver. The attached receiver sketch further shows how the Arduino side is implemented: light detection begins only after the sensed value crosses a darkness threshold, dot and dash classification is performed through pulse-duration counts, message termination is inferred from a prolonged dark interval, and decoded characters are assembled into a sentence buffer. The work demonstrates the feasibility of combining smartphone flashlight control, timing-based visible-light signaling, and microcontroller-side decoding in a compact prototype. However, the available source material does not provide numeric accuracy, throughput, operating range, controlled ambient-light testing, or formal robustness measurements. Accordingly, the contribution should be understood as a functioning proof of concept with clear opportunities for stricter experimental evaluation.

Introduction

Morse code is a symbol-encoding system built from short and long signal elements, commonly represented as dots and dashes. The paper uses that timing-based structure as the basis for a visible-light communication prototype, where a phone flashlight serves as the optical transmitter and an Arduino receiver interprets the resulting pulses [1, 2].

The central objective of this work is practical: to automate the transmission and reception of text strings through visible light. The sender enters a message into an Android application, the application converts the message into timed optical pulses, and the receiver reconstructs the text without manual Morse encoding or manual decoding.

This project sits within the broader history of wireless communication and the narrower area of visible-light communication, but it does not attempt to compete with modern radio or high-bandwidth optical systems. Its purpose is to demonstrate a compact, understandable, end-to-end communication pipeline built from common hardware and timing logic [3, 4, 5, 6, 7].

Literature Review

Prior literature establishes both the historical importance of Morse-style signaling and the ongoing interest in communication systems that use light as a transmission medium. The manuscript positions this work at the intersection of those ideas: it uses Morse-inspired temporal encoding while relying on visible-light pulse transmission rather than sound, touch, or radio [1, 2, 3, 4, 5, 6, 7].

The project uses the Arduino platform, an LDR-based light sensor, Android Studio, Java, and the Arduino IDE as its practical implementation stack. It also relies on a Morse-code lookup table for character mapping during encoding and decoding [8, 9, 10, 11, 12, 13].

The strongest defensible contribution of the manuscript is not a broad claim of communication-system novelty. It is the concrete implementation of an automated optical text-transfer workflow: Android-side Morse pulse generation, visible-light broadcasting through a phone flashlight, Arduino-side pulse timing analysis, and LCD output of the decoded message.

System Objective and Research Scope

The paper addresses the following implementation question: **Can a user-entered text string be automatically converted into Morse-style light pulses on a smartphone, received through an LDR, decoded on an Arduino, and displayed again as readable text?**

The work is scoped to string transmission. The manuscript discusses words, phrases, full sentences, and whitespace handling. It does not present a general-purpose binary modem, image/audio transmission pipeline, error-correcting protocol, or formal communication benchmark.

System Architecture

| Subsystem | Main role | Source implementation detail | |---|---|---| | Android input layer | Accepts the message typed by the user | Custom Android application | | Encoder and scheduler | Maps characters to Morse symbols and controls pulse timing | Dot/dash timing plus inter-symbol and stop delays | | Optical transmitter | Emits visible light pulses | Phone flashlight | | Optical sensor | Measures received light level | LDR connected to the Arduino | | Receiver state machine | Detects light/dark transitions and measures durations | `LightCount`, `DarkCount`, `PresentL`, `on` | | Symbol decoder | Converts pulse patterns back into characters | `unit()` and `make()` logic in the Arduino sketch | | Output layer | Displays the reconstructed message | 16x2 LCD and serial output |

The complete architecture is intentionally sequential. Text is first encoded, then emitted as visible pulses, then interpreted as timed light and dark intervals, then assembled into characters and a final sentence. The communication behavior depends on the transmitter and receiver using compatible timing assumptions.

Transmitter Design

The Android application receives a complete user-entered string, including whitespace, and converts it into an internal representation of optical on/off states. Each emitted state carries delay information so that the physical flashlight output can distinguish short and long Morse elements as well as gaps between symbols and characters.

The manuscript defines three transmitter-side timing variables: `delay1`, `delay2`, and `delayStop`. `delay1` is associated with the shorter pulse timing used for a dot-like unit and short spacing behavior; `delay2` is associated with the longer dash-like unit and longer separation behavior; `delayStop` defines the final waiting period used to treat the transmission as finished before results are combined and displayed.

The application controls the phone flashlight through the device camera interface. The paper describes use of `CameraManager`, camera identification, exception handling, and torch state changes so that light can be switched on and off according to the encoded sequence.

Receiver Hardware and Wiring

The receiving side uses an Arduino, an LDR, a 10 kOhm resistor, a breadboard-based sensor circuit, and an LCD screen. The manuscript describes a resistor-divider arrangement in which the LDR and resistor create an analog signal that changes with incoming light intensity. That analog signal is read by the Arduino and interpreted against a darkness threshold.

One implementation detail is inconsistent across the supplied materials: the paper draft names `A0` in the wiring discussion, while the attached Arduino sketch declares `PhotoPin = A2`. For code-level descriptions, this JSON follows the attached sketch and refers to `A2`; the wiring paragraph above is therefore kept general rather than presenting a single fixed analog input pin.

| Receiver-side item | Value or role in the attached sketch | |---|---|---| | Photoresistor input | `PhotoPin = A2` | | Darkness threshold | `dark = 50` | | Dot/dash count threshold | `freq = 500` | | Gap parameter | `freqGap = 500` | | Message-end gap | `turnOffGap = 500` | | LCD wiring pins | `rs = 7`, `en = 9`, `d4 = 10`, `d5 = 11`, `d6 = 12`, `d7 = 13` | | Display size | `lcd.begin(16, 2)` | | Serial speed | `Serial.begin(9600)` |

Receiver Detection and State Logic

The receiver sketch begins in a waiting state. It continuously samples the analog input and starts processing only when the measured light value rises above the configured `dark` threshold. At that moment, the `on` flag is set to `true`, activating the light/dark duration tracking path.

Once reception begins, the sketch passes either `true` or `false` into the `detect()` function depending on whether the light level is above the threshold. `LightCount` accumulates the duration of bright intervals, `DarkCount` accumulates the duration of dark intervals, and `PresentL` records the previous optical state so the code can detect transitions.

The attached sketch uses the following core receiver loop: ```cpp void loop() { readVal = analogRead(PhotoPin); if (dark < readVal) { on = true; } if (on) { if (dark < readVal) { detect(true); } else { detect(false); } } delay(1); } ```

The transition-aware counting logic is handled in `detect()`. A dark-to-light transition finalizes the previous dark interval; a light-to-dark transition finalizes the previous light interval. When darkness lasts for at least `freq + freqGap + turnOffGap`, the sketch treats the message as complete, prints the accumulated sentence, clears the LCD, displays the sentence, and resets the buffer.

```cpp void detect(boolean isLight) { if (isLight) { LightCount++; if (isLight != PresentL) { unit(PresentL, DarkCount); PresentL = true; DarkCount = 0; } } else { DarkCount++; if (isLight != PresentL) { unit(PresentL, LightCount); PresentL = false; LightCount = 0; } if (DarkCount >= freq + freqGap + turnOffGap) { unit(false, DarkCount); on = false; Serial.println(sentence); lcd.clear(); lcd.setCursor(0, 0); lcd.print(sentence); sentence = ""; } } } ```

Pulse Classification and Character Reconstruction

The receiver converts measured durations into Morse symbols through the `unit()` function. For light intervals, a count less than or equal to `freq` becomes a dot, while a longer count becomes a dash. For dark intervals, a count greater than `freq` closes the current Morse letter and forwards it to `make()` for character conversion.

```cpp void unit(boolean isLight, int Count) { if (isLight) { if (Count <= freq) { letter = letter + '.'; } else { letter = letter + '-'; } } else { if (Count > freq) { make(letter); letter = ""; } } } ```

The `make()` function maps recognized Morse patterns into uppercase letters, digits, and selected punctuation. The attached sketch explicitly handles `A-Z`, `0-9`, `.`, `,`, `?`, and `/`. If no mapping matches, the sketch assigns a space character.

| Supported output group | Symbols present in the attached `make()` mapping | |---|---| | Letters | `A-Z` | | Digits | `0-9` | | Punctuation | `.`, `,`, `?`, `/` | | Fallback | Space character when no Morse pattern matches |

During character reconstruction, the LCD is used in two ways. Inside `make()`, the current Morse sequence is printed on the first row and the already accumulated sentence is printed on the second row. At end-of-message detection, the final sentence is printed after clearing the display.

Algorithmic Workflow

The complete end-to-end procedure can be summarized as follows: ```text 1. Read a user-entered text string in the Android app. 2. Convert each supported character into a Morse pattern. 3. Emit flashlight pulses using configured short/long timing delays. 4. Sense the resulting visible-light pattern with the LDR. 5. Start receiver processing once the light level crosses the threshold. 6. Count bright and dark durations on the Arduino. 7. Convert bright durations into dot or dash symbols. 8. Convert sufficiently long dark durations into letter boundaries. 9. Map each completed Morse letter to a text character. 10. Append characters into a sentence buffer. 11. Detect end of transmission from a prolonged dark interval. 12. Display the reconstructed sentence on the LCD. ```

Pseudo-code from the Manuscript

Android-side Pseudo-code

```text function MainActivity() { initialize variables and UI elements check if the device has a flashlight if not, display an error message initialize camera manager and camera ID create and start welcome screen create and start loading and info dialogs set onClickListener for update button onClick: start loading dialog get input string from EditText validate input string if valid: start Morse-code transmission for each character in input string: look up corresponding Morse code for each dot or dash in Morse code: turn on flashlight for the appropriate duration turn off flashlight for the appropriate duration wait for the appropriate duration wait for the appropriate duration between characters end transmission if invalid: display error message } ```

Arduino-side Pseudo-code

```text void loop() { read photoresistor value if value is above dark threshold: set on flag to true if on flag is true: if value is above dark threshold: call detect(true) else: call detect(false) delay for 1 ms } void detect(boolean isLight) { if isLight: increment LightCount if state changed: process previous dark count set PresentL to true reset DarkCount else: increment DarkCount if state changed: process previous light count set PresentL to false reset LightCount if DarkCount reaches the stop threshold: process final dark interval stop reception display sentence clear sentence buffer } ```

Timing Parameters and Synchronization

The manuscript treats timing as the main information-bearing mechanism. On the Android side, emitted pulse duration and spacing are controlled through `delay1`, `delay2`, and `delayStop`. On the Arduino side, the attached sketch uses `freq`, `freqGap`, and `turnOffGap` to interpret pulse counts and to decide when a transmission has ended.

| Timing concept | Transmitter-side description | Receiver-side interpretation | |---|---|---| | Short light unit | `delay1` | Count `<= freq` becomes `.` | | Long light unit | `delay2` | Count `> freq` becomes `-` | | Letter separation | Longer off-state delay | Dark interval `> freq` closes the current letter | | Transmission completion | `delayStop` | `DarkCount >= freq + freqGap + turnOffGap` finalizes the sentence |

The paper repeatedly notes that successful decoding depends on keeping the timing parameters of the Android sender and Arduino receiver synchronized. That synchronization is not an incidental detail; it is the operational assumption that lets the receiver classify timing-based symbols consistently.

Experimental Procedure

The manuscript reports testing the system with strings of different lengths, including single words, phrases, and complete sentences. It also reports varying delay settings to observe whether the communication pipeline continued to function under changed transmission speeds.

The reported evaluation is qualitative. The paper states that transmitted messages were successfully received and decoded in the tested cases, but it does not provide a formal dataset, repeated trial counts, message-level error rates, character-level error rates, throughput values, or a controlled hardware environment.

Results

The manuscript reports that the Android application successfully converted complete text strings, including whitespace, into light-pulse sequences and that the Arduino receiver successfully decoded those sequences back into text. The output was displayed through the connected LCD module after reception.

It further reports that the system remained operational while the pulse and gap timings were varied, so long as the receiving-side parameters were adjusted in a compatible manner. This supports the intended design principle that the link is timing-governed and requires consistent timing configuration between transmitter and receiver.

The result established by the manuscript is therefore specific: the prototype functioned as an automated visible-light Morse text transmitter and receiver in the authors' tested setup. The paper does not establish generalized performance guarantees beyond that tested prototype context.

Discussion

The key technical idea is simple but coherent: time delay is treated as the primary carrier of meaning. The system does not attempt to transmit arbitrary analog brightness patterns. Instead, it converts text into an ordered rhythm of optical states and relies on duration-aware decoding to recover symbol boundaries and character content.

The attached receiver sketch makes that design visible at code level. It does not merely sense whether light exists; it counts how long light and darkness persist, detects transitions, classifies short versus long light intervals, and uses longer dark intervals to decide when to complete a letter or the entire sentence.

A practical strength of the system is its accessibility. It uses a smartphone flashlight, an Arduino, an LDR, a resistor, and an LCD - components that make the project easy to reproduce as a prototype. That makes it useful for demonstrating optical signaling, finite-state decoding, embedded timing logic, and the relationship between sender-side encoding and receiver-side interpretation.

Limitations

The current paper does not provide numerical communication metrics. There is no reported character error rate, message error rate, throughput, latency, timing jitter analysis, operating distance, viewing-angle tolerance, or controlled ambient-light robustness test. Without those measurements, the system should not be described as broadly reliable or efficient in a quantified sense.

The project is also limited to Morse-style text communication and a fixed rule-based receiver. It does not include error correction, adaptive threshold calibration, framing checks, redundant transmission, or a general packet format. Those omissions are reasonable for a prototype, but they constrain the strength of the conclusions.

Finally, the provided manuscript and receiver sketch differ on the analog input pin used for the light sensor. That source inconsistency should be resolved in the final paper package before publication.

Future Work

Future work should begin with stricter evaluation rather than more ambitious claims. A stronger follow-up study would report repeated trials across multiple message lengths, character-level and message-level recovery accuracy, time per character, effective data rate, and performance under different ambient-light conditions and transmitter-receiver distances.

The manuscript also identifies natural engineering extensions: broader data formats, alternative transmission media, error-correction methods, parameter optimization, and potentially more automated decoding strategies. These are reasonable next steps, but they should be evaluated against explicit measurements rather than described only as speculative improvements.

Conclusion

This paper presents a working prototype for automated text transmission through visible-light Morse pulses. An Android application transforms user-entered strings into timed flashlight emissions, and an Arduino-LDR receiver reconstructs the message through thresholding, duration counting, Morse-pattern mapping, and LCD display.

The source material supports a clear proof-of-concept conclusion: the described communication loop worked in the authors' tests and the attached receiver sketch provides concrete implementation evidence for the decoding mechanism. The next serious step is to turn that prototype into a measured system by resolving source inconsistencies, documenting the full transmitter implementation, and reporting quantitative performance.

Acknowledgments

The authors acknowledge the online resources that informed the project, as well as the support of peers, friends, and family during its development.

Tags: visible-light communication, Morse-code signaling, Android flashlight transmission, Arduino optical decoding, LDR-based light sensing, timing-based communication, embedded receiver design, low-cost wireless text transfer, Ranit Bhowmick, Sayanti Chatterjee

Canonical URL: https://ranitbhowmick.com/research/automated-text-transmission-visible-light-morse-pulses-android-flashlight-arduino-ldr-receiver