Show Posts
Pages: 1 [2]
16  Community / Gigs and Collaborations / Re: Tacit Modification for Blind Friend on: December 06, 2012, 09:17:01 am
So my next question, if I skip the transistor part how do I wire the diode?

Edit:
I found this diagram on this site http://www.coactionos.com/embedded-design/39-motor-control.html



In my case is that what I should do?
17  Community / Gigs and Collaborations / Re: Tacit Modification for Blind Friend on: December 05, 2012, 03:50:10 pm
I'm not exactly sure how to do this. I'm more of a software guy than hardware...

Can you provide a link to the transistor and diode I would need? And also a schematic I can follow?

(edit: I suppose the schematic provided for the solenoid is what you're referring too? So would I just use the regulated 5V line off of the arduino (that is powering the ping) to also power the motor? And then use a data line to go to the transistor? If so what transistor and diode do I need?)

I am using the Arduino Pro Mini 5V.

So far the project has been a real success!

Thanks for all your help.

(edit2: Going from this site http://www.akeric.com/blog/?tag=arduino the author claims that the motors only draw 20ma. My pins can provide 40ma each so I should be good. Also I just realized that only 6 of the 14 pins can be used for PWM and I got lucky and picked #3 for the motor smiley-grin Since the motor should be fine I don't need the transistor but should I use anything else?)
18  Community / Gigs and Collaborations / Re: Tacit Modification for Blind Friend on: December 05, 2012, 12:58:34 pm
Okay thanks guys,
I've managed to get it working... I found someone else that's essentially done the same thing and took their code and slightly modified it. Here's what I came up with.

Code:
/*
  Tacit Flashlight/Vibration Code
  Created by Brandon Butler, December 4, 2012.
  Released into the public domain.
*/

#include <Ping.h>
#include <DebugUtils.h>

//#define debug //debug for debugging, anything else otherwise
const int pingPin = 7;
const int vibPin = 3;
int pulseOut = 0;

Ping ping;

void setup() {

// initialize serial communication:
  #ifdef debug
  Serial.begin(9600);
                Serial.println("Testing");
  #endif
  pinMode(vibPin,OUTPUT);
}

void loop() {
 
        long inches;

// get inches from PING)))
inches = ping.pingInches(pingPin);

//vibrate proportionally to closeness
pulseOut = inchesToPulse(inches);
analogWrite(vibPin,pulseOut);

DEBUG_PRINT (inches);
DEBUG_PRINT (pulseOut);

delay(100);
analogWrite(vibPin,0);

}

float inchesToPulse(float inches) {

//curved function so closer distances have more variation
int MaxInches = 240;
int minPulseOut = 100; //vib motor won't spin below ~50-70

//(3 was way too steep) Only felt motor within a foot or two
float powerConst = 2; //steepness 1 for line >1 for steeper
int pulseOut;
pulseOut = (int)(pow(((MaxInches - (float)inches)/MaxInches),powerConst) * (255.0-minPulseOut)) + minPulseOut;
if (pulseOut <= minPulseOut) { pulseOut = 0; }
return pulseOut;

}

I took a motor from a gamecube controller. I assume it uses either 3.3V or 5V to run.
I have the arduino pin wired directly to the motor and it seems to work fine. Should I do anything else?
19  Community / Gigs and Collaborations / Re: Tacit Modification for Blind Friend on: December 04, 2012, 05:42:01 pm
Well... I've managed to create my own library that works (yay!)
It will read the PING))) sensor and return distances in inches or centimeters.
Now I need to figure out how to vary the vibration on a motor...
20  Community / Gigs and Collaborations / Tacit Modification for Blind Friend on: December 04, 2012, 12:52:41 pm
I'm using this project as the basis for my idea

http://grathio.com/2011/08/meet-the-tacit-project-its-sonar-for-the-blind/

But what I want to do is use 1 ping range sensor and use a vibrator motor. And put this inside a flashlight for the case.

Where can I learn how to control the vibration of the motor and have it spin faster the closer an object is?

Any help would be appreciated smiley-wink
21  Development / Other Software Development / Re: New IDE for Mac OS X written in Cocoa (WIP!) on: December 04, 2012, 12:50:53 pm
I just checked it out. Looks pretty awesome smiley
Anyway to change the colors of text?
Pages: 1 [2]