Thursday, January 30, 2014

Elec 10 1/28/14 edited

Objective: build a robot that can autonomously maneuver  a maze to put out a fire.

Progress started week of 01/21/14-01/23/14 after midterm. Have not been able to upload but several things to update.
Things to do:
Flame sensor

Flame sensor reads the max voltage without fire and with fire reads a 0 volts
change the transistor(LED looking one) positive to analog 



Wednesday, January 22, 2014

Mid-Term Toy Hacking Project Dancing Dogg 1/22/14

Experiement: Toy Hacking 


- For the midterm, our objective is to hack a toy and demonstrate previously learned stills(noted  in previous blogs). Different materials that are used will be separated into input and output. Our midterm uses the Arduino uno, breadboard, a 5 volt power supply.

Background
The story behind Doctor Octopus. When we first met was at a community thrift, where out of hundreds of toys he was pick. At first his owner did not know if he worked, but took him in anyway. His owner began on working him to give him new life. But, during his orphan life he could not walk so his new father worked on him countless hours on his spin (motor) and his voice(speaker). With a new release on life he is now able to walk, run, dance, and sing a lovely tune of Mario's theme song..     

Goals:
successfully manipulate the different inputs to different outputs.  

Input
Input one: Momentary switch to switch on one LED then make the Dogg dance
Input two: Sensor to turn on another LED then make the Dogg dance once more
Input three: Different Momentary switch to start music playing. 

Output
Output 1: Motors move  
Output 2:  Red LED flashes on 
Output 3:  Green LED flashes on
Output 4: Arduino sings Mario theme song 

FINAL PRODUCT




#define sensor A0 //define sensor
#define buttonPin6 6//define button
#define buttonPin9 9 //define secret button
#define LedPin5 5//define LED 1
#define LedPin4 4 //define LED 2
#define motor 3 //define motor control
int buttonState = 0; // first button
int buttonState1 = 0; // second button
int sensorValue = 0; // sensor value coming in

void setup(){
  pinMode(LedPin5, OUTPUT);
  pinMode(LedPin4, OUTPUT);
  pinMode(buttonPin6,INPUT_PULLUP);
  pinMode(buttonPin9,INPUT_PULLUP);
  pinMode(motor,OUTPUT);
}

void loop(){
  buttonState = digitalRead(buttonPin6); //check is button pushed
   if (buttonState == HIGH){
    digitalWrite(LedPin5,HIGH); // LED 1 turn on
    delay(1000);
    digitalWrite(LedPin5,LOW); // LED 1 turn off
    delay(1000);
    digitalWrite(motor,HIGH); // turn Motor on
    delay(10000);
    digitalWrite(motor,LOW); //turn Motor off
    delay(1000);
    //analogWrite(motor,50);   // motor 20% on
    //delay(10000);
    //analogWrite(motor,240); //motor 90$%
    //delay(1000);
  }
   else if(sensorValue<600){
    sensorValue=analogRead(sensor); //read the value from the sensor
    digitalWrite(LedPin4,HIGH); //LED 2 turn on
    delay(1000);
    digitalWrite(LedPin4,LOW); //LED 2 turn off
    delay(1000);
    digitalWrite(motor,HIGH); // turn Motor on
    delay(10000);
    digitalWrite(motor,LOW); //turn Motor off
    delay(1000);
    //analogWrite(motor,50);   // motor 20% on
    //delay(10000);
    //analogWrite(motor,240); //motor 90$%
    //delay(1000);
    //audio
   }
   buttonState1 = digitalRead(buttonPin9);
   if(buttonState1==HIGH)
   {
tone(8,660,100);
delay(75);tone(8,660,100);
delay(150);tone(8,660,100);
delay(150);tone(8,510,100);
delay(50);tone(8,660,100);
delay(150);tone(8,770,100);
delay(275);tone(8,380,100);
delay(287);tone(8,510,100);
delay(225);tone(8,380,100);
delay(200);tone(8,320,100);
delay(250);tone(8,440,100);
delay(150);tone(8,480,80);
delay(165);tone(8,450,100);
delay(75);tone(8,430,100);
delay(150);tone(8,380,100);
delay(100);tone(8,660,80);
delay(100);tone(8,760,50);
delay(75);tone(8,860,100);
delay(150);tone(8,700,80);
delay(75);tone(8,760,50);
delay(175);tone(8,660,80);
delay(150);tone(8,520,80);
delay(75);tone(8,580,80);
delay(75);tone(8,480,80);
delay(175);tone(8,510,100);
delay(275);tone(8,380,100);
delay(200);tone(8,320,100);
delay(250);tone(8,440,100);
delay(150);tone(8,480,80);
delay(165);tone(8,450,100);
delay(75);tone(8,430,100);
delay(150);tone(8,380,100);
delay(100);tone(8,660,80);
delay(100);tone(8,760,50);
delay(75);tone(8,860,100);
delay(150);tone(8,700,80);
delay(75);tone(8,760,50);
delay(175);tone(8,660,80);
delay(150);tone(8,520,80);
delay(75);tone(8,580,80);
delay(75);tone(8,480,80);
delay(250);tone(8,500,100);
delay(150);tone(8,760,100);
delay(50);tone(8,720,100);
delay(75);tone(8,680,100);
delay(75);tone(8,620,150);
delay(150);tone(8,650,150);
delay(150);tone(8,380,100);
delay(75);tone(8,430,100);
delay(75);tone(8,500,100);
delay(150);tone(8,430,100);
delay(75);tone(8,500,100);
delay(50);tone(8,570,100);
delay(110);tone(8,500,100);
delay(150);tone(8,760,100);
delay(50);tone(8,720,100);
delay(75);tone(8,680,100);
delay(75);tone(8,620,150);
delay(150);tone(8,650,200);
delay(150);tone(8,1020,80);
delay(150);tone(8,1020,80);
delay(75);tone(8,1020,80);
delay(150);tone(8,380,100);
delay(150);tone(8,500,100);
delay(150);tone(8,760,100);
delay(50);tone(8,720,100);
delay(75);tone(8,680,100);
delay(75);tone(8,620,150);
delay(150);tone(8,650,150);
delay(150);tone(8,380,100);
delay(75);tone(8,430,100);
delay(75);tone(8,500,100);
delay(150);tone(8,430,100);
delay(75);tone(8,500,100);
delay(50);tone(8,570,100);
delay(110);tone(8,500,100);
delay(150);tone(8,760,100);
delay(50);tone(8,720,100);
delay(75);tone(8,680,100);
delay(75);tone(8,620,150);
delay(150);tone(8,650,200);
delay(150);tone(8,1020,80);
delay(150);tone(8,1020,80);
delay(75);tone(8,1020,80);
delay(150);tone(8,380,100);
delay(150);tone(8,500,100);
delay(150);tone(8,760,100);
delay(50);tone(8,720,100);
delay(75);tone(8,680,100);
delay(75);tone(8,620,150);
delay(150);tone(8,650,150);
delay(150);tone(8,380,100);
delay(75);tone(8,430,100);
delay(75);tone(8,500,100);
delay(150);tone(8,430,100);
delay(75);tone(8,500,100);
delay(50);tone(8,570,100);
delay(210);tone(8,585,100);
delay(275);tone(8,550,100);
delay(210);tone(8,500,100);
delay(180);tone(8,380,100);
delay(150);tone(8,500,100);
delay(150);tone(8,500,100);
delay(75);tone(8,500,100);
delay(150);tone(8,500,60);
delay(75);tone(8,500,80);
delay(150);tone(8,500,60);
delay(175);tone(8,500,80);
delay(75);tone(8,580,80);
delay(175);tone(8,660,80);
delay(75);tone(8,500,80);
delay(150);tone(8,430,80);
delay(75);tone(8,380,80);
delay(300);tone(8,500,60);
delay(75);tone(8,500,80);
delay(150);tone(8,500,60);
delay(175);tone(8,500,80);
delay(75);tone(8,580,80);
delay(75);tone(8,660,80);
delay(225);tone(8,870,80);
delay(162);tone(8,760,80);
delay(300);tone(8,500,60);
delay(75);tone(8,500,80);
delay(150);tone(8,500,60);
delay(175);tone(8,500,80);
delay(75);tone(8,580,80);
delay(175);tone(8,660,80);
delay(75);tone(8,500,80);
delay(150);tone(8,430,80);
delay(75);tone(8,380,80);
delay(300);tone(8,660,100);
delay(75);tone(8,660,100);
delay(150);tone(8,660,100);
delay(150);tone(8,510,100);
delay(50);tone(8,660,100);
delay(150);tone(8,770,100);
delay(225);tone(8,380,100);

delay(1000);
tone(8,440,200);
delay(200);
delay(200);
tone(8,440,400);
delay(200);
delay(200);
delay(5000);
}
  else
  {
   digitalWrite (LedPin5,LOW);
   digitalWrite (LedPin4,LOW);
   digitalWrite (motor,LOW);
  }
   }





    

Friday, January 17, 2014

Day 6 1/16/14 Elec 10

Day 6:  Hacked Toy, Driving Motors and other Outputs Devices

Hacked Toy 
Hacked toy dog that danced and sung "who let the dogs out"
*Note once adding 5V motor goes full  

Darlington transistors 

Day 5 1/15/14 Elec 10

Day 5 Microcontrollers,inputs and outputs

Microcontrollers,inputs and outputs
Flashing LED with variable delay
*variable delay not shown 






Using  the push button to tell the microcontroller to turn on the LED 
-
LDR controlling LEDS -
Light Sensor:  Most amount of light both LEDs on , medium light Green LED is on, low light red is on, and no light both LEDs off    

1/14/14 Day 4 Elec 10

 Day 4: Transistor switching, Introduction to Micro controllers

 Transistor Switching 
Finger Switch Transistor
*Note: Using a finger to complete a circuit  


Completed Vex bot 
 Introduction to Micro-controller
using microcontroller to make an LED light
Night rider LED 

Small video of Night rider with Red and Green  





Saturday, January 11, 2014

1/09/14 Day 3 Elec 10

Day 3: Experiment using Switches and relays and building a vex Square bot
Using two slide switches and a resister to make an LED light
-different combinations of the switches made the LED turn on/off  

 Using a relay and a momentary switch/ push button to turn off two different LEDs

using a push button, a capacitor, and relay to make the two LEDs flash on and off
-Relay is underneath capacitor    

Next build but not finish is a VEX square bot 
- Notes: Capacitors charge then release making the LEDs flash on/off, to know that relays work there is a clicking noise similar to the turn signal in a car and always use at least a 100 ohm resister or risk burning out LED

Thursday, January 9, 2014

1/08/14 Day 2 Elec 10

Day 2: Using a Multimeter to measure different outputs and learning about different resisters
Experiment 1: Using the multimeter we tested a 9 volt and 1.6 volt battery, wall adapter(not displayed), potentiometer, and a light sensor    
    Experiment 2: Using different resisters to determine why LED's shine brighter
_________________________________________________________________________________
Experiment 1
Notes:  - Wall adapters when unregulated can vary from printed label
              - Batteries are Direct current and outlets in U.S. are Alternating Current  
              - Moving the potentiometer halfway should create half the total value 
              - Light senors: the more light the lower the ohms and less light the higher the ohms 


Experiment 2   
Types of resistors used: 100ohm, 1K ohm, and 10K ohm.
Note: the higher the resister the dimmer it became. From picture lists 1K ohm, 100 ohm, and 10K ohm
 
Using a 10K potentiometer and a 100 ohm resistor with wires creating a circuit.
Results in varying brightness when knob of potentiometer is twisted.
I assume that the 100 ohm resister is there so when the potentiometer is at 0 resistance the LED will not burn out     

1/07/14 Day 1 Elec 10

Day 1: Experiment 1: Practicing soldering different items, such as,  on a practice soldering board , creating a butt                                        joints between two wires, and assembling our 5v breadboard power supply  
           Experiment 2: Making an LED light up on a bread board


Experiment 1 
 Different resisters and ceramic capacitors solder on practice board  

Practice soldering board


Finished 5V breadboard power supply 
soldering two wires together with a butt joint then securing the joint with shrink tubing's end result 
Experiment 2 
Using our  5v power supply created from experiment one and a resister the LED turns on
*Note add a resister so LED does not burn out