Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: mohamed on February 04, 2008, 09:06:01 AM

Title: motor driver in the 50$ robot
Post by: mohamed on February 04, 2008, 09:06:01 AM
iim sorry for asking alot but this is my first robot in life so it's kinda difficult
now i had the motor driver L293D so how can i mount it in the 50$ circuit does anyone know the changes that will happen?
thanks really hope someone answer me fast
Title: Re: motor driver in the 50$ robot
Post by: Admin on February 05, 2008, 08:22:58 AM
The datasheet for the L293D should explain how to wire it.

The $50 Robot schematic should remain the same.

You will have to modify my software a bit to control the L293D, as per the datasheet.

(hope that helps)
Title: Re: motor driver in the 50$ robot
Post by: mohamed on February 06, 2008, 07:32:44 AM
thanlks to your tip and it really help but i did do some search and i found this schematic http://www.8051projects.net/_L293D_schematic (http://www.8051projects.net/_L293D_schematic) but i dont understand it coz as i told before this is my first robot so if u could tell me if this is the right and suitable schematic to use on atmega8 and to the circuit of the 50$ robot and if not can u tell me another one coz in this schematic it doesnt tell you how to wire the motor driver to ur atmega8
PS:i really need something simple to use as im not expert in reading schematic
thanks
Title: Re: motor driver in the 50$ robot
Post by: Admin on February 06, 2008, 10:43:00 AM
Use this schematic. You attach the ATmega8 digital output pins to the pins that have triangles on them in this image. The L293D datasheet will explain what the pins do and how to use them.

http://www.seattlerobotics.org/encoder/sep97/Drawing6.gif

(http://www.seattlerobotics.org/encoder/sep97/Drawing6.gif)
Title: Re: motor driver in the 50$ robot
Post by: mohamed on February 06, 2008, 11:22:31 AM
thank u very much that's really help
Title: Re: motor driver in the 50$ robot
Post by: mohamed on February 06, 2008, 07:54:38 PM
does anyone knows what r the output pins of the microcontroller coz i dont find it in the datasheet fo the ATmega 8
thanks
Title: Re: motor driver in the 50$ robot
Post by: garriwilson on February 06, 2008, 08:01:51 PM
http://www.societyofrobots.com/images/sbs_avr_schematic.png

It was in the tutorial for 50$ robot. In the middle are the outputs.

Hope that's what you meant.
Title: Re: motor driver in the 50$ robot
Post by: mohamed on February 06, 2008, 08:11:01 PM
i dont know but i want to wire all the output in the microcontroller wiz the motor driver so which pins r the output of the microcontroller hope u understand what i mean now and thanks for your reply anyway
Title: Re: motor driver in the 50$ robot
Post by: ed1380 on February 06, 2008, 09:05:32 PM
or get an ESC no need to change code or anything. plug it in. hook the motor up. and wala you have a working motor driver.
and you're short some cash  ;D
Title: Re: motor driver in the 50$ robot
Post by: Admin on February 07, 2008, 08:52:41 AM
Quote
which pins r the output of the microcontroller
the same as that used for the servos

look at my servo code to see how it works
Title: Re: motor driver in the 50$ robot
Post by: mohamed on February 08, 2008, 07:30:33 AM
ok does i have to connect pin 16 and pin 4 to the main battery or what?.....coz i dont understand what is the mean of VS and VSS
Title: Re: motor driver in the 50$ robot
Post by: Admin on February 08, 2008, 08:05:55 AM
Its all in the datasheets.

And on my $50 robot schematic.

;D
Title: Re: motor driver in the 50$ robot
Post by: garriwilson on February 08, 2008, 01:42:42 PM
Look at the link I posted. Each color is connected to the pin that has the same color.
Title: Re: motor driver in the 50$ robot
Post by: mohamed on February 08, 2008, 02:27:47 PM
the admin said that i have to connect all the digital output of the ATmega8 to pins 15,9,10,1,2&7 but i looked in the datasheet of the ATmega8 and i found that PD0 is an output data pin
so i asking is it normal to connect to PD1 , PD2 , PD3, PD4 and PD5
thanks again for the help
Title: Re: motor driver in the 50$ robot
Post by: mohamed on February 09, 2008, 05:12:47 AM
now i just finished the circuit connection
do i have to use the programming code as it is or there will be any changes?
Title: Re: motor driver in the 50$ robot
Post by: Admin on February 17, 2008, 09:37:53 AM
DO NOT DOUBLE POST! It creates wasted work for everyone.

Yea, so the code needs to be changed. Look at the motor driver datasheet and tell me when pins need to be turned on/off for the motor to rotate in the directions you want. I know you can figure it out if you think about it for a bit . . .

Now those motor driver pins have been hooked up to the digital pins of your microcontroller. So in the code, you just need to turn those pins on and/or off.

So just put something like this in your code:
PORT_ON(PORTD, 4);
PORT_OFF(PORTD, 4);

where D and 4 is the port letter and number on the ATmega (check the schematic/datasheet)