Smart Blind Stick With Bharath Pi

by bharatpi in Circuits > Arduino

423 Views, 2 Favorites, 0 Comments

Smart Blind Stick With Bharath Pi

maxresdefault.jpg

Blind peoples have to face many challenges in their life, one of them is finding their way on the streets. On the streets, there are so many vehicles and obstacles that may block their way and also may injure them. So keeping this problem in mind we developed a Smart blind stick that scans for the obstacles in front of it with the help of an ultrasonic sensor.

Supplies

WhatsApp Image 2023-08-01 at 10.00.37.jpg

Components Needed:

  1. Bharath Pi
  2. Ultrasonic distance sensor (e.g., HC-SR04)
  3. Buzzer module

Software apps and online services

We are going to use Arduino IDE for programming the Bharat Pi. The Bharat Pi can be connected using a USB Type-C connector. Serial drivers are required to be installed for the detection of Bharat Pi. You can download the serial drivers from this depending on the operating system.

·      Arduino IDE

·      CH341 serial drivers for Bharat Pi

Story

WhatsApp-Image-2020-10-25-at-3.25.11-PM-600x600.jpg
61VoC1mAJfL._SL1500_.jpg

Smart Blind Stick

  • The Smart Blind Stick scans the path in front of it with the help of an HC-SR04 Ultrasonic sensor.
  • Whenever the sensor detects any object in its path the buzzer starts beeping .
  • The blind person can hear the beeping of the buzzer and manage to change the way. In this way, the person can easily find his way without getting injured.
  • This smart stick works in the same way as the Ultrasonic range finder did. You can also see the real-time values of the distance in cm on the Arduino serial monitor.

What is Bharat Pi:

  • In this project, we are using Bharat Pi which has both ESP32 microcontroller and a SimCom A7672S 4G/LTE module.
  • Bharat Pi is an IoT prototyping board for students, innovators, startups, and developers. A simplified board with an all-in-one compute, network and storage on a single board to build rapid prototypes.
  • Bharat Pi bundles the power of ESP32, 4G/LTE module in a Arduino form factor. This makes Bharat Pi compatible with all Arduino and ESP32 programs and shields
  • Wireless monitoring can be done using WiFi or with a Sim based 4G/LTE connectivity.
  • Bharat Pi is a rugged board with good quality and could be used even for production and live customer deployments!.


Connection Diagram

WhatsApp Image 2023-08-01 at 10.00.39.jpg
Untitled Diagram (3).jpg
  • please make the connections according to the given Smart blind stick circuit diagram.
  • Attach the 5-volts and GND pins of the Bharath pi to the VCC and GND pins of the ultrasonic sensor.
  • Connect the TRIG and ECHO pins of the ultrasonic sensor with the 33 and 32 pins of the Bharath Pi.
  • Join the positive and negative wire of the buzzer with the digital-5 and GND pins of the Bharath Pi.



Code

#define TRIG_PIN 33
#define ECHO_PIN 32
#define BUZZER_PIN 23


void setup() {
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  Serial.begin(115200);
}


void loop() {
  long duration, distance_cm;
 
 
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
 


  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);
 
  // Measure the echo pulse duration
  duration = pulseIn(ECHO_PIN, HIGH);
 
  // Calculate the distance in centimeters
  distance_cm = duration * 0.034 / 2;


  // Print the distance to the serial monitor
  Serial.print("Distance: ");
  Serial.print(distance_cm);
  Serial.println(" cm");


  // Check if an object is within a certain distance (adjust the threshold as needed)
  if (distance_cm < 25) {
    // Object detected, activate the buzzer
    digitalWrite(BUZZER_PIN, HIGH);
    delay(500);  // Buzzer ON time (adjust as needed)
    digitalWrite(BUZZER_PIN, LOW);
    delay(500);  // Buzzer OFF time (adjust as needed)
  } else {
    digitalWrite(BUZZER_PIN, LOW); // Turn off the buzzer
  }


  delay(100); // Adjust the delay as needed to control the sensor update rate
}


Code Explanation

Screenshot 2023-08-01 101136.png
  1. The code sets up three pins (TRIG_PIN, ECHO_PIN, and BUZZER_PIN) and initializes the serial communication for debugging purposes (optional).
  2. In the loop() function, it performs the following steps:
  • Sends a trigger signal by setting TRIG_PIN to LOW, then waiting for a short duration, and then setting it HIGH for a brief period (10 microseconds) before setting it back to LOW. This triggers the ultrasonic sensor to send out an ultrasonic pulse.
  • Measures the duration of the echo pulse using the pulseIn() function. This duration corresponds to the time it takes for the ultrasonic pulse to bounce off an object and return to the sensor.
  • Calculates the distance in centimetres using the speed of sound formula. The speed of sound in air is approximately 343 meters per second or 0.0343 cm/microsecond. We divide the duration by 2 because the sound travels to the object and back.
  1. The code then prints the measured distance to the serial monitor (optional) for debugging purposes.
  2. It checks if an object is within a certain distance (here, less than 25 cm). If an object is detected within this threshold distance, the buzzer is activated for a short period (500 milliseconds in this example) and then turned off for the same duration. This creates an alternating ON/OFF pattern for the buzzer.
  3. The delay(100) at the end of the loop provides a brief pause between sensor updates. You can adjust this delay based on how frequently you want the sensor to update.


Applications

The application of the smart blind system using ultrasonic sensors and a buzzer is to enhance the functionality and accessibility of traditional window blinds. The system can be used in various scenarios to provide the following benefits:

  1. Obstacle Detection: The ultrasonic sensor helps detect objects or obstacles near the window or blind. This is particularly useful for ensuring the safety of the blinds and preventing damage or entanglement with objects that may be in the blind's path.
  2. Automated Blinds: The system allows for automated control of the blinds based on the presence of objects or distance measured by the ultrasonic sensor. When an object is detected within a specific range, the blinds can be automatically opened or closed, depending on the application and user preferences.
  3. Energy Efficiency: By automating the blinds based on the presence of objects, the system can help maintain a comfortable indoor environment by regulating the amount of sunlight entering the room. This can lead to energy savings by reducing the need for artificial lighting or air conditioning.
  4. Accessibility: The smart blind system can be especially beneficial for individuals with mobility or visual impairments. The automation and obstacle detection capabilities enable easy and safe control of the blinds without the need for physical interaction.
  5. Security: The system can be integrated with a home automation setup to enhance security. For example, the blinds can be set to automatically close when the homeowner is away, providing an extra layer of privacy and security for the property.
  6. User Customization: The system can be programmed and customized to suit the user's preferences and needs. Users can set different distance thresholds for triggering the blinds or adjust the buzzer's behavior based on the specific application.
  7. Smart Home Integration: The smart blind system can be integrated into a larger smart home ecosystem, allowing users to control the blinds remotely through smartphones or voice commands via virtual assistants like Amazon Alexa or Google Assistant.