Posts Tagged ‘ vibrate

BAT Hat

You always need a good  acronym when developing a new project.  BAT = “Blind Assistance Technology”.

I came up with an idea… sometime last year while working on my “Ponar” tech, to make a device that would help one navigate blindly, by sonar.  It’s been a really slow process to get this prototype off the ground:  Work\life\learning all take their time.  But I finally got something functional.  During development, other similar items have appeared on the web (a Ping\servo glove-based solution, for example).  And they’re great!  But I’ll just start out by saying this idea came to me on its own, not that others haven’t already envisioned it\implemented it (better) elsewhere.

Conceptually, it’s a device you wear on your head that can sense the world around you via ultrasonic sensors.  Based on a certain distance, motors attached to the device will vibrate, tactually telling you you’re getting close to something.  There are a total of three sensors\motors mounted on the front, and each side.

The brains are an Arduino (Uno).  Parallax Ping))) sensors are used for the ultrasonic distance readings, and vibrating DC motors from Xbox 360 controllers are used to convey the distances to the user.  The framework I used to hook everything up was an old hat, using shapelock to form brackets for the motors, Ping))) sensors, & battery pack, and zipties to hold everything else.  Originally I had a single 9v battery powering it,… but…. it made the device was unreliable.  I switched to 6xAA batteries (still 9v total), and it’s much happier now.

Parts List:

Video of my boy wearing the hat, walking around his room:
More info below the pics:

Here is a Fritzing image of how the whole thing was wired together:

And here’s a link to the Arduino code.

Project Notes:

  • After some research online, I figured out that the rumble motors I received from a friends Xbox 360 controllers only need 2v:  Originally I had a system setup with transistors driving them from the battery directly, but this realization simplified the process.  Furthermore, my multimeter claims they draw less than 20 mA, which makes them safe to be driven off the Arduino’s pins.
  • The motors are driven off PMW Arduino pins so I can vary the voltage as distance changes.  In the current configuration, they’ll start to spin as they approach items 1.5m away, and are at full velocity at 1m.
  • If I can, I’m going to pick up some pager-motors:  They shouldn’t vibrate one’s head as much as those rumble-motors 😉
  • I also have three servos:  It would be interesting to see how well one’s head could ‘detect’ their pressure.
  • I had originally powered the system with a single 9v battery.  But the Ping))) sensors and motors wouldn’t behave properly.  When connecting the Arduino over USB for debugging purposes everything worked fine… which didn’t make sense to my limited electrical knowledge:  USB is only 5v, while the battery pack was 9v.  However, my guess is that the 9v battery wasn’t providing enough current for the whole system, while the USB was.  So I switched out for a 6xAA battery pack (equaling 9v total) and everything started working properly.  Presumably however, since the Arduino/Ping only needs 5v, and the motors only 2v, a 4xAA battery system (6v) should work fine.
Final Thought:
  • Honestly, it doesn’t work as well as I envisioned when starting.  But that was a pretty high bar I set myself.  Don’t get me wrong, it works fine.  But in my head I’d have this robust system of navigating blindly.  However, with only three motors, that detect obstacles at eye level front, left, and right, you’ll still run into problems with items at knee height.  And with ultrasonic sensors, ‘fuzzy’ items like pillows don’t reflect well, and the less perpendicular you are to a surface the less likely it is to reflect the sound back.  Doubling the number of sensors\motors would be a good start.  Or additional systems hooked up to one’s waist, and knees, or even feet.
  • I’d be very interested to have someone who is actually blind give this a try.  If you know anyone in the San Francisco peninsula who is blind and would be up for it, let me know.

 

Android Adventures, part 4: vibrate Processing

Go to Part 3… Part 5…

Over the weekend I had time to dig into more Android / Processing, and decided I should learn how to trigger the phone’s vibration function.

The only thing I found out of the ordinary is that you don’t need to include this code in your AndroidManifest.xml file:

  • <uses-permission android:name="android.permission.VIBRATE" />

But you do need to enable the ‘VIBRATE’ option in the ‘Android -> Sketch Permission’ menu.

In the below sketch, it simply vibrates when you touch the screen.

// Vibrate Android via Processing
// Eric Pavey - www.akeric.com - 2010-10-24
// You must enable VIBRATE in Android -> Sketch Permissions menu!!!

// Imports:
import android.content.Context;
import android.app.Notification;
import android.app.NotificationManager;

// Setup vibration globals:
NotificationManager gNotificationManager;
Notification gNotification;
long[] gVibrate = {0,250,50,125,50,62};

void setup() {
  size(screenWidth, screenHeight, A2D);
}

void draw() {
  // do nothing...
}

//-----------------------------------------------------------------------------------------
// Override the parent (super) Activity class:
// States onCreate(), onStart(), and onStop() aren't called by the sketch.  Processing is entered
// at the 'onResume()' state, and exits at the 'onPause()' state, so just override them as needed:

void onResume() {
  super.onResume();
  // Create our Notification Manager:
  gNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  // Create our Notification that will do the vibration:
  gNotification = new Notification();
  // Set the vibration:
  gNotification.vibrate = gVibrate;
}

//-----------------------------------------------------------------------------------------
// Override the parent (super) SurfaceView class to detect for touch events:

public boolean surfaceTouchEvent(MotionEvent event) {
  // If user touches the screen, trigger vibration notification:
  gNotificationManager.notify(1, gNotification);
  return super.surfaceTouchEvent(event);
}

Go to Part 3… Part 5…