Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🌬️ RespTalk - Breath Controlled Assistive Interface (BCAI)

RespTalk is a low-cost Breath Controlled Assistive Interface (BCAI) designed to help people who are paralyzed, unable to speak, but fully conscious communicate their essential needs using only their breathing.

Instead of relying on speech or physical movement, the user generates short and long breaths, similar to Morse code. These breath patterns are detected by a piezoelectric sensor, processed through an analog signal conditioning circuit, and interpreted by an ATmega328P microcontroller into predefined words such as Food, Water, Emergency, Medicine, Yes, and No.

The recognized message is immediately displayed on an LCD screen and confirmed using an audible buzzer, allowing caregivers or family members to understand the user's request quickly.

⚠️ Educational Purpose Only

This project was developed as an educational and research prototype to demonstrate how simple electronic circuits and embedded systems can provide an affordable communication method for individuals with severe speech and motor impairments. It is intended as a proof-of-concept and not as a certified medical device.


🚀 Features

  • Breath-based communication
  • Morse-code inspired input method
  • Piezoelectric breath sensor
  • LM324 analog signal conditioning
  • Dual-threshold breath detection
  • ATmega328P standalone implementation
  • 16×2 I2C LCD message display
  • Audible confirmation using buzzer
  • Low-cost hardware design
  • No internet or external computer required
  • Portable embedded system

❤️ Why RespTalk?

Many patients suffering from conditions such as:

  • Locked-in Syndrome
  • ALS (Amyotrophic Lateral Sclerosis)
  • Severe Paralysis
  • Stroke
  • Neuromuscular Disorders
  • Temporary speech disabilities

remain mentally conscious but lose the ability to communicate verbally.

RespTalk provides an inexpensive communication alternative using one ability many of these patients still retain:

Controlled breathing.

By recognizing different breathing durations, the system enables users to communicate basic daily needs without requiring cameras, complex sensors, or expensive eye-tracking systems.


🏗️ System Overview

The complete system consists of four stages:

  1. Breath Detection
  2. Analog Signal Conditioning
  3. Pattern Recognition
  4. Message Display

Workflow:

User Breath
      │
      ▼
Piezoelectric Sensor
      │
      ▼
LM324 Signal Conditioning
      │
      ▼
Comparator Outputs
      │
      ▼
ATmega328P
      │
      ▼
Breath Pattern Recognition
      │
      ▼
LCD + Buzzer

🌬️ Working Principle

The user blows air onto a piezoelectric disc.

The piezo sensor converts the air pressure into a small electrical signal.

Since the generated signal is very weak and noisy, it is processed using multiple LM324 operational amplifiers.

The analog circuit performs:

  • Signal amplification
  • Rectification
  • Envelope detection
  • Threshold comparison

Finally, two comparator outputs are sent to the ATmega328P.

The Arduino program measures how long the breath lasts.

Based on the duration:

Duration < 1 second
        ↓
Short Breath (.)

Duration ≥ 1 second
        ↓
Long Breath (-)

Every three breaths form one command.


🧠 Breath Pattern Recognition

RespTalk uses a Morse-code inspired communication method.

Each command consists of three breath symbols.

Example:

Short Breath = .

Long Breath = -

Pattern example:

.-.

After receiving three breaths, the microcontroller compares the sequence against predefined commands and displays the recognized word.


📖 Supported Commands

Breath Pattern Meaning
.-. FOOD
.-- WATER
--- EMERGENCY
-.- TOILET
--. MEDICINE
... YES
-.. NO

Morse Mapping

Pattern Mapping


🔬 Signal Conditioning Circuit

The analog front-end is built using the LM324 Quad Operational Amplifier.

Its purpose is to convert the weak piezo sensor signal into clean digital pulses suitable for the microcontroller.

The stages include:

Stage 1 – Signal Amplifier

Amplifies the tiny voltage generated by the piezoelectric sensor.

Stage 2 – Precision Rectifier

Converts both positive and negative signal components into a usable positive waveform.

Stage 3 – Envelope Detector

A diode-capacitor network extracts the signal envelope, representing breath intensity over time.

Stage 4 – Dual Comparator

Two comparator thresholds generate digital outputs indicating:

  • Breath Start
  • Breath End

This dual-threshold method improves detection reliability and reduces false triggering caused by noise.


⚙️ Software Working

The ATmega328P firmware continuously monitors the two comparator outputs.

The software logic works as follows:

  1. Wait for the upper comparator to detect the beginning of a breath.
  2. Start timing using millis().
  3. Wait until the lower comparator indicates the end of the breath.
  4. Measure the breath duration.
  5. Classify the breath as:
    • Short (.)
    • Long (-)
  6. Store the symbol.
  7. After collecting three symbols, compare them with the predefined command table.
  8. Display the corresponding message on the LCD.
  9. Activate the buzzer for valid commands.
  10. Automatically reset after an idle timeout.

This approach makes the system simple, deterministic, and computationally lightweight.


🏛️ System Architecture

Breath
   │
   ▼
Piezo Disc
   │
   ▼
LM324 Analog Processing
   │
   ├──────── Comparator 1
   └──────── Comparator 2
            │
            ▼
ATmega328P
      │
      ├── LCD Display
      └── Buzzer

🔌 Hardware Setup

Components Used

  • ATmega328P (Standalone)
  • LM324 Quad Operational Amplifier
  • Piezoelectric Disc Sensor
  • 16×2 I2C LCD Display
  • PCF8574 I2C LCD Backpack
  • 16 MHz Crystal Oscillator
  • 22 pF Capacitors ×2
  • 10 kΩ Reset Pull-up Resistor
  • 4.7 kΩ Pull-up Resistors ×2 (SDA & SCL)
  • 1N4148 Diode
  • Potentiometer (Sensitivity Adjustment)
  • Buzzer
  • Push Button (Reset)
  • 5V Regulated Power Supply

I2C LCD Connection

RespTalk uses a 16×2 LCD with an I2C backpack (PCF8574) to minimize the number of microcontroller pins required.

The LCD communicates using the I2C bus:

  • SDA → A4
  • SCL → A5

To improve communication reliability, 4.7 kΩ pull-up resistors are connected from both SDA and SCL lines to +5V.

These pull-up resistors help:

  • Stabilize I2C communication
  • Improve signal integrity
  • Prevent floating bus lines
  • Ensure reliable LCD operation over longer wiring distances

Although many commercial I2C LCD modules already include pull-up resistors, adding external 4.7 kΩ pull-ups is recommended when building a standalone ATmega328P circuit or when the onboard pull-ups are absent.

ATmega328P Standalone Circuit

ATmega Circuit


LM324 Signal Conditioning Circuit

LM324 Circuit


Hardware Prototype

Prototype


📊 Breath Detection

The comparator outputs produce digital pulses corresponding to the detected breathing duration.

The firmware measures the pulse width to distinguish between short and long breaths.

Comparator Output

Waveform


💻 Serial Monitor Output

During development and testing, the recognized breath sequences can be monitored through the serial terminal.

Example:

Breath detection started...

Short breath (.)
Long breath (-)
Short breath (.)

Recognized: FOOD

Serial output:

Serial Monitor


🎥 Demonstration

Video demonstration:

Click Here For Demo


📂 Project Structure

RespTalk/
│
├── firmware/
│   └── bcai.ino
│
├── circuit/
│   ├── arduino_circuit.jpg
│   └── lm324_filter_crkt.png
│
├── assets/
│   ├── thumbnail.png
│   ├── prototype.jpg
│   ├── morsecode_mapping.jpg
│   ├── short-deep-breathplot.jpg
│   ├── sim_serialmonitor.jpg
│
└── README.md

The project structure may evolve over time. Refer to the repository tree for the latest structure.


⚙️ Getting Started

1. Clone Repository

git clone https://github.com/tecrade/RespTalk.git

cd RespTalk

2. Open Firmware

Open:

firmware/bcai.ino

using:

  • Arduino IDE
  • PlatformIO

3. Programming the Standalone ATmega328P

The RespTalk firmware is designed to run on a standalone ATmega328P rather than a complete Arduino Uno board.

The ATmega328P can be programmed using an Arduino Uno configured as an ISP (In-System Programmer).

The general programming procedure is:

  1. Upload the ArduinoISP example sketch to the Arduino Uno.
  2. Connect the Arduino Uno to the standalone ATmega328P using the SPI interface (MOSI, MISO, SCK, RESET, VCC and GND).
  3. Select Arduino as ISP from the Arduino IDE.
  4. Burn the bootloader (only required once for a new microcontroller).
  5. Upload the RespTalk firmware using Upload Using Programmer.

A detailed step-by-step tutorial with wiring diagrams can be found here:

👉 https://www.instructables.com/Program-ATmega-328-Using-Arduino-Arduino-As-ISP/

4. Upload to ATmega328P

Compile and upload the firmware using:

  • Arduino as ISP
  • USBasp
  • USB-to-Serial Adapter (if bootloader is installed)

5. Power the Circuit

Apply a regulated 5V supply to the standalone ATmega328P circuit.

The LCD should display:

RespTalk-(BCAI)
******

The system is now ready to receive breath inputs.


🎯 Applications

  • Assistive communication
  • Locked-in syndrome support
  • ALS patient assistance
  • Hospital bedside communication
  • Rehabilitation systems
  • Elderly care
  • Home healthcare
  • Embedded biomedical projects
  • Educational biomedical engineering demonstrations

🚧 Future Improvements

  • Adjustable breath sensitivity
  • Personalized breath calibration
  • Larger vocabulary
  • Mobile application integration
  • Wireless communication (Bluetooth/WiFi)
  • Voice synthesis
  • Text-to-Speech output
  • OLED or TFT graphical interface
  • AI-based adaptive breath classification
  • Battery-powered portable version

📚 Learning Outcomes

This project demonstrates:

  • Embedded Systems Design
  • Standalone ATmega328P Development
  • LM324 Analog Signal Conditioning
  • Piezoelectric Sensor Interfacing
  • Comparator Design
  • Pulse Width Measurement
  • Human-Computer Interaction
  • Assistive Technology Design
  • Biomedical Embedded Systems
  • Low-Cost Communication Devices

⚠️ Disclaimer

RespTalk is an educational prototype and is not intended to replace certified medical communication devices.

Performance depends on factors such as:

  • Patient breathing ability
  • Sensor placement
  • Ambient vibrations
  • Circuit calibration
  • Component tolerances

Further clinical validation and safety testing would be required before use in real healthcare environments.

About

RespTalk - 'Breath Controlled Assistive Interface (BCAI)' is a hardware project that helps people who are paralyzed and unable to talk but have consciousness to communicate their basic needs and replies to surrounding people using their breath

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages