PDA

View Full Version : L293D used to reverse motor direction 7.8 vdc



rjsutton
02-08-2020, 11:21 PM
I have a setup that uses 2 x 18650 3.7V 4000Mah batteries in series ( producing 7.8Vdc. Im trying to control a 6-9V dc miniature motor with 2 buttons 1 button to CW and the other to CCW
Ive been told that a L293d will work but ive blown up 5 so far
I think the problem is im imputing too high a current into the Vcc1 (pin 16) which calls for 5V (max 7) attached is a diagram i found with basic setup I would appreciate someone confirming the setup IF I REDUCE INPUT TO 5VDC
Also if i connected something to the end of the + 7.8v feed to reduce the current to 5V .
Im not electronics savvy so appreciate any help
Thanks Richard

cropwell
03-08-2020, 01:52 AM
You will need to put the 7.8V onto pin 8 (VCC2) and all your switching and VCC1 have to be 5V. So you need a LM7805 voltage regulator to derive that 5V.

rjsutton
03-08-2020, 02:48 AM
You will need to put the 7.8V onto pin 8 (VCC2) and all your switching and VCC1 have to be 5V. So you need a LM7805 voltage regulator to derive that 5V.

Hi thanks assume the lm7805 can just come off the end of the main feed ( going to vcc2pin 8) so betweem 8 and 16 or does it need dedicated feed?
thanks

cropwell
03-08-2020, 03:04 AM
No, you don't need a separate input, you can connect the 7.8V from the two batteries to VCC2 and the input of the LM7805 (pin1). Pin2 connects to GND and connect the out put (pin3) to VCC1 and all control inputs through the switches.

rjsutton
03-08-2020, 03:23 AM
Hi so as drawn now OR does the feed go straight to 8 and no feed to 9 ? if so does the common power for switches come off pin 9 or am i wrong again. appreciate the help

cropwell
03-08-2020, 03:39 AM
5V output of the lm7805 goes to switches.

28670

rjsutton
03-08-2020, 03:43 AM
Thanks very much so im actually switching 5 v thru the switch but the output to motor 11 14 is the 7.8V ?
think ive got it now

Doddy
03-08-2020, 07:24 AM
It's worth reading section 10 of the attached data sheet re. heatsinking - if you're drawing high currents:-

https://www.ti.com/lit/ds/symlink/l293.pdf

rjsutton
03-08-2020, 11:23 PM
Hi
thanks Doddy
the motor is rated
mA: 120
Stall mA: 200
so dont think is very high so im not worrying about heatsink ( am i correct?

Doddy
03-08-2020, 11:51 PM
To be honest I almost deleted my post, reviewing the link that I provided - it didn't feel like my concerns were going to be realised. Proof of pudding is a wet finger on top of the device when rapidly changing direction, but it looks like the device is adequate without heatsink. If you burn your finger, however...

rjsutton
05-08-2020, 05:39 AM
Hi Cropwell
mate as soon as i connect pin 3 lm78 to 16 on l293d the voltage drops from 5V to 2.56 and the motor power drops by about 50%
unhook pin 3 and gets 5v perfect
cant see where ive gone wrong i have 8.3 v at pin 1 LM78 and 8 on L29
motor connections 11, 14
switch power from pin 16,9
other switch wires pin 10,15
Have tries removing switch power at 16 and feeding both + sides from pin 9 but doesnt work
any help please?
also Doddy may have a thought

rjsutton
05-08-2020, 05:40 AM
Hi Cropwell
mate as soon as i connect pin 3 lm78 to 16 on l293d the voltage drops from 5V to 2.56 and the motor power drops by about 50%
unhook pin 3 and gets 5v perfect
cant see where ive gone wrong i have 8.3 v at pin 1 LM78 and 8 on L29
motor connections 11, 14
switch power from pin 16,9
other switch wires pin 10,15
Have tries removing switch power at 16 and feeding both + sides from pin 9 but doesnt work
any help please?
also Doddy may have a thought

Doddy
05-08-2020, 12:55 PM
Apologies - I started to reply to this earlier before work but somehow lost my post. This is an abridged version:


I'd be concentrating in the first instance on establishing the logic supply (the +5V) to the L293 - without this you're going no-where. Add decoupling caps if you've not done so already (ref. the LM7805 datasheet for detail). If you can, measure the current drawn by the L293 - the standard 7805 can source 1A, and will current limit somewhere above that (by dropping the V-out). The L293 datasheet suggests the logic supply should be 60mA, max - above this and you have a problem - either wiring, or a knackered L293. Any metal tab on the 7805 is internally connected to common (ground/0V) - so take care that this doesn't short to something that it shouldn't.


I wouldn't even worry about the motor wiring etc until you stabilise the 5V logic supply.


If you find you keep blowing the L293s, I would consider removing the motor and channel-by-channel testing the circuit/switches with a DMM to ground.


The circuit is trivial (I mean that in the sense that there's little to go wrong) - it should be straightforward to diagnose with the above. If you report back we can take it further.

rjsutton
06-08-2020, 02:43 AM
Hi Doddy
thanks for above
decoupling caps never heard of but googled and think i know where to put them. I dont have any so onwards
the output of LM708 is between 3.8 and 5v ( just changes sometimes!!!!! )
regardless the button for cw produces an output around the battery input so i guess you could say that circuit is working
BUT i can get any power out of anything when i press CCW button even tried the switch on the other side of the l293 any nothing there either
Hsvr tried 3 different L293 ans 2 lm708 and the same happens
when i do have a static current of 5v to pin 16 the same results (cw works fine but ccw nothing
Am i wiring the l293 wrong?
looked at its data sheet and all seems correct in my brain ( not sure what inverting means
all i want is to have 2 buttons
1 to make 6v motor cw push another and ccw.
Is there a better module ? i only have 23mm max width of any piece so a whole aduno breadboard thing wont fit
just tried new Lm708 and when pin 16 is NOT connected i get a static 5v. as soon as wired to 16 drops to 3.8 ish seeems strange i have a 1.2v on pin 14 and or 11 like its bleeding power to these pins ( motor connections )28690

Doddy
06-08-2020, 07:12 AM
Hi Doddy
thanks for above
decoupling caps never heard of but googled and think i know where to put them. I dont have any so onwards
the output of LM708 is between 3.8 and 5v ( just changes sometimes!!!!! )
regardless the button for cw produces an output around the battery input so i guess you could say that circuit is working
BUT i can get any power out of anything when i press CCW button even tried the switch on the other side of the l293 any nothing there either
Hsvr tried 3 different L293 ans 2 lm708 and the same happens
when i do have a static current of 5v to pin 16 the same results (cw works fine but ccw nothing
Am i wiring the l293 wrong?
looked at its data sheet and all seems correct in my brain ( not sure what inverting means
all i want is to have 2 buttons
1 to make 6v motor cw push another and ccw.
Is there a better module ? i only have 23mm max width of any piece so a whole aduno breadboard thing wont fit
just tried new Lm708 and when pin 16 is NOT connected i get a static 5v. as soon as wired to 16 drops to 3.8 ish seeems strange i have a 1.2v on pin 14 and or 11 like its bleeding power to these pins ( motor connections )28690

The caps should go as close as possible to the input/output pins on the 7805 - you might find that it's possible to mount them physically to to the 7805 pins.

The behaviour of the caps is the stabilise the operation of the 7805 - which can go into oscillation in the absence of these - that is bad (I'm not suggesting that's your problem - although I could imagine you reading a different voltage on a DMM than 5V if the 7805 goes into oscillation). If I've time tonight I might try testing a 7805 with/without capacitors to observe the behaviour.

The 7805=5V dropping to 3.8V on connecting to Pin16/L293 is very significant, and I'm thinking that's the thing we need to fix.

Can you take a photo of the electronic assembly - I just want to eyeball what you've done wrt the schematic, take out any uncertainty on my side. Also, the underside of the board (I'm assuming some form of breadboard/vero board). In particular there I want to make sure that you've isolated pins on the same row on the L293 (1-16, 2-15 etc).

Re "Inverting" - the only reference on the datasheet is the non-inverting inputs on the L293 device. This simply means that if the input voltage is "high" (near 5V) then the output voltage will be "high" (near VCC2). If the input voltage is "low" (near 0V) then the output voltage will be low (near 0V),

The L293 is a suitable device for what you're trying to do.

cropwell
06-08-2020, 02:20 PM
Hi Doddy,

A couple of questions.
1. Can a logic input float or does it need to be strapped to ground with a 10k resistor?
2. Do the CW and CCW buttons operate independantly or do you have to press one of them for movement and the other at the same time to change direction.

When operating a module from an arduino, I make it standard practice to have a resistor to ground on the input (I have been caught out big time in the past with floating logic:witless:)

Rob

Doddy
06-08-2020, 06:32 PM
Datasheet says TTL compliant - so they can float (but float high). Looking at the equivalent input circuit on the datasheet also corroborates this - and really you'd want the switches to pull low, rather than pull high. But that doesn't explain the behaviour of the PSU.

rjsutton
07-08-2020, 04:08 AM
Doddy
im not using any breadboard etc im soldering directly to the L293d pins i dont physically have the space to have a breadboard
Ive been super careful to keep the heat down and not shorting with the solder ( between pins) that said the photo would not be clear enough
ive recreated with 5 no L293d and 3no lm708s and get identical readings and problems so dont think its a soldering problem
I dont understand why the power feed from 16 is looped thru push button + to pin9
is the drawing fundamentally wrong?

Doddy
07-08-2020, 06:36 AM
Doddy
im not using any breadboard etc im soldering directly to the L293d pins i dont physically have the space to have a breadboard
Ive been super careful to keep the heat down and not shorting with the solder ( between pins) that said the photo would not be clear enough
ive recreated with 5 no L293d and 3no lm708s and get identical readings and problems so dont think its a soldering problem
I dont understand why the power feed from 16 is looped thru push button + to pin9
is the drawing fundamentally wrong?

Pin 16 (VCC1) is connected directly to Pin 9, according to your diagram. Pin 9 is the 3,4 enable pin - if HIGH (5V) then the outputs 3,4 (pins 11, 14) are enabled. if Low then outputs 3,4 go high-impendance (Read: OFF). So what is concerning you?

The other contact of the switch (marked CCW in your diagram) goes into the pin 10 (input 3, "3A") which drives through the driver chip one side of the motor to either +VCC2 or GND.

Describe the behaviour of the 5V supply - does it drop to 3.8 V in response to a button press?

EDIT: Just a thought as I was about to leave the house... wiring directly to pins, as far as I understand from your description you're completely disregarding the thermal requirements for the L293D - read the datasheet.

rjsutton
07-08-2020, 06:52 AM
No it just drops to 3.8v when its connected to 16
i thought the complete circuit 16-cw-ccw-9 would cause problems . obviously its fine
the buttons are pressed separately CW produces a current of 8.21 when pressed from pin 14 to motor and .12 from 11
Cww doesnt produce anything. what SHOULD occur. would the current from pin 14 be .12 be 8.21 from 11 ? would this create a ccw situation at motor?

Doddy
08-08-2020, 07:00 AM
I'm starting to back away slowly from this thread as it's clear that you haven't got a lot of experience with electronics... happy to take this PM as there's a lot of alignment needed here to get us on the same page/understanding which is kind of off-topic for the majority of posts on these forums.

Firstly, please give me/us the photo that I asked for. At the moment we're trying to guess a lot about a fairly unconventional lash-up that you've done. Even if this just corroborates your explanation it removes a huge amount of uncertainty from this thread. I acknowledge what you say about any image being unclear - but it's clearer than my crystal ball, believe me.

Now, earlier, I asked about measuring current (during the CCW/CW operation), but you've reported a voltage, labelling it current. Current and Voltage are different quantities (there's usually a relationship, however), but measuring current is done differently - selecting the current-range on a DMM and placing the meter leads in SERIES (rather than parallel/across) the device being measured. IMPORTANT: a DMM measures current by measuring the voltage across a precision, very low value resistor internal to the DMM... which is why after measuring a current you really should recover the DMM to set-up to read voltage, because if you next try to measure a voltage with the DMM configured for current you will present that very low value resistor across the meter leads and likely pop the fuse in the DMM, or otherwise destroy something usually expensive. If you want any information or advice on measuring current, or anything else, PM me. (it's a shame I can't / can't figure how to include images in PMs... may have to revert to email).

The reason that I was asking you to measure the current between the 7805 and the L293D was to understand if the 7805 was entering an overcurrent protection mode... a necessary step in understanding what should otherwise be a very straight forward circuit. That you dropping the voltage (not current) to 3.8V is sinister and must be resolved. It would suggest the L293D is pulling more current than the 7805 is designed for which either indicates a failed L293D or a short in your wiring.

EDIT: One simple question: Is your goal here to understand and to develop your solution?, or are you just looking for something that works to get you moving onwards? Genuine question... if the latter then you probably want a turnkey solution rather than a protracted diagnostic thread.

cropwell
08-08-2020, 01:00 PM
I can understand your need to have the circuit as small as possible, but I would advise building it on a breadboard first to check it works.