> -----Original Message----- > From: piclist-bounces@mit.edu > [mailto:piclist-bounces@mit.edu] On Behalf Of David VanHorn > Sent: Wednesday, February 14, 2007 12:40 PM > To: Microcontroller discussion list - Public. > Subject: Re: [EE] Problem using logic level MOSFET as a PIC > controlledpowerswitch > > > > > The control pins for both servos and the ultrasonic sensor are LOW > > during sleep. I never thought of this being an issue. I > will check it > > tonight or tomorrow and see if setting them HIGH fixes the problem. > > > Either way, this looks like a problem. > > I wouldn't gate the power to the servos this way, nor would I > run them from the same VCC that runs the micro. > A separate battery for the servos, or heavy filtering, with a > series diode to prevent load on the servos from crashing VCC. > P-fets in series with the + lead on the servos would be a > more conventional way to fly, you'd need NPN open collector > drivers between the pic and the Pfets. > -- > > Hi, Sorry for the long delay in my reply. Work was hell this week. Setting the control pins for the servos and sensors high before putting the pic to sleep has solved the problem. With the pic sleeping, I measure about 325 microamps. That's still too high according to my calculations but acceptable. Now I need to figure out if I've left a pic peripheral active or something. The 18F4520 has a much more complex power management system than I'm used to dealing with. I expect to have a fun time with the datasheet :) Dave - you mention that a P-FET is the more conventional switching method. I'd like to know why? My understanding is that the N channel devices are better because of lower Ron. They are also simpler to control - no transistor interface required. I would be interested in hearing why this is not the best choice. As for connecting the servos directly to the pic's Vcc rail, I know this is an issue. I wanted the first prototype to be as simple as possible and I did not see or measure any serious noise issues while testing this on a breadboard - so I left out the filtering being lazy!) I am currently working on an improved power system. For starters, I'm working on a small boost regulator (mainly because I've really wanted to try making one) to drive the sensor bus. I don't have much headroom with 4 NiMH batteries and the ultrasonic sensor does not work well when the voltage drops below about 4.5 volts. I have not decided what to do with the pic power yet, but I do plan on adding filtering to the servo connectors since I know that other servos will not be as clean as the ones I'm using now. I just lucked out with this particular pair. Rolf - thanks for catching the backwards leds on the schematic. Because of the board layout, I'm driving these with inverted logic - I was not thinking when I drew them on the schematic I posted. Thanks to everyone for your comments. Chris -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist