User:Cmcarreras/ENES-100/project 2

Week1 Narrative
Went through numerous tutorials on Inkscape.

Inkscape has it's own dedicated wiki that has a wealth of information... However, it's filled with lots of information that is irrelevant for my use of it. Jargon is also overwhelming, almost like another language. It's more like a manual, but much like how a car manual won't teach you to drive, this wiki won't teach you how to use the software.

Wikipedia has a tutorial for creating a diagram... However, it is incredibly basic and shows what one can easily do in MS Paint.

Found many playlists already in existence out on the web. Was unaware that you could specifically search for playlists on Youtube. The following playlists are great tutorials and use little jargon that would be unfamiliar to a new user of Inkscape.


 * Very Thorough Beginners' Guide: Playlist that goes through each individual feature and usage.
 * Less Thorugh Beginners' Guide: Similar to the above. Not quite as thorough. Slow paced. Boring
 * Quick Logo Tutorial, quick tutorial for logo creation. Shows numerous tools being applied in all of 5 minutes

In addition to these tutorials, I found a library of electronics symbols that can be used for drawing circuits using a vector editor like Inkscape. These are great since they are vectors and do not lose quality when resized.


 * Very good ... 10/10/20 ... need to publize this ... found playlist for VI that was very good also ... --1sfoerster (discuss • contribs) 13:40, 18 March 2014 (UTC)--

Week2 Narrative
Took home fully-functioning Tribot #3 and 3 arms which contain an infrared sensor apiece.

I set myself to determine how to interface the Arduino with the infrared sensors on hand so that the Tribot could use such sensors to determine a line on the ground to follow. Rather than reinventing the wheel, I took to the web to find examples of others' work on line-following robots to see how to get a robot to utilize sensors to detect a line on the ground. Dead-End Examples

One example showed great promise. However, the robot utilized was an arduino brand robot that was dependent on a specific arduino header file / library. This library is geared to the arduino robot with motor shield, and I'm not sure if it can be applied to our Tribot as it has it's own motor control board.

I figured that since the library may be intended for use solely with the specific arduino robot and motor control shield, it would not help with my intent of using the IR sensors currently on hand to have the tribot follow a line on the ground.

I resolved to follow the plethora of examples available on the web. Some of these examples were useless to me as far as I could tell as they did not utilize an IR sensor, but rather a Light Dependent Resistor (LDR).

Pot-of-Gold Example

I came across an amazing tutorial for creating a line-following robot utilizing IR sensors and an arduino. I also discovered a way of testing the IR sensor to make sure it functions for the purpose of having it follow a line.

Next steps: Attach an IR sensor to the arduino and have it spin the wheels to propel itself when it detects a black line on a white surface. The IR sensor will need to be attached to the arduino as shown in the IR sensor diagram. Seems as if orange wire will be read as an input signal to arduino. The IR sensor requires 5V to function, and the arduino should be able to provide this through the red wire no problem. Great idea would be to take tribot and sensors to a hacker space to get guidance considering my ignorance on the subject.


 * 10/10/5 looks like you have a starting point ... don't need to go to a hacker space for help .. see me

Week3 Narrative
Continued to work with Tribot #3 in effort to create some sort of light/dark sensor. Each arm contains an IR transmitter and receiver apiece. The transmitters are soldered on and I couldn't remove them to place them on a breadboard to create a prototype sensor array per the examples I came across last week.

I grabbed a few photocells (light-dependent resistors) at RadioShack for maybe $2 thinking that I could utilize them. My thoughts were that if I could utilize an LED to produce light on a surface, a light-dependent resistor (LDR) would absorb the reflected light and it's resistance would change in a measurable amount. This measurable amount, ideally, would be measurably different depending on whether it was receiving the LED's light reflected off of a white or black surface. I measured the resistance of the LDR while it was in series with an LED that was successfully being lit by the arduino. The resistance was variable and never settled. My guess is that because I wasn't in a well lit room this was affecting it's resistance. However, the LDR was not affecting the brightness of the LED in any noticeable way. My guess on this is that the LDR alone doesn't provide enough resistance to affect the voltage flowing to the LED. So I did the only natural thing to test this, I threw a 330kohm resistor in series w/ the LED to see what would happen. Nothing happened, of course. Which only serves as a further example of my ignorance. I tried measuring the resistance of the LDR with some lights off in the room, but the again the resistance continued to vary.

Failure, upon failure, upon failure.

In fact, the only success I found was that I could light an LED on a breadboard utilizing the 5V provided by the arduino. See above photo.

What makes this so frustrating... is that I know how I can utilize this on the software side. It should be very simple, as I have diagrammed above, but getting to that point is proving to be more challenging that initially thought.


 * Need link to the LDR ... they change resistance by just putting your thumb over them and blocking out the sunlight .. of course they are going to change constantly .. what were the changing amounts ... how did the pattern change ??? did you compare to a capacitor or inductor? ... not sure what components you are playing with .. Light_sensor.png .. needs white light .. Infared is not powerful enough ... Infared is a different technology ... Words of frustration need to be turned into procedure, expectations, what happened ... video, pictures, facts, details ... in order to stimulate a constructive conversation. Otherwise a verbal conversation occurs, or you look over someone's shoulder. Just words don't help anyone else replicate what you did. Spend the next week sinking into this and documenting this problem rather than trying to solve it. 10/10/5 --1sfoerster (discuss • contribs) 13:29, 1 April 2014 (UTC)

Week4 Narrative
This week I put together a working light sensor. Utilized this overview to gain a knowledge of how to build a circuit that utilizes a photoresistor.

With a working light sensor, I needed to introduce an LED. My plan was to adjust the brightness of the LED depending on the values read in from the analog input of the arduino. I utilized the same overview to add an LED to the circuit. Again, I used fritzing to diagram this circuit for future reference.

After completing this I reviewed a sketch provided by that overview. I tried to shortcut my way by just copying the code verbatim but it didn't work. I noticed a key typo (they set the analog input to pin 0 and not A0) and corrected it. Uploaded the sketch to the arduino and it still didn't work. I decided to just study the code, figure out how it worked, and apply aspects of it to the code I used earlier to read the signal in the serial monitor. I uploaded the sketch to the arduino, and the light sensor was functioning.

However, there was an issue. The LED would brighten when light was shown on the photoresistor and dim when the photoresistor was covered. The light sensor functions fine... but this seems counter intuitive. I decided to take the maximum value that can be read in from the serial monitor (1023) and subtract the value read in from the analog input. In theory, this makes sense. When the photoresistor is exposed to light, the resistance dramatically decreases allowing more voltage to pass through and causing the serial monitor to read ~1000 making the LED shine brightly.

I applied this change to my code, and the light sensor functions as intended.

/*   AnalogReadSerial Reads an analog input on pin 0, prints the result to the serial monitor. The results will be utilized to dim/brighten the LED This example code is in the public domain. -*/ // the setup routine runs once when you press reset: void setup { // initialize serial communication at 9600 bits per second: Serial.begin(9600); pinMode(7, OUTPUT); //output to the photoresistor pinMode(11, OUTPUT); //output to the LED } // the loop routine runs over and over again forever: void loop { int LEDbrightness; //Will be used to determine how much power to send to LED int LEDpin = 11;  //Renames the LED pin for clarity int sensorValue = analogRead(A0); // Reads from the analog input pin 0 // Assigns those readings to a variable // print out the value you read: Serial.print("Analog Reading = "); Serial.println(sensorValue); // Prints reading from analog input to serial monitor digitalWrite(7, HIGH); sensorValue = 1023 - sensorValue; //IMPORTANT, if not the LED dim in the dark, and brighten in light LEDbrightness = map(sensorValue, 0, 1023, 0, 255); // remaps the values read to a numer that can be used // with analogWrite analogWrite(LEDpin, (LEDbrightness)); // sends power to the LED proportionate to the number // read in from the analog input delay(1);       // delay in between reads for stability }

Demo

Click here for a video demonstrating the fully functioning light sensor. Colors of the wires coincide with those that can be seen in my fritzing diagrams I provided above.

Next Steps

Now that I can utilize the values read-in from the analog input, the next step would be to use these values to send power to the wheels. Utilizing the analogWrite and the values read in I should be able to have the wheel spin at varying speeds dependending on how much light the photoresistor is receiving. This can have more applications than just the static speed that the wheels spin at when using "digitalWrite".


 * Wow! Perfect ... 10/10/60 .. --1sfoerster (discuss • contribs) 15:14, 8 April 2014 (UTC)