Sunday 15 March 2015

Guiding Visually Challenged Using Raspberry Pi

Blindness is a state of lacking the visual perception due to physiological or neurological factors. Partial blindness represents the lack of integration in growth of the optic nerve or visual centre of the eye, and total blindness is full absence of the visual light perception. In this project, a simple, cheap and user-friendly smart blind guidance system is designed and implemented to improve the mobility of both blind and visually impaired people in a specific area.

The project includes wearable equipment comprising earphones connected to Raspberry Pi and a hand-stick containing infrared sensors circuit to help the blind person navigate alone safely and avoid any obstacles. The reflected infrared signals from an obstacle are used as inputs to Raspberry PI. Based on the direction of the received signal, Raspberry Pi prompts a message in the earphones to help take suitable action.

Circuit and working
 

  Fig. 1: Pin description of

  GPIO header


Fig. 1 shows the pin description of a GPIO connector on Raspberry Pi. The GPIO connector has pins with different functions. The device has seven true GPIO pins, I2C interface, SPI interface, serial TX/RX pins and PWM pins that can be used to control external hardware.


Fig. 2 shows the circuit diagram of the sensor section. It comprises quad operational amplifier LM324 (IC1), three IR transmitter-receiver pairs and a few easily available components. The sensor section is connected to the GPIO pins of Raspberry Pi as shown in Fig. 2. This section gets the power for operation from Raspberry Pi itself.
The IR transmitter-receiver pairs are mounted on the left, front and right side of the hand stick and they transmit IR signals regularly. The corresponding receiver receives back the signal if it is reflected by some obstacle in that particular direction. The received signal is fed to corresponding operational amplifier of IC1. Output of each operational amplifier is limited to 3.3V by zener diodes. The Raspberry Pi detects the direction from which the signal is received and issues suitable audio message to the earphones to help avoid the obstacle. The accompanied table mentions all the messages. Presets VR1 through VR3 are used to set the reference levels for comparators A1, A4 and A3.


Fig. 2: Circuit diagram of the sensor section

The person who is wearing the earphones gets the suitable commands to take necessary action. One such example is, if there is obstacle in all the directions, the user gets a message ‘better to go back’ through the earphones connected to the Raspberry Pi.

Software
 


Before you follow the software installations, ensure that your Raspberry Pi is already setup with Raspbian ‘wheezy’ operating system. You can refer ‘Getting Started with Raspberry Pi’ published in April 2013 issue to set up the Raspberry Pi. Now all you need is a network connection on Raspberry Pi to install all the software. Refer ‘Set up Network for Raspberry Pi’ published in May 2013 issue for getting the network connection up on your Raspberry Pi. Once done, you can either connect a keyboard and a display to Raspberry Pi and start following the installations using LxTerminal or you can access Raspberry Pi remotely using SSH and execute all the commands directly.


Festival text-to-speech installation. The Festival Speech Synthesis System is a general-purpose multi-lingual speech synthesis system used here to direct the visually challenged person to take the right path. Festival is designed to support multiple languages, and comes with support for English (British and American pronunciation), Welsh and Spanish. Voice packages exist for several other languages, such as Castilian Spanish, Czech, Finnish, Hindi, Italian, Marathi, Polish, Russian and Telugu.

First update and upgrade the Raspberry Pi related software using the commands below and reboot your Raspberry Pi for a fresh look:

$ sudo apt-get update
$ sudo apt-get upgrade

To install sound on Raspberry Pi, you need to install ‘alsa’ sound utilities using the command below. Refer Fig. 3.

$ sudo apt-get install alsa-utils

Now edit the module file at ‘/etc/modules’ using nano editor. For that, run the command below to open the file in nano editor and add ‘snd_bcm2835.’ Refer Fig. 4 and Fig. 5.

$ sudo nano /etc/module

If ‘snd_bcm2835’ line is already present, leave the file as it is. Once done, save the file by ‘CTRL+O’ and exit by ‘CTRL+X.’

Now install the mplayer audio/movie player by command mentioned below:

$ sudo apt-get install mplayer

To sort out the mplayer error message, edit file ‘/etc/mplayer/mplayer.conf’ using nano editor and add ‘nolirc=yes.’ Refer Fig. 6 and Fig. 7.

$ sudo nano /etc/mplayer/mplayer.conf

Once you have completed all the steps mentioned above, you can install Festival text-to-speech using the command below:

$ sudo apt-get install festival

You can try out Festival installation using the command below in the terminal and you will hear ‘Hello EFY’ in the earphones.

$ echo “Hello EFY” | festival --tts

Python GPIO module for Raspberry Pi. The code is written in Python programming language and compiled using Python in the Raspberry PI. Python comes as a built-in package for the Raspberry Pi and we only need to install the GPIO package modules.

Fig. 3: Install alsa-utils

Fig. 4: Open module file in nano editor

Fig. 5: Add ‘snd_bcm2835’ in the file

Fig. 6: Open mplayer configuration file
Download the ‘RPi.GPIO-0.1.0.tar.gz’ from ‘http:// pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.1.0.tar.gz’ and extract into a suitable directory using the command:

$ tar -zxvf RPi.GPIO-0.1.0.tar.gz

 
  Fig. 7: Add ‘nolirc=yes’ to the file
Now use ‘cd’ command to go inside the extracted directory and install the package using:

$ sudo python setup.py install

Once the package is installed, download the source code in a suitable directory and run it using:

$ sudo python filename.py

No comments:

Post a Comment