big problem with using key in my project (controlling the dc motor with AVR))

Thread Starter

roberty

Joined Aug 18, 2010
11
hi every one.
i have a problem whit using these keys
http://upload1.imgdl.ir/images/21420101119257.jpg

please take a look at the picture of the protoes file that i've uploaded here
http://s22.aks98.com/files/13864853689662246064.jpg

when i use these keys in this progect i can increase and decrease the engine turning ratio but i can NOT ghange the direction of rotation of engine and this is my problem.

i dont know how to fix it... these keys look very goog in running the engine but dont work in changing the direction at all....!!

please help me...
 

beenthere

Joined Apr 20, 2004
15,819
That is not a key - it is a pushbutton switch.

As to your motor rotation problem, the two diodes prevent current from flowing in one direction, so the motor can only turn one way.
 

CDRIVE

Joined Jul 1, 2008
2,219
As to your motor rotation problem, the two diodes prevent current from flowing in one direction, so the motor can only turn one way.
Actually,... the way those diodes are wired I can't see how it turns at all. He can't possibly have them wired like that unless at least one of them is shorted. ;)
 

Thread Starter

roberty

Joined Aug 18, 2010
11
Actually,... the way those diodes are wired I can't see how it turns at all. He can't possibly have them wired like that unless at least one of them is shorted. ;)
thanks.... but those diods are just in the proteos and Not on my project...
there is no diode in the project...

my problem is that the word in front of the " direction" on my LCD doseNOT change to "LEFT" or "right" whit pressing thse push buttons...

in other word the first and second push buttons in my project can easily increase and decrease the rotation cycle but the 3rd anf 4th push buttons can NOT change the direction (( i mean in real project NOT in proteos))
 

Thread Starter

roberty

Joined Aug 18, 2010
11
dear friends

i've built this project:
http://s22.aks98.com/files/13864853689662246064.jpg

and the picture of the project is this:







i think the picture shows every thing. those two upper push buttons work very well but those two lower ones cant change the direction and nothing happens in front of the word"direction" on my lcd when i push these buttons.
also those diods are NOT connected tho anyting yet... my problem is still about these push buttons.

please help me...
 

CDRIVE

Joined Jul 1, 2008
2,219
First off, you shouldn't be running that motor without the Diode H-Bridge that's shown in the pdf data sheet; you could destroy the chip from back EMF.

Secondly, if your LCD readout is also not displaying the direction then you could have miss-wired those two switches or you may have a programming error. Do you have a DVM?
 

Thread Starter

roberty

Joined Aug 18, 2010
11
Secondly, if your LCD readout is also not displaying the direction then you could have miss-wired those two switches or you may have a programming error. Do you have a DVM?
thanks my friend for the answer.

i'm sure that i've attached the pins of those push buttuns correctly. just like those two upper keys that are working well. but the 3rd and 4th push buttons still NOT working.

yes.
i have a dvm.
 

beenthere

Joined Apr 20, 2004
15,819
thanks.... but those diods are just in the proteos and Not on my project...
there is no diode in the project...
Those two cylinders on either side of the L298 are diodes. Check and you will see they are 1N400x (could be 4001 - 4). The wiring is not visible.

Do you make use of the direction line as indicated in the L298 data sheet? Check to see if pins 10 & 12 are being changed properly (sorry, that was page 13).
 

CDRIVE

Joined Jul 1, 2008
2,219
Those two cylinders on either side of the L298 are diodes. Check and you will see they are 1N400x (could be 4001 - 4). The wiring is not visible.
Ha, I didn't bother giving a good look at that photo because I didn't think it would reveal anything worthwhile. I also took his word for it. Wow, was I wrong! :eek:
 

GetDeviceInfo

Joined Jun 7, 2009
2,192
Let me ask;

Your project photo shows no brake pushbutton, yet the display shows a brake condition. Tell me, where is your brake pushbutton.
If you have a DVM, place a lead on your AVR's input pin for the left or the right pushbutton. Tell us what the readings are before and after you push the corresponding pushbutton. Then do the same for your brake pushbutton.

Until you resolve the controllers ability to decipher the inputs, don't worry about the outputs. Unless of course someone has spied smoke potential.
 

hgmjr

Joined Jan 28, 2005
9,027
I have examined the code and cannot find a "C" statement anywhere that sets PORTB BIT3 high to enable the L298. It gets set to zero during the initialization and the statement DDRB = 0x08; clearly set PORTB BIT3 to be an output. Is it possible that there is additional code that you have excluded from the listing that you provided?

hgmjr
 
Top