Thursday, September 5, 2013

IT LIVES?

Okay, about one of my old blogs.... "DIY Arduino Mega 2560"

Here is just a little update. Some pictures of the chip smoking up, pictures of it working for five minutes, and pictures of it not responding again.








I ended up burning my USBTiny, but i just had to replace a diode. You see? It's good to have cheap homemade tools.

TIP 31 car

There is not much to explain....

Here is a video:



Pretty self explanatory. Basically I had a model car lying around, so I drilled holes in it and put a circuit in the engine compartment. Looks nice! A23 battery cells are awesome.

Here is the circuit if you are wondering:


I used a TIP 31 NPN transistor. This is a pretty popular project, I just implemented it in something different.
I tried a lower voltage with smaller transistors (e.g. 2n2222)... It didn't work. Still investigating it.

This isn't my first car. The predecessor to this car had headlights, tail-lights, and a speaker. It had a pedestal.
Now, it's burnt out by my attempts to add an amplifier.
Here is a terrible quality video of when it did work:


Just some pictures of it not working.





ooh dusty





Some old stickers

So I honestly like my new revision, because all the electronics are inside the car! The Audi I made before probably burnt out because the AC Adapter says "12v", however it was actually close to 20v

Sunday, September 1, 2013

Star Trek Target Practice

I guess I was watching a bit too much Star Trek with my brother. I decided to make a phaser.

Some of you may know that there are multiple types of phasers. I modeled mine after... Whatever it looks like:




I think I was going for Type 2 Phaser 2265, but it turned out a little different.

Here is a video on Youtube describing how it works and all of that.

Like I promised, schematics and pictures!









What you might see inside when you take apart a calculator:

You should mark down where you can solder the four wires:
Vcc, GND, = sign 1, = sign 2


This is just for fun: One dollar scientific calculator. The inside is a sheet of plastic as a PCB! 


How did I build the Phaser?


I had this old scrap wood, it was triangle shaped. I asked my brother to sand it for me. He did an excellent job.
Then I cut an old cardboard tube in half (on an angle).
I found an old bottle cap and drilled a hole in it, for the trigger

Paint everything glossy black, glue it together neatly with hot glue.
Make the circuit, glue those things on too.
In the end I ended up with a pretty solid toy phaser.




If you have the schematic it should be pretty straight forward.
Here is the code: http://txtup.net/HQ8Eg

Here it is also:

/*
this is a phaser for fun. makes laser shooots, zappy noises, reloads needed.
really fun
tswang 8/27/2013
attiny45
reload button is the reset.
*/
int setting = PB2; //stun or kill
int outled = PB0; //energy level (analogoutput pin)
int noisepin = PB4; //buzzer
int laser = PB1; //the laser
int trigger = PB3; //trigger
int clipsize = 6; //this is how many phases you have.
int shotaken = 0;
int noise;
int noisend;
int incrmnt;
int brightness;
void setup(){
  pinMode(setting ,INPUT);
  pinMode(outled ,OUTPUT);
  pinMode(noisepin ,OUTPUT);
  pinMode(laser ,OUTPUT);
  pinMode(trigger ,INPUT);
   
   
   
  for (int brightness = 0; brightness < 255; brightness++){
    analogWrite(outled, brightness);
    delay(10);
  }
  if (digitalRead(setting) == HIGH){
    for (int shotaken = 0; shotaken < clipsize;){
      if (digitalRead(trigger) == HIGH){
        kill();
        shotaken = shotaken + 1;
      }
    }
  }
  else{
    for (int shotaken = 0; shotaken < clipsize;){
      if (digitalRead(trigger) == HIGH){
        stun();
        shotaken = shotaken + 1;
      }
    }
  }
  for (int brightness = 255; brightness > 0; brightness--){
    analogWrite(outled, brightness);
    delay(5);
  }
   
}
void loop(){
  digitalWrite(outled, LOW);
   
  if (digitalRead(trigger) == HIGH){
     
    outofammo();
  }
  else{}
}
/*************************************************/
void stun(){
  digitalWrite(laser, HIGH);
  for (int noise = 0; noise < 1000;){ 
    digitalWrite(noisepin, 1);
    delayMicroseconds(noise);
    digitalWrite(noisepin, 0);
    delayMicroseconds(noise);
    noise = noise + 1;
  }
  digitalWrite(laser, LOW);
  delay(100);
}
void kill(){
  digitalWrite(laser, HIGH);
  for (int noise = 2000; noise < 2500;){ 
    digitalWrite(noisepin, 1);
    delayMicroseconds(noise);
    digitalWrite(noisepin, 0);
    delayMicroseconds(noise);
    noise = noise + 2;
  }
  digitalWrite(laser, LOW); 
  delay(100);
}
void outofammo(){
  for (int blasted = 0; blasted <5; blasted++){
    for (int ammo = 0; ammo < 100; ammo++){
      digitalWrite(noisepin,1);
      delayMicroseconds(500);
      digitalWrite(noisepin,0);
      delayMicroseconds(500);
    }
  delay(30);
  }
  delay(100);
}


I hope it keeps it's formatting. Go have fun with it!