Jack DoughtyTj Gaia
Published

Assistive walking stick for the blind MEGR 3171

Our goal is to make an updated version of the standard cane for the blind.

AdvancedWork in progress63
Assistive walking stick for the blind MEGR 3171

Things used in this project

Hardware components

Sharp Analog IR Distance Sensor
×1
Elegoo water level sensor
×1
Power bank
×1
Fling Golf Stick
×1
Breadboard (generic)
Breadboard (generic)
×2
Elegoo Small sound module
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1

Software apps and online services

ThingSpeak API
ThingSpeak API
Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

Prusa Mk3s

Story

Read more

Custom parts and enclosures

Fling stick Insert

This is a custom insert used on the end of a fling golf stick so we could mount the sensors on an appropriately lengthed stick for testing. Fling sticks are expensive and we would reccomend using a cheaper broom handle but the fling stick is lighter and better suited for people with hand/wrist issues

Schematics

Circuit diagram for the sensor argon

this is the breadboard setup for the lower end, it is to show appropriate setup for the argon.

Code

Argon 1 (sensor end) code

C/C++
This is the argon code for the argon at the lower end of the stick, you flash the code to the argon using the Particle website.
#include <math.h>;

SYSTEM_THREAD(ENABLED);

int led = D7;
int waterSens = A4;
int objectSens = A0;


double counts =0;
double inches =0;
double filterinch=0;
double filtercount=0;
double filterconstant=16; //increase this term in increase filtering.  0 = no filtering.. 60 = good,do not get too high or you get bad data and errors from rounding
double waterVal=0;

void setup() {
    
Particle.subscribe("OBJ", objectBlink , MY_DEVICES);
Particle.subscribe("WATER", waterBlink , MY_DEVICES);    
    
Particle.variable("counts",counts);
 Particle.variable("filtercounts",filtercount);
 Particle.variable("inches",inches);
 Particle.variable("filterinch",filterinch);
 Serial.begin(230400);
 pinMode(led,OUTPUT);
 pinMode(waterSens,INPUT);
 pinMode(objectSens,INPUT);
}

void loop() {
int dataAlpha = 0;
 counts = analogRead(A1);
 waterVal = analogRead(A4); //read the water sensor
 //calibration entered from excel spreadsheet.
 //inches = 0;
 inches = 0.000002*pow(counts,2) - 0.010653*counts + 20.976001;

 
// filterinch = ((filterinch*filterconstant)+inches)/(filterconstant+1);
// filtercount = ((filtercount*filterconstant)+counts)/(filterconstant+1);
 
 Serial.print("counts");
 Serial.print(counts);
 Serial.print(" filtercounts ");
 Serial.print(filtercount);
 Serial.print(" inches ");
 Serial.print(inches);
 Serial.print(" filterinches ");
 Serial.println(filterinch);
 Serial.print(" water value ");
 Serial.print(waterVal);
 delay(200);
 
 
  
  
 if(counts>=2000){
      // Send a publish to your devices...
    counts = (counts/482.6);
    Particle.publish("objDetected",String(counts));
    //dataAlpha = 0.000002*pow(counts,2) - 0.010653*counts + 20.976001;
    //Particle.publish("distTest",String(dataAlpha));
        // And flash the on-board LED on and off.
        digitalWrite(led,HIGH);
        delay(500);
        digitalWrite(led,LOW);
        //delay(30000);
 }
 
 
//tring level = String(waterVal);
 
  
  if (waterVal>400){
    Particle.publish("waterDetected",String(waterVal));
     
        //delay(30000);
}
}
 
void objectBlink(const char *event, const char *data) {
 // (strcmp(data, "Object Detected")){
    digitalWrite(led,HIGH);
        delay(500);
        digitalWrite(led,LOW);
//}
}

void waterBlink(const char *event, const char *data) {
 
     digitalWrite(led,HIGH);
        delay(100);
        digitalWrite(led,LOW);
        delay(100);
        digitalWrite(led,HIGH);
        delay(100);
        digitalWrite(led,LOW);
}

Argon 2 (handle end) Code

C/C++
This is used for the handle end argon to retreive signals from the particle IOT cloud and use them to tell when to beep.
int led = D7;
int buzzerPin = A4;


void setup() {

 pinMode(led,OUTPUT);
 pinMode(buzzerPin,OUTPUT);

Particle.subscribe("objDetected", objectBuzz , MY_DEVICES);
Particle.subscribe("waterDetected", waterBuzz , MY_DEVICES);
Particle.subscribe("OBJ", objectBlink , MY_DEVICES);
Particle.subscribe("WATER", waterBlink , MY_DEVICES);    

}

void loop() {
}

void objectBuzz(const char *event, const char *data) {
 // (strcmp(data, "Object Detected")){
    Particle.publish("OBJ","Yes");
    tone(buzzerPin, 1050, 1000);
    delay(1500);
}
//}


void waterBuzz(const char *event, const char *data) {

Credits

Jack Doughty

Jack Doughty

1 project • 1 follower
Tj Gaia

Tj Gaia

0 projects • 1 follower

Comments

Add projectSign up / Login