![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
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 |
|
|
|
|
|
|
(permalink) | |||
|
Quote:
Quote:
Quote:
|
||||
|
|
|
|
|
(permalink) |
|
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. |
|
|
|
|
|
|
(permalink) |
|
darn Nigel you have twiddly fingers...
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
Nigel sir,
are you alwayes on line for us. (not to conser to the thread) thanks for reply. |
|
|
|
|
|
|
(permalink) |
|
ah hah!
thanks mate both responses very useful! going to have a play and see what i can do, cheers |
|
|
|
|
|
|
(permalink) |
|
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. |
|
|
|
|
|
|
(permalink) |
|
..yeah if i knew what one of them was that would be great.. wanders off to google (again!), cheers
|
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| 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 |