Skip to content

Experience an innovative light-based messaging system using STM development boards! โœจ This project enables seamless analog data transmission via GPIO-controlled light pulses, featuring a custom Light-of-Things (LoT) protocol with error detection and real-time LCD output. ๐Ÿš€

Notifications You must be signed in to change notification settings

cassxw/Light-Messaging-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ก Light-Based Messaging with STM Development Boards

๐Ÿš€ Overview

This project explores an innovative approach to data communication using light signals. By leveraging STM development boards, we demonstrate a seamless embedded system-to-embedded system messaging system. The core objective is to transmit analog data - specifically, readings from an onboard potentiometer (POT) sampled via an ADCโ€”from a Transmitter (Sensor Node - SN) to a Receiver (Central Node - CN).

๐Ÿ”‘ Key Features

  • ๐Ÿ”˜ Push-button-triggered data sampling
  • ๐Ÿ“ก GPIO-based data transmission using the โ€˜Bit-Bangโ€™ method
  • ๐Ÿ’ก Custom Light-of-Things (LoT) Message Protocol with parity checks
  • โšก Real-time error detection and correction mechanisms
  • ๐Ÿ‘‚ Continuous listening mode at the receiver for improved responsiveness
  • ๐Ÿ“Ÿ LCD display for real-time decoded data output

๐Ÿ—๏ธ System Architecture

The system consists of:

  • ๐Ÿ“ค Transmitter (Sensor Node - SN)

    • Equipped with an ADC to sample an onboard POT
    • Transmits the sampled data as a binary message using light pulses (LED)
    • Implements the LoT Message Protocol for structured message transmission
    • Includes a checkpoint mechanism to track transmitted samples
  • ๐Ÿ“ฅ Receiver (Central Node - CN)

    • Continuously listens for incoming light-based binary messages
    • Decodes the received data and displays it on an LCD
    • Implements error detection via parity checks
    • Compares received samples with checkpoint messages to ensure data integrity

๐Ÿ“œ Light-of-Things (LoT) Message Protocol

The LoT protocol defines two types of messages:

๐Ÿ“ก 1. Data Message

Transmits sampled ADC values from the Transmitter to the Receiver.

  • ๐ŸŸข Start-of-Text (SOT) [1-bit] - LED ON for 1s
  • ๐Ÿ”ต Message Identifier [1-bit] - LED OFF for 1s (Data Message)
  • ๐Ÿ“Š Data Packet [16-bit] - Represents ADC value; LED ON (1) / OFF (0) for 500ms
  • โœ… Even Parity Bit [1-bit] - Used for error detection
  • ๐Ÿ”ด End-of-Text (EOT) [1-bit] - LED blinks rapidly for 1s

๐Ÿ” 2. Checkpoint Message

Ensures message reliability by tracking sent/received samples.

  • ๐ŸŸข Start-of-Text (SOT) [1-bit] - LED ON for 1s
  • ๐ŸŸก Message Identifier [1-bit] - LED ON for 1s (Checkpoint Message)
  • ๐Ÿ“ˆ Checkpoint Packet [16-bit] - Represents sample count
  • โœ… Even Parity Bit [1-bit] - Ensures data integrity
  • ๐Ÿ”ด End-of-Text (EOT) [1-bit] - LED blinks rapidly for 1s

โš ๏ธ Error Detection & Handling

  1. โœ… Parity Bit Check - Detects single-bit errors within data packets
  2. ๐Ÿ“Š Checkpoint Message Verification - Compares expected vs. received samples
    • If mismatch โ†’ LED blinks rapidly for 2s (๐Ÿšจ Error Alert)
    • If match โ†’ LED remains ON for 2s (โœ… Success)

๐ŸŽจ Design Choices & Modifications

  • ๐Ÿ–ง GPIO โ€˜Bit-Bangโ€™ Method: Direct GPIO manipulation for binary serial transmission over light signals.
  • ๐Ÿ”„ Continuous Listening Mode: The Receiver remains in an always-on state for dynamic responsiveness.
  • โœ… Parity Bit Addition: Enhances error detection beyond just missing messages.
  • ๐Ÿ“Ÿ LCD Display Output: Provides real-time data visualisation.

๐Ÿ“‚ Project Structure

๐Ÿ“‚ Light-Based Messaging Project
 โ”œโ”€โ”€ ๐Ÿ“ Receiver_Code/   # Contains the Receiver (CN) implementation
 โ”œโ”€โ”€ ๐Ÿ“ Sender_Code/     # Contains the Transmitter (SN) implementation
 โ””โ”€โ”€ ๐Ÿ“„ EEE3096S 2023 CS Project Report WLLCAS004 MKKBOI005 MBWMAT002.pdf

๐ŸŽฏ Project Benefits

โœ… Real-time data exchange between embedded systems.
โœ… Error detection & correction ensures reliability.
โœ… Simple yet effective light-based communication.
โœ… Adaptable for various IoT and sensor-based applications.

๐Ÿ”ฎ Future Improvements

  • Implement ๐ŸŒž Light-Dependent Resistors (LDRs) for more sophisticated optical reception.
  • Improve โฑ๏ธ timing accuracy with hardware-based PWM signals.
  • Enhance ๐Ÿ“ˆ data rate and efficiency by optimising transmission protocols.

About

Experience an innovative light-based messaging system using STM development boards! โœจ This project enables seamless analog data transmission via GPIO-controlled light pulses, featuring a custom Light-of-Things (LoT) protocol with error detection and real-time LCD output. ๐Ÿš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages