Difference between revisions of "S16: Simpsons"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Hardware Interface)
(Hardware Interface)
Line 372: Line 372:
 
<Figure should appear here>
 
<Figure should appear here>
  
The haptic driver DRV2605L is interfaced to SJONE board using I2C protocol through 3 wires namely Serial clock (SCL), serial data lines (SDA) and common ground. The vibration DC motor is connected to haptic driver through its differential output lines.  
+
The haptic driver DRV2605L is interfaced to SJONE board using I2C protocol through 3 wires namely Serial clock (SCL), serial data lines (SDA) and common ground. The vibration DC motor is connected to haptic driver through its differential output lines.
 
 
 
 
<Figure should appear here>
 
  
 
==== Software Design ====
 
==== Software Design ====

Revision as of 17:36, 18 May 2016

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

Smart Walking Cane for Blind

Abstract

We are proposing an IoT device that helps the blind. We have developed a blind stick which provides vibration feedback on getting any information about the obstacles around the stick. Such a device would help a lot of blind people who need obstacle assistance in daily life. This device would include some ultrasonic obstacle sensors and a laser sensor to ignore the ground as an obstacle. The handle of the stick would provide a vibration feedback if it detects any obstacle. This feedback would not be a simple feedback. There would be vibrators installed on three sides of the handle. If the stick detects an obstacle on the left side, the stick handle would vibrate from the left side and similarly for the center and right side. This would help the user to react to these situation properly. Apart from this major feature, we have proposed two important features. One of which is a key locator and the other is an automatic messaging system. The key locator would help the blind person to find the bunch of keys wherever they are in the house. The other feature is an automatic messaging system which would send a message when a panic button is pressed. This button would be pressed when the user feels there is some kind of danger and need to send a message to close people.

Objectives & Introduction

Show list of your objectives. This section includes the high level details of your project. You can write about the various sensors or peripherals you used to get your project completed.

Team Members & Responsibilities

  • Akshay Kanchar
    • Key Locator
    • Hardware
  • Arvind Allawadi
    • GSM module
  • Bhushan Muthiyan
    • Haptic feedback
    • Treasurer
  • Gaurao Chaudhari
    • Sensor Interfacing and Algorithm
    • Hardware and PCB designing
  • Keerthana Alugudurai
    • Haptic feedback

Schedule

Sl. No Start Date End Date Task Status Actual Completion Date
1 04/05/2016 04/12/2016 1) Buying of blind stick and other important components
2) Development and Design of Software and Hardware Architecture
Completed 04/11/2016
2 04/12/2016 04/19/2016 1) Interfacing Sensors,Vibrators,Buttons and GSM with SJ One Board
2)Developing basic functionalities for Sensors and Vibrators
Completed 04/20/2016
3 04/19/2016 04/26/2016 1) Interfacing,implementation and integration of GSM module
2) Implementation of Key Locator functionality
Completed 04/28/2016
4 04/26/2016 05/03/2016 Completing Integration of all modules and testing basic obstacle avoidance and haptic feedback Completed 05/05/2016
5 05/03/2016 05/10/2016 Testing and resolution of Problems Completed 05/12/2016
6 05/10/2016 05/17/2016 Final testing In Progress

Parts List & Cost

Sr. No Part Name Source of Purchase Part Number Quantity Cost($)
1 SJOne Board Preet 2 $80
2 PCB Designed by Self, Delivered by OSH Park 1 $35
3 Haptic Motor Driver Bhushan Write drv2605 3 Bhushan Write
4 Haptic Vibrator Bhushan Write Bhushan Write 5 Bhushan Write
5 Ultrasonic Sensors Amazon.com HC-SR04 5 $10
6 5V Battery Self 1
7 Buzzer Akshay Write Akshay Write 1 Akshay Write
8 Nordic Antenna Akshay Write Akshay Write 2 Akshay Write
9 GSM Module Amazon.com SIM900 1 $30
Total =

Design & Implementation

PCB Design

As we went ahead with the development of the hardware of system, the hardware was becoming more complex and then we decided that we need to design a PCB and order it. This way we were able to accommodate all the modules using the single PCB. The PCB made it much more easy to interface different peripherals and make it work. We have used PCB for all the modules our project. The sensors has its connection and the key locator, GSM module have jumpers to be connected to the PCB.

PCB Design Description

Following are the different modules to be connected to the PCB.

1) Ultrasonic Sensor

2) Laser Sensor

3) Haptic Vibrator motors

4) GSm Module

5) Key locator Buttons

6) Panic Message Buttons

PCB Schematic

Blind Stick Schematic

PCD Board

Blind Stick Board Image

Sensor Obstacle avoidance

When a blind person travels along the path, there can be a lot of obstacles on his/her way. One of the ways to avoid those obstacles is the ultrasonic sensor obstacle avoidance. These ultrasonic sensors detects obstacles in its 250 cms of distance. This distance varies depending on the make of the sensors. The sensors which we are using are HC-SR04 and the largest distance they can detect is 250 cms. There are other sensor manufacturers also which detect distances which are much more than the distance detected by HC-SR04. In our case, we have chosen HC-SR04 because we just needed sensors which would work for nearby obstacles which are way less than 250 cms. The average ranges of obstacles were hardly around 100 cms.

Hardware Design

HC-SR04 ultrasonic sensor

We have used ultrasonic sensors HC-SR04. These are the sensor which can detect any interference in the distance of 250 cms. If there are no obstacles in the given distance, the sensor provide the maximum distance as the default distance. Following are some of the specifications of these sensors.

1) HC-SR04 has four pins and following are the 4 pins and their description

   a) VCC         - 
   b) Trigger     - 
   c) Echo        - 
   d) GND         - 

2) Working principle

   a) The working principle of any ultrasonic sensor is the same that is sending some signal and getting the reply of that signal.
   b) Following are the steps of how the ultrasonic sensor works.
         i. Connect the VCC and GND pins to 5V power supply and GND to GND pin.
        ii. Connect Trigger to a GPIO pin and the Echo pin to an interrupt handler GPIO pin.
       iii. After the connection are done and verified, send a trigger pulse from GPIO Trig pin. The pulse should be a minimum of 10us and maximum can be anything.
        iv. When a trigger pulse is sent to the sensor, the sensor emits a string of 8-10 KHz pulses from the sensor head 
         v. These sensor trigger pulses gets reflected back if there is no obstacle. If there are obstacles, the longest distance is considered, and if there are any obstacles, the Echo pin would return a 10us pulse to the GPIO interrupt pin.
        vi. Getting the time difference between the pulse was sent and when the interrupt receives, the total time between the sending and receiving can be calculated. This time would help get the distance of the object.
3d printed models
Sensor interfacing with controller

Hardware Interface

Software Design

Software Modules
Relation of Software Modules
Software flow diagram

Implementation

Sensor Avoidance Algorithm
Algorithm
Algorithm diagram

Problems in interfacing and obstacle detection

Key Locator

Hardware Design

A in-built Nordic wireless is used for board to board communication.The transceiver used is nRF24L01+ Single Chip 2.4GHz Transceiver. Figure() shows the connection of the transceiver with the SJ One controller.

<Figure should appear here>

The boards communicate via 2.4 GHz RP-SMA Duck antennas. Figure() shows the connections of these antennas.

<Figure should appear here>

Hardware Interface

The hardware interface is fairly simple. A small 5V battery powers key via its on board 5V pins.The antenna is connected to the SJ One board via its SMA connector.The Nordic wireless has the following connections with the controller. SPI bus is used for communication between them.

< table should appear here>

Software Design

The software design is divided into two parts:

1) Key Transmitter : A Free-RTOS task is used to detect key press by the user.

2) Key Receiver  : A Free-RTOS task is used to detect signal received on the Cane.On receiving the signal, a call is made to the sound buzzer.

Implementation

<Figure containing steps will appear here>

GSM Module

This module consist of a GSM/GPRS Sim900 modem and a press button (panic button) mounted on the stick. This GSM modem accepts a full size SIM card and can communicate using AT (Attention) commands sent from the micro controller (LPC 1758, SJone board) through UART interface at a baud rate of 115200 bits per seconds. This module requires 5 volts in order to work properly. In an emergency situation, the stick owner must press this button which will send an SMS to a registered user to take care of the blind person.

There are two led's on the modem, namely power and sync. Once the 5 volt power supply is given, the power light will turn on, and the sync led will start blinking as well. However, this sync led is very useful during testing and making sure that the SIM card has been registered on the network. If the SIM card has not been registered on the network, and/or not been inserted into the modem yet, the sync led will blink at a rate more than once every second. After the SIM card is registered the rate of blinking reduces to as low as once every three seconds.

Hardware Design

The hardware design for this module includes a GSM/GPRS Sim900 module and a switch both connecting to a common SJ one micro controller. Below is the figure of the SIM900 module from the front and the back side. Sim card is inserted at the back side of the GSM modem.

File:CmpE244 S16 T1 GSM module front.jpg

Hardware Interface

The communication protocol of GSM module with the controller is through UART which requires four wires to establish a serial communication- Rx, Tx, Ground and Vcc. Figure() shows the connection of the GSM module with the SJ One controller.

<Figure should appear here>

A switch used as a panic button will be used as an interrupt to the controller board's GPIO pin, which will initiate the routine to send the AT commands to the GSM module necessary for sending SMS to a cellular phone.

<Figure should appear here>

Software Design

The software design for this module will include only a panic task. This task will monitor if a stick owner has pressed the panic button or not. If the button is pressed, then the controller will send a set of AT commands required to enable GSM module to an SMS mode and be able to send a desired SMS to the cellular phone.

The essence of writing code for the GSM module is the proper usage of AT commands provided by the GSM manufacturer. GSM modem understands the AT commands, which are used as a prefix with every command send to it and followed by a carriage return (\r character from the controller). The SIM900 modem implements the combination of GSM07.05, GSM07.07, V.25ter, and the AT commands developed by SIMCom. Syntactically, AT commands can be split into three categories, but the most used ones, that are also used for this project are: basic and extended.

Basic AT commands: These are the commands which are used to do basic operations such as Dial (ATD), Answer (ATA), Hang up (ATH), etc which are also used for dial-up modems.

Extended AT commands: Besides the basic commands set there are commands which are specific to the GSM technology. These commands can be used to read, write, delete, and send the SMS. These commands can operate in different modes such as test, read, write, and execution mode. All the extended commands starts with AT and ends with carriage return.


Configure the GSM module for sending SMS:


a) Sending to a single subscriber (one message)

1. AT<Carriage Return>. A response of OK means that connection between controller and modem is working fine.
2. AT+CMGF=1. This tells the modem that the text mode for the SMS should be used, where as the other mode, PDU, can be set by setting the value to 0.
3. AT+ CMGS= "1530*****61" <Carriage Return> =>message <ctrl-z>. This is the format for sending an SMS by using +CMGS command.

b) Sending to multiple subscribers

It will be a choice for a stick-owner to choose if he has to send an emergency message to a single person, or there is more than one person to whom he wants to issue the message. In case of multiple senders, sending using +CMGS is not as efficient, as it may take upto a min. from the time blind person presses the panic button to the time it reaches to his 4th friend. In case of issuing the same message to multiple cell phones, sending a message from storage is more efficient. Below is the sequence of the AT commands from sending from SIM storage.
1. AT
2. AT+CMGF=1. For SMS mode
3. AT+CPMS="SM","SM". Format for +CPMS is +CPMS=storage1[,storage2[storage3]]. Messages are read and deleted from storage1. Messages are written to storage2. Storage3 defines the memory location to store the received messages. However, if we are not concerned with receiving text, we can ignore this optional parameter.
4. AT+CSCA="+12063130004”. This AT command is to set the SMSC address to where the messages are sent first and dispatched for the destination number. For T-mobile network this number is +12063130004. This # can be found from the cell phone in the message settings.
5. AT+CMGW="1530*****61",129,"STO UNSENT" <Carriage Return> Message <ctrl-z>. This AT command writes the messages to the memory space provided in the above +CPMS command. Second and third parameters are optional. First parameter is the destination number which is stored along with the message as well. Important point to note is that the message required to be written to the SIM only once. Once the message has been written to the particular index, this write function may not be required to call.
6. AT+CMSS=1,"1530*****61". +CMSS is used to send a message from the storage. First parameter of +CMSS is the index of the memory location from where to send the message. Second parameter is to where to send the message.

Other useful AT commands that were used during the testing as well as for the final code sequence of the AT instructions:

1. AT+CSCS = "GSM". SIM900 defaults to IRA character set. This AT command change it to GSM character set.
2. AT+CMEE = 2. This command is used to get the indication of an error related to the ME functionality. Parameter 2 enables the +CME error in verbose form. For example, +CME error: sim is not inserted. However, 0 parameter value is default and used to disable +CME error, only 'error' is displayed in case of some error.
3. AT+CREG=2;AT+CREG=?. This command is used to tell whether the SIM card is registerd on the network. parameter 2 we get the registration result with the location information.
4. AT+CMGR=1;AT+CMGD=1,4. +CMGR is used to read the messages from the memory storage. Whereas, +CMGD is used to delete messages from the storage. First parameter is the index of the memory location in both instructions, however parameter 4 in +CMGD implies to delete all the messages. Other parameters (0-4) can be used as per requirement.
5. AT + CPIN?. This command may come handy when for example your sim requires a password. For us, we got the response READY, indicating that SIM is good to use, and has no kind of passwords, such as SIM PIN or SIM PUK.
6. AT+CMGD=?. This command responds about the list of supported indexes and the list of supported flags, then OK. For example, I would get the response as +CMGD: (1-30),(0-4), which means that I can assign any index value from 1 to 30 for my SIM memory to store messages, and it supports all five flag values defined in the Sim specification.

Implementation

<Figure containing steps will appear here>

Haptic Feedback

This module consist of a haptic vibrator.

Hardware Design

<Figure should appear here>

The hardware design for haptic feedback consists of haptic driver DRV2605L and Precision Haptic 10 mm Linear Resonant Actuator. The low voltage and flexible haptic driver is used to control LRA (Linear Resonant Actuator) and ERM (Eccentric Rotating Mass) type of motors. This driver removes the difficulty of altering the PWM signal by providing a huge haptic library that can produce 127 different vibration patterns on the motors. The IN/TRIG pin provides external trigger control of the GO bit that launches the desired waveforms. The LRA based motor has excellent haptic characteristics and can vibrate with various amplitude, frequency and effects based on the input.

Hardware Interface

<Figure should appear here>

The haptic driver DRV2605L is interfaced to SJONE board using I2C protocol through 3 wires namely Serial clock (SCL), serial data lines (SDA) and common ground. The vibration DC motor is connected to haptic driver through its differential output lines.

Software Design

Implementation

<Figure containing steps will appear here>

Testing & Technical Challenges

Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.

Include sub-sections that list out a problem and solution, such as:

My Issue #1

Discuss the issue and resolution.

Conclusion

Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?

Project Video

Upload a video of your project and post the link here.

Project Source Code

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

Nordic Wireless [1]

Appendix

You can list the references you used.