Hello,
I am attempting to control a 24VDC, 1A motor using an Arduino Uno and L293 H Bridge. I have been struggling with this as the motor has 3 ports to use, which I want all to be connected at once. To spin ClockWise it needs +24 on 1 and -24 on 2. To spin CounterClockWise, it needs -24 on 1 and +24 on 3. The issue I have is with having Port 1 being connected to + and - at the same time, as this just grounds the circuit. I am looking to remedy this issue with the L293 H Bridge and was wondering if the below set up and code will work or fry my components/ board (which I have already done once). Thank you!
Apologies... In my original post I meant pins 1,3,4. And yes I have been able to rotate the motor CW and CCW with the pins and by applying voltage directly across the motor. However, I would like to use the pin wiring in my design to make use of the switches so I do not over rotate the valve. I have yet to test out the L293 yet, but the motor only pulls 1A so I was thinking it should be okay.
@jremington it seems as if you both are correct. I set up my circuit as I have described above and am getting correct outputs with nothing hooked up. However, as soon as I hook up the motor, I will only get an output of about .5V, no matter the input voltage. I assume this is due to limits of the L293?
I don't understand your post. Where are you making this measurement?
Are you sure you have the L293 and not the L293D? If the L293, then external inductive kick diodes are required. As they are not shown in the posted diagram, you may have destroyed the chip.
@jremington I was taking these measurements across the outputs of the L293NE where the leads to the motor would be connected (i.e. 1+ 3-). When I take these measurements without the motor, I am getting the correct output. However, when I attach the leads to the motor, the voltage drops due to the current draw being too high (I believe). And I am sure that I have the L293NE. I had not seen any documentation regarding diodes to I will look into that...
@TomGeorge the code I am using is in my original post. It is named Motor_Driver_Test.ino
Hi,
Below is a simplified diagram of your schematic, using a L293 will not do the job you need.
The problem is the Enable pins.
When enabled the outputs follow the inputs.
When not enabled the outputs are open circuit.
L293 has tri-state outputs.
But the enables control a pair of outputs.
If motorpin 1 and motorpin 3 need to be HIGH and LOW, both enable pins will need to be HIGH, however this means motorpin 4 is connected to an enabled output, not an open circuit that your motor will need.
Thank you for the explanation. Any suggestions on how to run the motor? I have tried various options (op amps, motor drivers, MOSFETs, solid state relays) and seem to have the same issue regardless of the hardware.
The first thing you need to do is figure out how to wire the motor such that it works properly with a simple, two wire connection to a battery or power supply.
That is the connection you will use for the two outputs of the motor driver.
Then select an appropriate motor driver. Don't bother with the L293.
@jremington I can not have a 2 wire output with the motor configuration (1+/3- and 4+/1-). I think a two output (one output for 1/3 and the other for 4/1) motor driver with the proper current/ voltage capabilities may be the solution.
Looking at that motor wiring diagram, it appears that you have no option but to use the limit switches. In that case, for bidirectional control you need to add two diodes, as done here:
The idea is that when one switch opens up at the end of travel, the diode allows you to reverse the current flow so that the motor can be backed away from that end. You will have to experiment to see which switches are activated, and which way to place the diodes (they MUST oppose each other).
Most likely you will use pins 1 and 6 as the power leads, and connect the diodes to some combination of 3,4, and 5. And what are the "auxiliary limit switches"?
As it is, I don't completely believe the diagram posted previously and below, as the NO (normally open) terminal associated with switch 3 is shown as closed.