Thursday, February 13, 2014

ELEC 10 02/12/14 last day

Last:

-Present about our projects
- My main part was coding

This is a sample of our program we used. Our program consisted of simple functions that made it go forward, backwards, right/left, detect a line, and even a flame. The program relied on timing and sensors. Timing was used to make the robot move forward, going to the center,and turning 90 degrees right and left. Wall sensors were used to avoid the walls, line sensors are used to make the robot know where it is.Flame sensor was used find the candle flame. 


This is a flowchart off what our program does when it starts. Over all the presentation was a success and a learning experience. I look forward to learn more in the future. 


Goodbye Elec 10 is was fun 

- Nathan Salta  

   



ELEC 10 01/30/14 edited

Arduino shield

The green board is a top our arduino board make it easier to plug in different components such as line, fire, motors

Elec 10 1/29/14 edited


This is the setup for the line sensor the farther away from the line the higher the read ( in arduino)the closer the smaller the number  

Objective complete: fire sensor and line sensor 
 line sensor sees black line and fire sensor sees candle flame 

Tuesday, February 11, 2014

Elec 10 2/08/14 Competition day


Competition day Saturday Arrived to Cal state Long Beach Engineering Department around 11:30. 
- Competition Name: Nathan squared ( partner and I ) 
- Before competition: fixed turning which was slightly off 
- Cued robot to practice the course. It was successful came up a little short in the beginning moving forward. Needed more power to realign itself on the wall. 


1:15 competition start. 
-reprogrammed initial driving forward to center.


1:30
- Our turn comes up the Nathan squared made an error by coming up short initial drive to center
- Did not finish


Fixes before second try: 
- charged battery
- fixed turning a little more
-Unplugged battery 

about 2:00 
- our second try came the inital forward was fixed but turn was off. 
-Did not finish 


- IMPORTANT NOTES:

- Competition if you unplug battery run it once or twice to test if it works properly. We plugged in the battery when we went into our second try and it didn't perform correctly. 
  • After pushing the reset the robot ran correctly ( after turn)
-  Important to manage time correctly
  • Our robot was solid, but programming took sometime ( have time anything begin to fail)   
- Things I would change:

  • Not relying on encoders; they failed on Friday and had to do timing and wall sensor ( almost  rework whole program )
  • Making the robot actually finish, then making it go faster
  • More time working in the maze
  • Another Student came up with the idea of bumpers switches one for each room. Depending on which room  the flame was in, push that bumper. Although, would ruin the spirit it was out of the box thinking.
  • Being able to use our fan. A fan so powerful the robot began roll backwards. 
  • Asking for help when something fails: easy way to help solve problems and waste less time.
  •  Time management: programming and robot 
  • Being prepared for any mishaps 
Final Thoughts

- This is my first time programming and enjoyed the problem solving aspect of the competition. There are things I would change which were previously mention. I enjoyed the experience and turmoil, with that old say  "you learn more from your mistakes than from your successes."  Elec 10 Winter 2014 


-Nathan Salta      




Monday, February 10, 2014

Elec 10 02/07/14

Waiting to go through the course 


After yesterdays fire the encoders began to malfunction and the turning and driving forward resulted in timing. Crunch time two hours before the end of the day three rooms out of four were searched.  

Elec 10 02/06/14

Our Fire is a brushless motor attached to a computer fan grill  

The Fan was so powerful the robot started to move back
Note: never uses a small wire for power it can not handle the current  which in turn fried the arduino shield power to ground

Elec 10 02/04/14

The main part of the day was coding and wire management

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