Thursday, December 27, 2018

Audio Kill Switch


So... I mic'ed my snare and connected it to a guitar pedal and cranked all of the delay effects I have. The end result was a cool dub sound. I was like - yeah this is awesome, but I need to be able to turn it on and off throughout a song. I went to the store - a lot of stores and no one had a kill switch. SO... I built one.

Materials:
  • 2 quarter inch connectors. 
  • 2 wires
  • on/off switch (in this case I pulled my potentiometer out of a broken vacuum cleaner)
  • wood and plastic that I found. 
  • Paint

Total cost: 2 euros

*disclaimer: i am obviously no expert in any of this - but seems to me that all of the schematics I read on this subject were garbage. In this scenario we are just shorting the circuit. Will it blow my house up? Probably not. Will it work? Yes.













Killswitch Schematics















Key Learning
  • Sound passes through the tip
  • Casing should be metal to limit buzz - in this prototype I used aluminum foil
  • It needs to be grounded
  • Wires should be encased in netting also for buzz
  • Potentiometer should be metal so I can stomp the shit out of it


Wednesday, November 29, 2017

The Return of BobbyBot - BB2A

BB2A - I think is where I left off. On the upside: my soldering skills are improving.

Have a few critical issues:

  • Power only supplies back motor and only when connected to USB.
  • Cannot seem to effectively attach his legs - but that is less important bc of previous bullet.


Needed to Move Forward:
  • New micro servo motors
  • Possibly a new battery casing (see lesson learned)
  • Possibly a new Ultrasonic Sensor? Crab. I really should have used a breadboard.
Lessons learned:

  • ALWAYS prototype on a bread board before assembly. What a pain in the ass to spend days completing a build to gind out your gear is blown. 
  • NEVER splice a power source to a two pole switch without an appropriate ground. I spliced my power source and it fried a battery. 

I think I am finally going to put this project to the side and try something different. I could use a win. 

Saturday, May 16, 2015

PIR Motion Sensor

I have finally given in to the fact that somewhere along the way i bruno out my ultrasonido sensor. le sigh. Another example of "just because the light is on - doesn't mean anybody is home."

I switches over to a PIR Motion Sensor because that is all that was left at our shock in Costa Rica... I also atole this guys wiring and coding structure and cam up with what I h ave been trying to do for months within an hour....


If anyone out there cares... could you take a look at my ultrasonic/servo code and tell me if it could have worked??

#include <Servo.h>  
Servo neckservo;                                

int centerPos = 90;
int left = 180;
int right = 0;

int pingPin = 7;
long int duration, distanceInches;
long distanceFront=0;
int lookAround=20;

long microsecondsToInches(long microseconds)
{
return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)
{
return microseconds / 29 / 2;
}

long distanceCm(){
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);

pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);

distanceInches = microsecondsToInches(duration);
return microsecondsToCentimeters(duration);
}

void center()
{
neckServo.write(centerPos);
}

void scanRoom()
{
neckServo.write(left);
delay(700);
neckServo.write(centerPos);
delay(700);
neckServo.write(right);
delay(700);
neckServo.write(centerPos);
delay(700);
}

void setup()
{
neckServo.attach(2);
}

void loop()
{
distanceFront=distanceCm();
if (distanceFront > 1){
if (distanceFront<lookAround){
for(int i=0; i<=8; i++) {
scanRoom();
delay(700);
}
for(int i=0; i<=10; i++) {
scanRoom();
delay(700);
}
} else {
center();
delay(700);
}
}
}





Monday, March 16, 2015

He's Alive! (Again)

Indeed, I had a power problem - but not only that, I also had a coding problem and it has taken me weeks to figure out how to proceed.

I completely disasembled the bot several time and finally figured out how to power each servo motor independently because a single 9v didm't provide enough power to move three motors and the sensor.

Then I went back to the simples version of my code. In this version, the ultrasonido sensor is not yet live because I just wanted to get everything actually working before I try to manipulate it to do specific actions.

Next Steps:

  • walk forward
  • detect an object
  • look left then right
  • determine the best course foward to avoid the obstacle 

But for now, I feel this sense of relief that I can finally move forward with new code as everything is functioning. 

Meet BB2A.



And here is the code for this iteration. 


#include <Servo.h> 

Servo frontServo;
Servo backServo;
Servo neckServo;

int centerPos = 90;
int frontRightUp = 72;
int frontLeftUp = 108;
int backRightForward = 75;
int backLeftForward = 105;

int lookLeft = 15;
int lookRight = 90;


void moveForward()

frontServo.write(frontRightUp);
backServo.write(backLeftForward);
delay (125);
frontServo.write(centerPos);
backServo.write(centerPos);
delay (65);
frontServo.write(frontLeftUp);
backServo.write(backRightForward);
delay (125);

frontServo.write(centerPos);
backServo.write(centerPos);
delay (65);

void sweep()
{

neckServo.write(centerPos);
delay (125);
neckServo.write(lookLeft);
delay (125);
neckServo.write(centerPos);
delay (125);
neckServo.write(lookRight);
delay (125);
}

void setup() 
  frontServo.attach(2); 
  backServo.attach(3);  
  neckServo.attach(6);
  } 

void loop() 
{
     moveForward();
     delay(150);
     sweep();
     delay(150);

}  

Monday, February 23, 2015

Power Problem?

I took several videos yesterday of BB1B avoiding obstacles and studied them last night. What I learned was that BB1B couldn't "see" left or right to determine which way was the best way to turn. I don have extra ultrasonic sensors to add, so I decided to add an extra serio motor so that the one  ultrasonic sensor I do have could swing to the left and right to see obstacles with the hopes of programming it later make decisions based to determine the best route to take to navigate a mate.

Well... in theory it is going to work, but I have run into my own obstacle...


As you can see in the above video of BB1C (new version, new name) it seems that 3 servos and a (((PING sensor is too much for a 5v USB or a 9v battery. hmm.

I am just guessing it is the power supply. I can tell that the code is correct as everything works independently. Of course, I don't have a variety of power supplies to use as a test platform, so I will have to put it away until I can find a new power source. 

Also, it also ocurred to me that the 4 devices might be too much for the board and that maybe I should add another arduino board... but some basic research suggests I should be able to run up to 8 devices from a single arduino Uno so I am going with the power supply first.  

Sunday, February 22, 2015

Avoiding Obstacles


I've had to take a couple of weeks off because of work and admittedly it took quite a bit of time to move BobbyBot from dancing a jig to something that resembles walking. I made a few modifications mostly to the legs, burned through a bunch of 9v batteries, added an ultrasonic sensor and about 2 more pages of code.

Here is a video of BB1B navigating a simple obtacle course. His only purpose here is to not get stuck which I think he does fairly nicely for my first self propelled robot. 

Sunday, January 25, 2015

BobbyBot's First Steps

Repositioned the legs and added duct tape to the feet for a little grip. I am quite surprised how quickly the Arduino and two servo motors burn a 9v battery. I see now why people buy rechargeable batteries and will be investing in some soon. 

Next steps will include programming BB1A to turn (on purpose) walk backward, program the ultrasonic sensor and then set up an obstacle coarse. :)

But... one step at a time. Here are BobbyBot's first steps.