Pages: [1]   Go Down
Author Topic: Reverse polarity  (Read 1168 times)
0 Members and 1 Guest are viewing this topic.
Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am building an Arduino controlled robot-car with a hacked RC car, I heard there is a way you can reverse polarity on the PWM pins to change the direction the motor spins. How is that done?
Thanks so much.
Logged

What is man's best friend? The breadboard!

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1376
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You simply reverse the motor connections to whatever is driving it.  If however you wish to reverse the "phasing" of the PWM signal, (change 20% on, 80% off, to 80% on, 20% off) simply feed it through a transistor or fet to invert the signal (phase).
Logged

Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So does a transistor reverse the polarity?
Logged

What is man's best friend? The breadboard!

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1376
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Used in common collector mode a transistor reverses the phase. 
Polarity is a relative thing. 
If your reference point is the circuit negative (commonly referred to as GND) then all signals are positive polarity. 
If you use VCC as your reference point then all signals are negative polarity.
Logged

Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So can I use a transistor to make negative positive and positive negative to make to motor spin to other direction?
Thanks so much and sorry if this question seems silly
Logged

What is man's best friend? The breadboard!

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What you need is an H-Bridge.

http://en.wikipedia.org/wiki/H_bridge
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2566
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How it looks like your " with a hacked RC car"?  There is a big chance , that it already has H-bridge, probably 2 of them.
Post a picture.
There is a pics from my last project, also based on "hacked R/C car"
http://coolarduino.files.wordpress.com/2012/07/dscf0080.jpg On top and top-right you can see 4 +4 transistors, essential part of 2 H-bridges
Logged

Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you so much!
Logged

What is man's best friend? The breadboard!

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2566
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are welcome.  Just figure out two signal lines of inputs to those bridges, "cut-in" with arduino and you would be able to take full control of the car.
Some thoughts:
- turn on/off leds representing right/left turning signals;
- -//-                                          front/rear lights;
- "beep" horn;
- add voice module, which would play "yes, sir!" or "no, sir" whenever radio receiver outputs some signals.
Logged

Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks sooooo much.
How do you add a voice module? Is it some sort of speaker? I heard there's something called a piezo, is that it?
Logged

What is man's best friend? The breadboard!

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2566
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Search for shieds, for example: https://www.sparkfun.com/products/10628
Logged

Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Magician,
    Sorry I didn't see your post of the hacked RC car. What I mean by hacked is that it is bare bones-just the chassis and the motors. So I don't think it has an H-bridge.
Thanks
Logged

What is man's best friend? The breadboard!

Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do I have to use a shield? Is there a bare-bones way to do it?
Logged

What is man's best friend? The breadboard!

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2566
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Simply to reverse a polarity you can do with a relay.  Better way is H-bridge, as it was suggested above.
http://www.talkingelectronics.com/projects/H-Bridge/H-Bridge-1.html
If you are newbie, I don't think you are up to build one, search for shields,  or at least for IC, L293  and L298 pretty common for starters.
There are also a kits available, I just build one myself recently :
http://www.solarbotics.com/product/k_cmd/
Though, after I assembled it I realized I need more current  smiley-red
Logged

Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you so much for your help!
Logged

What is man's best friend? The breadboard!

Pages: [1]   Go Up
Jump to: