PIC and MOSFET in switch mode

Thread Starter

french_guy

Joined Apr 16, 2009
42
Actually, my main concern is to know what is the level of the PIC’s output if it’s not powered: 0V or “unknown state”?
This is why I’ve put the pullup resistor….
But you said “the pullup should work OK and not effect the PIC at all unless it is connected to one of the programming pins”….
But actually, the output of the PIC will be cabled thru the 1Kohm resistor….. But the PIC might be powered or not!!!
So basically, the 5V thru the 10kohm pullup resistor means “injecting” 5V onto the PIC’s output, which might damage it?
So at the end, I should make sure that I power on the proto board (thus the PIC) first, then the 12V and then install the battery to be discharged. In that case, I can remove the pullup resistor
 

Thread Starter

french_guy

Joined Apr 16, 2009
42
Just to give some updates…
I spent almost my whole week-end on this project, only to have at the end the micro-controller working!!!
I had to make some test between different computers because the downloading cable wasn’t working, and I also had to test this cable and another one
between XP computer and Win98 computer, etc….Well, yesterday night, I was able to program and test my micro-controller from an “old” laptop!!!!
The basic program works well, now I have to do the interface with the NPN and the MOSFET
1 question though: I’ve seen different schematics with the load (R=5 Ohm/10W) between +V and D or between S and 0V….
Where is supposed to be connected the load?
If I want to control the current later on with PWM, I’ll have to use a resistor sensor, and I could have the load between S and 0V and them mesure the voltage?

thanks
 

Attachments

jpanhalt

Joined Jan 18, 2008
11,087
You will have an easier time with Option #1 --so-called low-side switch.

To understand that, consider what happens in Option #2 --so-called high-side switch-- as the current through load increases. The potential at S approaches the potential at D. Assume a battery potential of 8 volts, then the 12V you have at the gate will be only 4V above S, which is not enough to turn it on completely.

If you use the low-side switch configuration (Option 1) you will always have 12V to turn the gate on fully. You might even consider using a logic-level mosfet and eliminate the transistor, as mentioned earlier in this thread.

John
 

Thread Starter

french_guy

Joined Apr 16, 2009
42
Thanks for the explanation….
I’ll go with schematic #1 (“Low side switch”)
I’m using IRF 1104 because I’ve them available right now….
Logic level MOSFET would be much better of course (easier), but I would have to order online and it will take time (my local Radioshack doesn’t have this kind of part)
By the way, what is a good place to buy electronic parts on the web, with good availability and reasonable shipping costs?

Thanks
 

Thread Starter

french_guy

Joined Apr 16, 2009
42
Just an additional comment: I’m building this project only to test Ni-mh battery cell by cell
That means only ~1.2 V….In schematic #2, potential at Source will be 0.6V, and then potential at Gate will become 12-0,6=11,4V
Still enough to have the MOSFET wide open
And I could use the potential at Source to adjust my current with PWM (however I will probably need a better – fatser – driver, or find a logic-level MOSFET)
Am I correct?
 

jpanhalt

Joined Jan 18, 2008
11,087
[By the way, what is a good place to buy electronic parts on the web, with good availability and reasonable shipping costs?
That question could start a fight. I assume you are in the USA. Common sources are Newark, DigiKey, and Mouser for general needs. There are some surplus dealers (MPJ Associates, Electronics Goldmine, etc.), but I use them only for special items when the discount justifies the shipping expenses.

Which of the first three to use would depend on where you live, the size of your orders, and timeliness that you need. You will also find differences between Mouser and DigiKey for which brands they carry and prices. Check, for example, the prices and selection for electrolytic capacitors.

In Ohio, I get best service from DigiKey and use it mostly (at least 80%). Mouser is good, but maybe a day or two longer. Newark is my last choice, mainly because I prefer the others' on-line catalogs. Also, DigiKey must collect sales taxes as a result of a court consent decree; whereas, Mouser can still put the burden of paying state sales taxes on the purchaser. That is inconvenient to do, but also, I feel it is an unfair application of taxation to benefit one business over another when the businesses are in fact in essentially the same market. All-in-all, DigiKey turns out to be a little more expensive than Mouser in my experience.

E-bay is another option, but there are risks and the prices are often not that good for small components. I have gotten some nice assortments off ebay that are not available from regular retail suppliers.

John
 

Thread Starter

french_guy

Joined Apr 16, 2009
42
Well, I just did a quick test of the NPN inverter driver
With the output of the PIC at 5V, I do have 0V on the output of the driver
But when the output of the PIC is set to low (0V) I only have ~8V, and not the 12V of the power supply...
What's wrong?
Rb is 500Ω, and Rc is 1kΩ. The transistor is a 2N3904

Thanks
 

Thread Starter

french_guy

Joined Apr 16, 2009
42
Finally I did that one (see picture) and it works fine
I’ll have to tweak the BASIC program a little bit, but it works
I already used it to discharge 3 cells yesterday
Next step will be to use PWM and control the current to keep it constant
 

Attachments

Top