Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 20th October 2006, 01:23 PM   (permalink)
Default PIC16F627 - controlling motors

Hi there,

Recently purchased a velleman pic programmer for n00bs from Maplins.

Managed to work out how to make an LED come on after pushing a button.

Now I am wondering:
How much voltage does the PIC put out when a pin/leg goes "high"?

And how would i go about making a motor come on, as they draw a constant current that is far more than an LED?

I purchased a mini 5Volt relay (pcb mountable), which i was thinking i could have switch the motor on or off?

Any advice welcomed, also what are your thoughts on these DC motor controllers (out of the box, or kit form)?

Cheers,
Paul
drage is offline   Reply With Quote
Old 20th October 2006, 03:05 PM   (permalink)
Default

Quote:
Originally Posted by drage
Hi there,

Recently purchased a velleman pic programmer for n00bs from Maplins.

Managed to work out how to make an LED come on after pushing a button.

Now I am wondering:
How much voltage does the PIC put out when a pin/leg goes "high"?
Roughly 5V, it's a CMOS logic HIGH.

Quote:

And how would i go about making a motor come on, as they draw a constant current that is far more than an LED?
Motors don't take a constant current, far from it!.

Quote:

I purchased a mini 5Volt relay (pcb mountable), which i was thinking i could have switch the motor on or off?
Yes, use a transistor to switch the relay, details in the 'hardware extras' section of my tutorials.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 20th October 2006, 03:10 PM   (permalink)
Default

The "High" voltage is Vdd-0.7V, the current available from any one port pin is 25mA. These are basic figures as used in most of the PIC controllers, and can be obtained by reading the datasheet, along with all sorts of other useful information.

The relay type has to be capable of a pull-in voltage slightly less than Vdd-0.7V and draw less than or equal to 25mA in order to be used directly from the port pin. Even though the port pins have protection diodes in them, I would still recommend that you put a protection diode across the relay coil to dissipate any back emf that is generated.

The arrow points to Vdd like this port pin o-->|--o Vdd
The relay coil being wired across or in parallel with the diode.

A better way to do it is with a cheap transistor and a couple of resistors, that way you don't need to worry about how much current the port pin has to offer, instead the transistor will be providing the "switching function"

Use say a BC337, put the emitter to Vss(Gnd) put a resistor around 10k from Vss to the base of the transistor, and another resistor around 4k7 from the base junction with the other resistor to the port pin. The relay gets wired between the collector and the Vdd, assuming it's a 5V relay of course. Also you still need the protection diode, but this time wire it between the collector of the transistor to Vdd, arrow still points to Vdd.

If you put two transistor output stages together, and drive two change over relays, you can arrange the wiring in such a way that you can not only start/stop the motor, but also change it's direction.
tunedwolf is offline   Reply With Quote
Old 20th October 2006, 03:12 PM   (permalink)
Default

darn Nigel you have twiddly fingers...
tunedwolf is offline   Reply With Quote
Old 20th October 2006, 03:16 PM   (permalink)
Default

Quote:
Originally Posted by tunedwolf
darn Nigel you have twiddly fingers...
When you're fast, you're fast!
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 20th October 2006, 03:44 PM   (permalink)
Default

Nigel sir,
are you alwayes on line for us.
(not to conser to the thread)
thanks for reply.
manish12 is offline   Reply With Quote
Old 20th October 2006, 06:34 PM   (permalink)
Default

ah hah!

thanks mate both responses very useful! going to have a play and see what i can do, cheers
drage is offline   Reply With Quote
Old 21st October 2006, 09:09 PM   (permalink)
Exclamation

Just use a logic MOS-FET and conect the gate trought a 4K7 resistor.
God.....i'm using this answer so often :lol.....I'm a MOS-FET fan :lol
__________________
If is too complicated.....most of the times is the wrong way.
Tarsil is offline   Reply With Quote
Old 22nd October 2006, 11:39 AM   (permalink)
Default

..yeah if i knew what one of them was that would be great.. wanders off to google (again!), cheers
drage is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
speed control of AC motors hamid Datasheet/Parts Requests 5 17th June 2007 03:07 PM
Simple Questions for small Motors demestav General Electronics Chat 4 27th February 2005 11:40 PM
Motors used as generators Johnson777717 General Electronics Chat 6 21st January 2004 10:30 AM
controlling hard disk motors using lpt kariem2k General Electronics Chat 2 14th December 2003 08:56 AM
Qbasic program for controlling stepper motors I wrote one ElectroGeek_87 General Electronics Chat 1 5th October 2003 05:19 AM



All times are GMT. The time now is 10:38 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.