Motor driver problem

Status
Not open for further replies.

Omar.M

Member
To use with me 16F684 micro controller, I constructed a motor driver (simple) following this tutorial:
http://www.diylive.net/index.php/2005/12/13/diy-line-following-robot2/
(I used the NPN transistor that I had at home, tried a few different ones btw, and the resistor values were changed because I did not have certain values)

Now the motor I got out of an old hand held fan toy, so it is fairly small. So when I powered the micro controller, it seems that my simple motor code (make the pin with the motor HIGH for 10 seconds, then LOW while another pin was HIGH) works. But as I let it run for a bit more time, it seemed that the seconds were not being timed properly. It seemed, that the motor would turn on for 3-4 seconds, then turn off, while the other pin would be on for much longer.

I do not know why this is happening, but I fear that I am damaging the PIC, and was hoping to fix this. Any ideas what is happening?

Thanks,
Omar
 
First of all, you do not need that emitter resistor in series with the motor. A motor only pulls the current it needs. YOu also need to put a fast recovery or schottky diode in reverse-biased parallel with your NPN MOSFET or else the motor voltage spikes will destroy it (it may have already been damaged from it). You also want a capacitor (fairly large if possible, just not really really small) in parallel with your motor.

You also need small bypass (bypass means they go to ground) capacitors (probably 0.1uF or0.01 uF for what you are doing) on the input pins of the voltage regulator and also for the power pins of the PIC. Without these, it might be possible that motor noise is disrupting your PIC's operation somehow.

Maybe someone else knows about the pins being high or low.
 
Last edited:
Why do you guys love PICs? They are overpriced and underpowered. The Philips LPC2101 is infinitely more powerful for only $3.15 ea in single piece qty at Digikey

As to the prior post about the motor only drawing what it needs that is only true of a 5V motor on a 5V supply. If it is only a 3V motor you are correct in giving it a series resistor, however inefficient that may be.

And before anyone asks, I am an electronic engineer that designs electronic displays with micros. PICs are clumsy, nonstandard, and expensive for what they do.

D.
 
I use PICs because they were the first thing I came by after I gave up trying to figure out the Freescale M68000.
 
Last edited:
cadstarsucks said:
Why do you guys love PICs? They are overpriced and underpowered. The Philips LPC2101 is infinitely more powerful for only $3.15 ea in single piece qty at Digikey.

The PIC has a TON of free development tools and code examples available on the web. Plus they are fairly simple, allowing the hobbyist to build something in a relatively short period of time. The Philips chip looks cool but I doubt it has the amount of free on-line support that any of the more popular PICs do.... Plus the average hobbyist doesn't need something as powerfull as the LPC2101, and most don't even come close to pushing a PIC to it's limits.
 
cadstarsucks said:
Why do you guys love PICs? They are overpriced and underpowered. The Philips LPC2101 is infinitely more powerful for only $3.15 ea in single piece qty at Digikey

What is the code for the 8 pin through hole version of that device?

Mike.
 
That's an ARM chip that's not even close to compareable to an AVR or PIC. Cheap 8 pin AVR's that can generate their own internal clock and have relativly robust output drivers cost as little as 50 cents each. To do anything really useful with an ARM you need to add external memory and drivers, and pay for the compilers.
 


NO you don't. That is only what *they* want you to believe. Stop talking out your backside!

The compilers are FREE for up to 32K of code.
The Luminary LM3S101 is $2.20 in single piece quantity from Mouser.
It has 8K FLASH and 2K RAM on chip.
20MHz 32 bit core with hardware divide and single cycle multiply
SSI with FIFOs, 16550 UART, 2 comparators, 2 32bit timers (can be used as 4 16 bitters), watchdog
Internal oscillator, crystal, and PLL

Can you honestly say that all that functionality at a lower price is beaten out?

D.
 


Who fed you guys these lies anyhow? Acedamia slackers?

D.
 
cadstarsucks said:
And before anyone asks, I am an electronic engineer that designs electronic displays with micros. PICs are clumsy, nonstandard, and expensive for what they do.

You sound like someone who hasn't a clue what they are talking about. An electronic engineer would know not to use a sledge hammer to knock in a thumb tack.

Mike.
 
In case you have forgotten what it's like to be a beginner, many people who start out in this DO NOT have the necessary background (isn't that the definition of beginner?) "the best" chip when they start out, so they pick the most convenient well supported uC and then stick with it- why mess with something that works? I believe that is industry's philosophy too.

Do you really believe someone wanting to get started in electronics would go out, bypass all the PICs with their through-hole devices, all their hobbiest support, examples, and 8-28 pin devices to pick some obscure, 44-pin surface mounted monster, with no support and an extra 12 pins? I think not. Beginners also don't know what "standard" is, so something being non-standard makes little difference.

It doesn't matter how cheap or functional something is unless you have the tools and skills to turn it into something useful.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…