Sunday, February 17, 2019

Lab 17 - Using IR sensors for flame and line detection for the VEX

2/14/2019

IR sensor is able to detect IR light. As with all sensors, visible light can be detected, but thus one is able to detect InfraRed light which is light above the spectrum of visible light. Coincidentally, Android phones are able to view this light through its camera. Iphones are not able to view such light. Our robot, for testing purposes only, has been customized with a useful state of the art (in my mind. haha), an easy to grab handle. Tall hable is useful so the person, me or my robot partner, does not have to bend down all the way to grab the robot and risk getting fingers caught in the possibly still moving gears. Also useful for mounting a phone as a ash cam , and even is useful to quickly grab the robot in case the collision sensor or programming is not yet working fully properly.



IR sensor mounted



            




















The IR sensor for this bot is going to be mounted in front of the bot because that is what is needed to be avoiding obstacles such as the walls. the sensor worked great! The only issue we found was the location in the room. In our test bench we tested the light and we were getting readings of about 500. Our bench area was not greatly lit up. The actual maze competition area, howerve, was greatly lit up by the classrooms lights. The readings in that location was much higher, and hence it was harder to see the IR candle cause of the excess light. Then problem was easily fixed by decreasing the sensitivity of the IR sensor. Since the resistor was already soldered into the sensor, we just simply changed the programming number. Project Success!

Lab 16 - Ultrasonic Rangefinder and other sensors

2/12/2019

An Ultrasonic sensor uses audio waves to detect structures such as walls blacking a path; hence rangefinder. The audio waves will signal how much open range there is that is in front of the robot. The sensor receives a 10us electrical pulse to signal the sensor to activate and send out a sound at trigger point. The Echo part will receive the audio that bounces back form the wall structure. Depending on the time it takes back for the sensor to receive the feedback, the sensor will calculate the distance away that is in front of the robot.

UltraSonic Sensor Installed

The hard part of the sensor in readings is its out of limits range. If the distance in front of the sensor is more than 6 feet away, the sensor will return a -1 value. The code for that part cant be just x>-6, the sensor for the code must also include a lower bounds limit. The key to this part of the code is to be 0<x>6. That code will ignore the -1 value and allow further distance to tell the robot to keep moving forward.

Wall Avoidance Lab
Code the lab will have the robot keep going forward unless a wall is detected. Make a right turn if a wall is detected. if a wall is detected again, move left form the original orientation; or move 180 degrees after the 2nd right turn.


Wednesday, February 13, 2019

Code.org Homework Assignment

2/5/2019

Code.org Homework Assignment

Star Wars: Building a Galaxy with CodesetBackground("Endor");
setMap("circle");
setDroid("R2-D2");
setDroidSpeed("normal");
playSound("R2-D2random");
function whenUp() {
  goUp();
}
function whenDown() {
  goDown();
}
function whenLeft() {
  goLeft();
}
function whenRight() {
  goRight();
}
addCharacter("PufferPig");
addCharacter("PufferPig");
function whenGetAllPufferPigs() {
  addPoints(100);
  endGame("win");
}


SHARE GAME @  https://studio.code.org/c/140816053

Minecraft Voyage Aquatic 

for (var count = 0; count < 5; count++) {
  placeBlock("redCoralBlock");
  turn("left");
  moveForward();
  placeBlock("redCoralBlock");
  moveForward();
}

SHARE GAME @  https://studio.code.org/c/714458078


Code with Anna and Elsa
Puzzle 6 Star https://studio.code.org/c/49768924
Puzzle 9 Super Star https://studio.code.org/c/618940565
Puzzle 12 Parallelogram Star https://studio.code.org/c/51803719
Puzzle 15 Star in a Star https://studio.code.org/c/53014217
Puzzle 17 Start Star https://studio.code.org/c/618940329
Puzzle 19 Snowflake https://studio.code.org/c/53005426
Finish Star: 

for (var count = 0; count < 3; count++) {
  drawSnowflake('square');turnRight(90);
  jumpForward(100);
}

SHARE GAME @ https://studio.code.org/c/52521226







Sunday, February 10, 2019

Lab 15 - Building Square Bot and doing the Electrical Tape Maze with and without encoders

2/5/2019 & 2/7/2019

Mega bot building time! The day has come in which we will build a robot. The Robot is going to be a square on shape and it is going to go through a maze that was laid out with electrical tape. We have all the parts either in the box or in the parts room. We are basically following the manual to build the robot, but with the encoders installed in place. We are not going to use them in the first trip but we are going t use them on the second trip using the programming; just so we do not have to dismantle the bot just to install the encoders.

Bot Building Station
We worked on a side project utilizing the biggest wheels, but turning ability was terrible, so we stayed with the tiny wheels for maneuverability. 
Mega Test Bot
Due to programming constraints to one user at a time, I would periodically assist with the programming part when needed, until then I was on mechanical duty. I built the bot for the future labs too. The bot is equipped with an easy elevated carry handle so the robot can be transported easily without having to constantly be bending down to retrieve the bot or to reposition it. The bot is also rigged with some fans for blowing out a future flame, a sonar sensor upfront for the future IR detection part, and racks for video recording modularity.


Sunday, February 3, 2019

Lab 14 - Non-Existent

Nothing posted for Lab 14 on packet

Lab 13 - Building Sensors for your Robot

1/29/2019

We worked with phototransistors today in lab. It is basically a photodiode amplifier combination that is integrated on a silicon chip. Recall that a transistor has an emitter, collector, and a base pin. Notice how this device only has two actual pins. THe third pin is the base pin, which is actually  in the device already. The light (light that the sensor detects) is the base activating pin for the device. This device is going to detect IR (InfraRed). That is light that we humans cannot see, but our phones can! well, some phones; Apple phones cannot see that light, but the Android phones are able to display IR light on the camera screen.

Time permitting, we did not light a candle for flame (too messy as the wax goes onto the floors and makes a mess, and a fire hazard). We used a pre-constructed flame which is a couple of IR LEDs on a breadboard [piece that outputs IR light.

Phototransistor



Once again, due to time permits, I built a circuit on the breadboard to detect IR light. It is only one phototransistor, and One carefully chosen resistor. That resistor, depending on its value, will allow more or less voltage/current to be ran through it. The important concept in this is the preferred gain range. We want a resistor, so that when hooked up to the phototransistor, we got a high value of 1000 or so on the display with super intense IR light. The lowest we should see is around 20's when the IR light source is about 4 feet away from the sensor.


Lab 12 - Distance Sensing with Ultrasonic Sensor and Arduino

1/29/2019

Todays lab is utilizing an ultrasonic sensor. I use to thing it would just work by outputting the distance, but there is a lot more to the device than assumed. The device has 4 pins; one being a +5V power input, and the other being a ground pin. The two other pins are the controls. Order of the pins must be referred to the diagram. Third pin is a Trigger pin, that pin looks for a 10us signal pulse that basically activates the ultrasonic sensor. The sensor output s a sound wave in pulses. The last pin is an Echo pin, that pin listens for the return of the wave and outputs a pulse width proportional to the measured distance of the sensor. For simplicity of this lab, as instructed, we copied the code down for the lab/online, and just modified it to our pin setup on the arduino.



Ultrasonic Sensor/ Motor Off (no object)
                                                   

Ultrasonic Sensor/ Motor ON (object detected)
 This lab has a program, which got edited into the downloaded program, that turns ON the motor when an object is 5 inches or closer to the sensor; Motor is OFF when the sensor range of 5 inches is clear.

Alternate view
8