Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DC motor control with direction and speed by serial port

Status
Not open for further replies.

aakash

New Member
Hi, I want to control a dc motor with serial port.
The speed should vary according to value at serial port.
1 to 7 bits for speed control
8th bit should control the direction of the motor. 1-CW,0-CCW

Please help me
Its urgent for my UG project.
I am mechanical student and an electronic newbie
 
Hi,
First of all you'll require a serial to parallel converter to convert your serial data from serial port to parallel, then digital PWM generator which will change the pulse width (and finally the average DC voltage across the motor) depending upon the output of serial-to-parallel converter and finally a H-bridge to drive the motor in either direction.
Or the other option is to use a microontroller which will directly generate PWM pulses to drive H-bridge. But that will require a knowledge of assembly programming and since you are a mech. student I won't suggest you to go for it.

I would like to say that you are making things more complicated out over here. If you use parallel port, it will remove the serial to parallel stage.
 
yes, but serial is easier to send by radio or something else.
but if your robot will be controlled with a cable, i suggest you go for paralel. the programming is easyer too.
 
Microcontroller ?

How about an RS232 line driver (for voltage shifting).
Serial data (now 0 -- 5v) into microcontroller.
Microcontroller decodes (simple shift register job) to parallel.
Microcontroller uses 7 bits to output an analogue (128 steps) value for speed to a power transistor as an emitter follower (allows higher current).
Microcontroller outputs 8th bit to a relay for reversing the motor.

If the microcontroller can output analogue then magic, if not then build a simple D-A with 7 binary-weighted resistors and an op-amp buffer.

The lot could be as small as 3 off 8 pin ICs and a transistor. Hey, if this is single direction RS232 then skip the line driver and use a resistor and zener ?

I was thinking of suggesting my old favourite the 6402 UART and a host of other bits but the above could be more elegant ?

##################
What's this thing about serial being harder to program than parallel ?
I reckon the opposite is true, my pocket PC serial port is easy in BASIC, I just send it a number or character. The parallel port (printer) is unreachable!
Similar thing on my Sinclair ZX81 (now in storage) and Amiga A500+; all proper computers, not like this Windoze/Intel conspiracy !!
##################
 
yes parallel is easy, but i am driving two steppers with it.
So i guess there is only serial port left for communicaton
 
but why do you need 8 bits for 2 steppper motors?
you can use some simple ic to control them only with 4 bits.
do you get me?
then you will have 4 more bits for the other things.
 
hey bro i want to controll two dc motors with serial port (serial port is the condition of instructor), i read your above comment and i m using 74hc595 shift register but i dont know how to wire the shift register with serial port... plz help me
thanks :)
 
hey bro i want to controll two dc motors with serial port (serial port is the condition of instructor) in both directions, i read your above comment and i m using 74hc595 shift register but i dont know how to wire the shift register with serial port... plz help me
thanks :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top