Monthly Archives: November 2011

Arduino: WebSwitch

I found a remote control switch by Stanley at Bed Bath & Beyond for $10. It lets you turn on/off 3 electrical outlets with a small remote control. Its similar to this one on Amazon. I was able to open the remote easily and get to the buttons. I soldered couple of wires to the end of the terminals and was able to extend it out to the side of the remote. I connected the wires to a transistor to the emitter and collector. Used a 10k resistor to ground it to Arduino’s ground. Pin 7 & 8 were connected to the base of the NPN transistor (2N3904).

At first, I tested it with serial communication. The code would listen for a “1” or a “0” from the serial monitor and send a HIGH/LOW to pin 7 or pin 8 (1 for ON and 0 for OFF). Once I got that to work, I changed the code so it will read a index.php on a webserver. The index.php is set to read a txt file which has a 0 or 1 written to it by another PHP file. “On.php” will write a “1” to the txt file and “Off.php” will write a “0” to the txt file. When Arduino gets the information, it activates the appropriate pin to activate the transistor for 1 second.

RemoteSwitchWeb (code)
php files (copy these files to root of php server)


Arduino: TrackBot

I have been trying to get a stable base for a Arduino track bot. I had trouble with coming up with a good battery for powering the 2 motors. I tried using a 9V battery but it consumed the power in a few minutes. I found a good alternative by using a blackberry phone battery which is about 3.7V DC (BAT-11004-001). The power lasted fairly long time and was sufficient enough for the track bots motor. I was able to connect it as an external power to the motor shield with an on/off switch allowing me to cut the power to the motor quickly. The code is similar to what I had before. Just a simple Ping sensor looking for the distance, backs up and turns when it senses something 8 inches away.

TrackBotPing

Original Video