Offline
Jr. Member
Karma: 0
Posts: 68
|
 |
« on: February 15, 2013, 04:45:08 am » |
I want to run a dc motor, using just two output pins .
(I cant use a dpdt realy, and an h-bridge requires 4 pins) {I just have tip 122, and I cant get any PNP transistors. }
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 9
Posts: 1000
|
 |
« Reply #1 on: February 15, 2013, 05:41:34 am » |
You can use a H-bridge. I think it is like this: If you keep one pin low, the other pin uses PWM for forward speed. To reverse, do it the other way around, the first pin for PWM and keep the second pin low. If you build a H-bridge yourself, you need extra transistors. Perhaps the best way is to use a H-bridge with optocouplers. With optocouplers you don't have to worry about level shifting or inverting the signal for NPN or PNP transistors. I like this kind of circuit: http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/bjt-circuit.htmlIt can be adapted for NPN transistors only.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
|
 |
« Reply #2 on: February 15, 2013, 05:58:41 am » |
Krodal, what do you thing of using one relay for ON/OFF and another for direction ?
(edit: no, wait, the ON/OFF relay could be replaced by a transistor to be able to use pwm for speed control (to some degree), right ? )
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 68
|
 |
« Reply #3 on: February 15, 2013, 06:18:54 am » |
so what do i finally do?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 68
|
 |
« Reply #4 on: February 15, 2013, 06:41:29 am » |
what about using the L293D ?
the ENABLE pins will always be HIGH(5 v source). to switch off the motors, i can use analogWrite(0)
is this idea going to work?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 68
|
 |
« Reply #5 on: February 15, 2013, 06:42:13 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
|
 |
« Reply #6 on: February 15, 2013, 09:15:54 am » |
You might want to consider adafruit's motor shield then. http://www.adafruit.com/products/81(I'm not linked to adafruit industries in any way, I just happen to have one of those)
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 68
|
 |
« Reply #7 on: February 15, 2013, 11:09:57 am » |
nop, will not spend so much on a shield
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 9
Posts: 1000
|
 |
« Reply #8 on: February 15, 2013, 11:23:18 am » |
nop, will not spend so much on a shield
5 or 6 dollars (inclusive shipping) on Ebay. Search for "motor shield", it is the same as the Adafruit shield, but an older version with cheaper components.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 8
broddoyyyyyyyyyyyyyyyyy
|
 |
« Reply #9 on: February 15, 2013, 01:36:18 pm » |
basta semplicemente che ti compri due relè a doppio contatto collegando i due centrali dei due relè hai due cavi del motore, i due contatti normalmente aperti del relè al meno, ed i due normalmente chiusi al più. Dopo di che fai un ponte tra il + ed il - dell'alimentazione dei relè, e diventa gnd, cosi hai un più per la sinistra ed un più per la destra. Se non hai capito ti posto uno schema..  sono italiano, e questo testo è stato tradotto, probabilmente non capirai.. appena ci riesco ti posto lo schema
|
|
|
|
« Last Edit: February 15, 2013, 01:59:34 pm by casari »
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16572
Available for Design & Build services
|
 |
« Reply #10 on: February 15, 2013, 03:58:21 pm » |
DPDT relay and transistor will work.
+V C -V M+ M- -V C +V
Use transistor to control application of voltage When relay is connected to the left pins, current flows from top to bottom When relay is connected to the right pins, current flows from bottom to top
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16572
Available for Design & Build services
|
 |
« Reply #11 on: February 15, 2013, 04:05:30 pm » |
Okay TIP122, use that to connect V- to Gnd (sink current). Don't forget a 1N4001 type diode across the relay +/- pairs (in parallel with the motor) with cathode on V+ and anod on V-
|
|
|
|
|
Logged
|
|
|
|
|
0
Online
Tesla Member
Karma: 51
Posts: 6590
Arduino rocks
|
 |
« Reply #12 on: February 15, 2013, 07:49:59 pm » |
I want to run a dc motor, using just two output pins .
(I cant use a dpdt realy, and an h-bridge requires 4 pins) {I just have tip 122, and I cant get any PNP transistors. }
You could modify a servo for continous rotation and control direction and speed just using one control line.
|
|
|
|
|
Logged
|
|
|
|
|
Pakistan
Offline
Sr. Member
Karma: 5
Posts: 318
Arduino rocks
|
 |
« Reply #13 on: February 17, 2013, 01:07:55 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
|