First here are the photos deleted by mistake from flickr:
Headsets microphones
Electrec thingey inside.
The circuit
This is a closeup of the circuit, I´ve added a 10uF capacitor to stabilize the output signal (it´s the green cap on the right).
The problem here is that I can´t imagine myself soldering all this components onto a pcb, I would like to have at least two of these, four would be awesome.
Click the following button to see source code for Arduino and Processing
This came up with the need of having the arduino permanently installed on the robots, I´m tired of having to remove the arduino from one bot to the other, and then rewire everything, and then reupload the code everytime I have a new idea, or everytime I want to show the bot to someone.
So I followed the ITP Physical Computing tutorial, and it works like a charm, now I want to try to upload code with the FTDI cable, and If I have success on this I can start making my custom Arduino boards. :D
And here´s the trick to upload code without having to remove the chip to a normal Arduino board, and then put it back on the breadboard, I´m using an FTDI cable, Black and Red connect to GND and +V, he RX from the FTDI cable goes to the AVR’s TX (pin3) and the FTDI’s TX goes to AVR’s RX (pin2).
“I hold down the reset button, press the upload button, count to three, then release the reset button. Then the IDE seems to upload the smoothest.” Full credits to Rudolph for sharing the trick.
Another mighty trick is using a 0.01 uf cap between the RTS (green wire) and reset pin, it will make an auto reset before uploading!!! I´ve made my day!! :D Thank you Rory ;)
After long research and trial and error, I´ve came up to a new walkthrough regarding this nice chip, the L293D.
Each project is one project and each one has its own unique power configurations, so you must be aware of the best battery choice and how to distribute voltage through your robot.
I strongly advice you to read the following articles:
L293D gives you the possibility to control two motors in both directions – datasheet
************************************************
The L293D Circuit:
Basic Implementation:
This is the most basic implementation of the chip.
As you can see, a 5V Voltage Regulator is between the battery and pins 1, 9, 16.
Pin 8 gets power before the VReg, if your motor needs for example 6V you should put 6V directly in this pin, all the other pins should not get more than 5V.
This will work with no problem at all, but if you want to do the right implementation take a look at the next example:
This is the correct Implementation (with the capacitors), and note that pin 8 is feeded by unregulated voltage. This means that if your motors need more than 5V, you should power this pin with that amount of voltage, and the rest of the circuit with 5V.
The capacitors stabilize the current.
The same circuit on a breadboard:
Soldered on a pcb and ready to go:
This is the back of the circuit, click for high resolution photo.
// Use this code to test your motor with the Arduino board:// if you need PWM, just use the PWM outputs on the Arduino// and instead of digitalWrite, you should use the analogWrite command// ————————————————————————— Motorsint motor_left[] = {2, 3};
int motor_right[] = {7, 8};
// ————————————————————————— Setupvoidsetup() {
Serial.begin(9600);
// Setup motorsint i;
for(i = 0; i < 2; i++){
pinMode(motor_left[i], OUTPUT);
pinMode(motor_right[i], OUTPUT);
}
}
// ————————————————————————— Loopvoidloop() {
drive_forward();
delay(1000);
motor_stop();
Serial.println(”1");
drive_backward();
delay(1000);
motor_stop();
Serial.println(”2");
turn_left();
delay(1000);
motor_stop();
Serial.println(”3");
turn_right();
delay(1000);
motor_stop();
Serial.println(”4");
motor_stop();
delay(1000);
motor_stop();
Serial.println(”5?);
}
// ————————————————————————— Drivevoid motor_stop(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], LOW);
digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], LOW);
delay(25);
}
void drive_forward(){
digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);
digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);
}
void drive_backward(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], HIGH);
digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], HIGH);
}
void turn_left(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], HIGH);
digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);
}
void turn_right(){
digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);
digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], HIGH);
}