Thursday, January 24, 2013

Stepper Motor

Description:
I was tasked with making a program that could adjust a stepper motor to each individual step for a project. I haven't worked on coding much at all with the Arduino so I started with a bunch of the examples that came preloaded with the software, did a few hours of research, and ended up with a final product. Using the built in serial monitor in the software, I can send positive and negative values to the motor to cause it to rotate. Negative numbers cause it to rotate counterclockwise and vice versa. The magnitude of the number causes the motor to rotate. A stepper motor turns through "steps." This motor has 200 steps so if you send the value of 200 to the motor, it will rotate one full turn clockwise.

Pictures:

I bet you like my super advanced setup for what angle the motor is at.

Video:

Code:
If you're interested in the code, please email me at doitarduino@gmail.com. I'd be happy to share.

Learning to Solder

This week I got all the tools required to learn to solder. With this video: http://www.youtube.com/watch?v=AOdnGUMi7lQ I soldered together my first working circuit board. What you see in the picture is three resistors and three LEDs setup through a potentiometer, which basically acts as a light switch to turn on/of the LEDs. Accidentally destroyed the potentonmeter in the process so I don't have a video to show how COOL my design is. I did however end up just completing the circuit without a switch and you can see my soldering success in the last picture.




Wednesday, January 23, 2013

Color Sensor

The original motivation for starting this project was the motivation to use a color detector to sort gumballs. The link I found was this: http://letsmakerobots.com/node/23768. Since I've got a 3D printer at work I decided to change up the plan a little bit and designed and printed this:


This is a self contained unit which can have the four LEDs and photocell mounted within it. Here are the wires being pulled through.

...Forgot to design for aesthetics.

All wired up and ready.

And finally everything setup ready to go.

Around this point I spent the next half hour troubleshooting everything because my connections weren't just right. Eventually I got everything up and running but realized one LED was much stronger than the others which led to false readings. I'll hopefully revisit this project at a later date and get it to function properly. For now here is a video of the system flashing lights.



Sunday, January 20, 2013

Cannibalizing Electronic Parts

I decided that one of my next projects is to build a flashlight to practice my soldering skills. I realized the LEDs I have aren't bright enough so I decided to take apart my old flashlight (to build a new flash light... I know) Inside I found a motor, capacitor, gears, and an on/off switch. ...No electronic is safe now. Anything that breaks will be taken apart and used for new projects.

Edit: I've now cannibalized a computer mouse and portable speaker system. Got myself a battery pack, DC power adapter, two speakers, a volume knob, aux in, and possibly some bluetooth hookups. Will have to explore the new stuff more in the coming weeks.

Morse Code Part One

Description: Flashes S.O.S. on repeat. You can find more about Morse code here. The image is especially helpful.

Video:

Pictures: 


Code: (Thanks to 30 Arduino Projects for the Evil Genius)
int ledPin = 10;


void setup()
{
  pinMode(ledPin,OUTPUT);
}
void loop()
{
  flash(200); flash(200); flash(200);
  delay(300);
  flash(500);flash(500);flash(500);
  delay(300);
  flash(200); flash(200); flash(200);
  delay(1000);
}

void flash(int duration)
{
  digitalWrite(ledPin , HIGH);
  delay(duration);
  digitalWrite(ledPin,LOW);
  delay(duration);
}

Friday, January 18, 2013

Rainbow LED Blinker




Pictures:





Code:

int ledR = 0;
int ledO = 1;
int ledY = 2;
int ledG = 3;
int ledB = 4;
int ledW = 5;
int timeBlink=200;

// the setup routine runs once when you press reset:
void setup() {              
  // initialize the digital pin as an output.
  pinMode(ledR, OUTPUT);
  pinMode(ledO, OUTPUT);
  pinMode(ledY, OUTPUT);
  pinMode(ledG, OUTPUT);
  pinMode(ledB, OUTPUT);
  pinMode(ledW, OUTPUT);  
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(ledR, HIGH);
  delay(timeBlink);
  digitalWrite(ledO, HIGH);
  delay(timeBlink);
  digitalWrite(ledY, HIGH);
  delay(timeBlink);
    digitalWrite(ledG, HIGH);
  delay(timeBlink);
    digitalWrite(ledB, HIGH);
  delay(timeBlink);
    digitalWrite(ledW, HIGH);
  delay(timeBlink);
  digitalWrite(ledR, LOW);
  delay(timeBlink);            
  digitalWrite(ledO, LOW);
  delay(timeBlink);    
    digitalWrite(ledY, LOW);
  delay(timeBlink);    
    digitalWrite(ledG, LOW);
  delay(timeBlink);    
    digitalWrite(ledB, LOW);
  delay(timeBlink);    
    digitalWrite(ledW, LOW);
  delay(timeBlink);    
}