Because Microsoft Sucks!


I was watching the Steve Job's iPad presentation and I remembered the time when Bill Gates was presenting Windows 98 and it died to a BSOD. Funny moment.


A roof wifi access point


So I had an old D-Link router (DI-624+) lying around that was replaced by a new Linksys WRT54GL and I though that maybe I could build a box and get it working from the roof of my house. This way I could access my LAN from a couple blocks away (I might start a wireless bridge with a friend of mine who lives nearby).

I went to ACE Home Center and bought a plastic organizer box, some 1/8 inch bolts with nuts and some plastic glue. Then, I took the router apart and screwed the its mainboard to the box. In the mean time I though that maybe I could install a computer's power supply in the box with it, so I could power further wifi projects with it using PoE. So I did and finally I got this mounted on my roof:



Finished installation on the roof.





Box internals. I took some of the power supply's cables out (12V, 5V, 3.3V and the other cables) and left a couple grounds, 5V and 12V. I put a power switch for the power supply by connecting the green cable with ground.

Since I was a child, I always wanted to build a robot so I decided to start with a simple photovore robot a couple days ago.

I got a cheap R/C car for Christmas (my girlfriend knew I needed some kind of motorized toy to build the robot) and I just striped its guts off.



After that I just put a single side Arduino that I made, a L293D H-Bridge, a IR proximity sensor (bought at SparkFun.com) and some LDR.

H-Bridge
The R/C car had two small DC brushed motors, one for the traction and one for the direction. It was pretty easy to wire up this to the L2W93D.





Proximity sensor
The proximity sensor has 3 pins: VCC, V0 and GND. I just wired the VCC and GND to the respective Arduino pins, and V0 to an analog input.

Light sensor
The light sensor was a little more complicated. Because I needed to detect the direction of the brightest light source I decided to use 3 single sensors, 2 pointing in each direction and one forward. This way I can evaluate the sides against the central value and decided whether to turn left or right.

The output of each sensor was connected to an analog input.




The Code

/* Photovore

*/

// Pin configuration
int motorLeadF = 9;
int motorLeadB = 10;
int directionLeadL = 5;
int directionLeadR = 6;

// Variable declaration
int proximity = 0;
int leftLight = 0;
int centerLight = 0;
int rightLight = 0;


void setup() {
// start signal
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);

// pin configuration
pinMode(motorLeadF, OUTPUT);
pinMode(motorLeadB, OUTPUT);
pinMode(directionLeadL, OUTPUT);
pinMode(directionLeadR, OUTPUT);

// motor initialization
digitalWrite(motorLeadF, LOW);
digitalWrite(motorLeadB, LOW);
digitalWrite(directionLeadL, LOW);
digitalWrite(directionLeadR, LOW);
}

void loop()
{
proximity = analogRead(3);
leftLight = analogRead(2);
centerLight = analogRead(1);
rightLight = analogRead(0);


if (proximity > 205) {
// go back
digitalWrite(motorLeadF, LOW);
digitalWrite(directionLeadL, HIGH);
digitalWrite(motorLeadB, HIGH);
delay(750);
digitalWrite(motorLeadB, LOW);
digitalWrite(directionLeadL, LOW);
}

if (abs(deltaRight - deltaLeft) > 20) {
if (deltaRight > 10 || deltaLeft > 10) {
analogWrite(motorLeadF, 180);

if (leftLight > centerLight) {
digitalWrite(directionLeadL, HIGH);
digitalWrite(directionLeadR, LOW);
} else if (rightLight > centerLight ) {
digitalWrite(directionLeadL, LOW);
digitalWrite(directionLeadR, HIGH);
} else {
digitalWrite(directionLeadL, LOW);
digitalWrite(directionLeadR, LOW);
}
}
} else {
digitalWrite(13, HIGH);
delay(300);
digitalWrite(13, LOW);
delay(300);
}
}

First Post


This
will be a post to help me track my adventures with chemistry, electronics and computers, and to improve my writing English skills for now on.

I will be posting mostly every project I pursue and every interesting thing I find.
top